Lots of slash command work, added workaround for eris-fleet request debugging
This commit is contained in:
parent
b8aeb6625a
commit
2cffdf6628
61 changed files with 417 additions and 244 deletions
|
@ -12,16 +12,16 @@ class AvatarCommand extends Command {
|
|||
const user = await this.client.getRESTUser(this.args[0]);
|
||||
return user.avatar ? this.client._formatImage(`/avatars/${user.id}/${user.avatar}`, null, 1024) : `https://cdn.discordapp.com/embed/avatars/${user.discriminator % 5}.png`; // repeat of hacky "solution" from above
|
||||
} catch {
|
||||
return this.message.author.dynamicAvatarURL(null, 1024);
|
||||
return this.author.dynamicAvatarURL(null, 1024);
|
||||
}
|
||||
} else if (this.args.join(" ") !== "" && this.message.channel.guild) {
|
||||
} else if (this.args.join(" ") !== "" && this.channel.guild) {
|
||||
const userRegex = new RegExp(this.args.join("|"), "i");
|
||||
const member = this.message.channel.guild.members.find(element => {
|
||||
const member = this.channel.guild.members.find(element => {
|
||||
return userRegex.test(element.nick) ? userRegex.test(element.nick) : userRegex.test(element.username);
|
||||
});
|
||||
return member ? member.user.dynamicAvatarURL(null, 1024) : this.message.author.dynamicAvatarURL(null, 1024);
|
||||
return member ? member.user.dynamicAvatarURL(null, 1024) : this.author.dynamicAvatarURL(null, 1024);
|
||||
} else {
|
||||
return this.message.author.dynamicAvatarURL(null, 1024);
|
||||
return this.author.dynamicAvatarURL(null, 1024);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -12,16 +12,16 @@ class BannerCommand extends Command {
|
|||
const user = await this.client.getRESTUser(this.args[0]);
|
||||
return user.banner ? this.client._formatImage(`/banners/${user.id}/${user.banner}`, null, 1024) : "This user doesn't have a banner!";
|
||||
} catch {
|
||||
return this.message.author.banner ? this.message.author.dynamicBannerURL(null, 1024) : "You don't have a banner!";
|
||||
return this.author.banner ? this.author.dynamicBannerURL(null, 1024) : "You don't have a banner!";
|
||||
}
|
||||
} else if (this.args.join(" ") !== "" && this.message.channel.guild) {
|
||||
} else if (this.args.join(" ") !== "" && this.channel.guild) {
|
||||
const userRegex = new RegExp(this.args.join("|"), "i");
|
||||
const member = this.message.channel.guild.members.find(element => {
|
||||
const member = this.channel.guild.members.find(element => {
|
||||
return userRegex.test(element.nick) ?? userRegex.test(element.username);
|
||||
});
|
||||
return member && member.user.banner ? member.user.dynamicBannerURL(null, 1024) : (this.message.author.banner ? this.message.author.dynamicBannerURL(null, 1024) : "This user doesn't have a banner!");
|
||||
return member && member.user.banner ? member.user.dynamicBannerURL(null, 1024) : (this.author.banner ? this.author.dynamicBannerURL(null, 1024) : "This user doesn't have a banner!");
|
||||
} else {
|
||||
return this.message.author.banner ? this.message.author.dynamicBannerURL(null, 1024) : "You don't have a banner!";
|
||||
return this.author.banner ? this.author.dynamicBannerURL(null, 1024) : "You don't have a banner!";
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@ class BroadcastCommand extends Command {
|
|||
run() {
|
||||
return new Promise((resolve) => {
|
||||
const owners = process.env.OWNER.split(",");
|
||||
if (!owners.includes(this.message.author.id)) return "Only the bot owner can broadcast messages!";
|
||||
if (!owners.includes(this.author.id)) return "Only the bot owner can broadcast messages!";
|
||||
if (this.args.length !== 0) {
|
||||
this.ipc.broadcast("playbroadcast", this.args.join(" "));
|
||||
this.ipc.register("broadcastSuccess", () => {
|
||||
|
|
|
@ -3,24 +3,23 @@ import Command from "../../classes/command.js";
|
|||
|
||||
class ChannelCommand extends Command {
|
||||
async run() {
|
||||
if (this.type !== "classic") return "This command only works with the old command style!";
|
||||
if (!this.message.channel.guild) return "This command only works in servers!";
|
||||
if (!this.channel.guild) return "This command only works in servers!";
|
||||
const owners = process.env.OWNER.split(",");
|
||||
if (!this.message.member.permissions.has("administrator") && !owners.includes(this.message.member.id)) return "You need to be an administrator to enable/disable me!";
|
||||
if (this.args.length === 0) return "You need to provide whether I should be enabled or disabled in this channel!";
|
||||
if (this.args[0] !== "disable" && this.args[0] !== "enable") return "That's not a valid option!";
|
||||
|
||||
const guildDB = await db.getGuild(this.message.channel.guild.id);
|
||||
const guildDB = await db.getGuild(this.channel.guild.id);
|
||||
|
||||
if (this.args[0].toLowerCase() === "disable") {
|
||||
let channel;
|
||||
if (this.args[1] && this.args[1].match(/^<?[@#]?[&!]?\d+>?$/) && this.args[1] >= 21154535154122752n) {
|
||||
const id = this.args[1].replaceAll("@", "").replaceAll("#", "").replaceAll("!", "").replaceAll("&", "").replaceAll("<", "").replaceAll(">", "");
|
||||
if (guildDB.disabled.includes(id)) return "I'm already disabled in this channel!";
|
||||
channel = this.message.channel.guild.channels.get(id);
|
||||
channel = this.channel.guild.channels.get(id);
|
||||
} else {
|
||||
if (guildDB.disabled.includes(this.message.channel.id)) return "I'm already disabled in this channel!";
|
||||
channel = this.message.channel;
|
||||
if (guildDB.disabled.includes(this.channel.id)) return "I'm already disabled in this channel!";
|
||||
channel = this.channel;
|
||||
}
|
||||
|
||||
await db.disableChannel(channel);
|
||||
|
@ -30,10 +29,10 @@ class ChannelCommand extends Command {
|
|||
if (this.args[1] && this.args[1].match(/^<?[@#]?[&!]?\d+>?$/) && this.args[1] >= 21154535154122752n) {
|
||||
const id = this.args[1].replaceAll("@", "").replaceAll("#", "").replaceAll("!", "").replaceAll("&", "").replaceAll("<", "").replaceAll(">", "");
|
||||
if (!guildDB.disabled.includes(id)) return "I'm not disabled in that channel!";
|
||||
channel = this.message.channel.guild.channels.get(id);
|
||||
channel = this.channel.guild.channels.get(id);
|
||||
} else {
|
||||
if (!guildDB.disabled.includes(this.message.channel.id)) return "I'm not disabled in this channel!";
|
||||
channel = this.message.channel;
|
||||
if (!guildDB.disabled.includes(this.channel.id)) return "I'm not disabled in this channel!";
|
||||
channel = this.channel;
|
||||
}
|
||||
|
||||
await db.enableChannel(channel);
|
||||
|
|
|
@ -4,13 +4,13 @@ import * as collections from "../../utils/collections.js";
|
|||
|
||||
class CommandCommand extends Command {
|
||||
async run() {
|
||||
if (!this.message.channel.guild) return "This command only works in servers!";
|
||||
if (!this.channel.guild) return "This command only works in servers!";
|
||||
const owners = process.env.OWNER.split(",");
|
||||
if (!this.message.member.permissions.has("administrator") && !owners.includes(this.message.member.id)) return "You need to be an administrator to enable/disable me!";
|
||||
if (this.args.length === 0) return "You need to provide what command to enable/disable!";
|
||||
if (this.args[0] !== "disable" && this.args[0] !== "enable") return "That's not a valid option!";
|
||||
|
||||
const guildDB = await db.getGuild(this.message.channel.guild.id);
|
||||
const guildDB = await db.getGuild(this.channel.guild.id);
|
||||
const disabled = guildDB.disabled_commands ?? guildDB.disabledCommands;
|
||||
|
||||
if (this.args[0].toLowerCase() === "disable") {
|
||||
|
@ -19,14 +19,14 @@ class CommandCommand extends Command {
|
|||
if (command === "command") return "You can't disable that command!";
|
||||
if (disabled && disabled.includes(command)) return "That command is already disabled!";
|
||||
|
||||
await db.disableCommand(this.message.channel.guild.id, command);
|
||||
await db.disableCommand(this.channel.guild.id, command);
|
||||
return `The command has been disabled. To re-enable it, just run \`${guildDB.prefix}command enable ${command}\`.`;
|
||||
} else if (this.args[0].toLowerCase() === "enable") {
|
||||
if (!collections.commands.has(this.args[1].toLowerCase()) && !collections.aliases.has(this.args[1].toLowerCase())) return "That isn't a command!";
|
||||
const command = collections.aliases.get(this.args[1].toLowerCase()) ?? this.args[1].toLowerCase();
|
||||
if (disabled && !disabled.includes(command)) return "That command isn't disabled!";
|
||||
|
||||
await db.enableCommand(this.message.channel.guild.id, command);
|
||||
await db.enableCommand(this.channel.guild.id, command);
|
||||
return `The command \`${command}\` has been re-enabled.`;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,7 +4,7 @@ import Command from "../../classes/command.js";
|
|||
|
||||
class CountCommand extends Command {
|
||||
async run() {
|
||||
if (this.message.channel.guild && !this.message.channel.permissionsOf(this.client.user.id).has("embedLinks")) return "I don't have the `Embed Links` permission!";
|
||||
if (this.channel.guild && !this.channel.permissionsOf(this.client.user.id).has("embedLinks")) return "I don't have the `Embed Links` permission!";
|
||||
const counts = await database.getCounts();
|
||||
const countArray = [];
|
||||
for (const entry of Object.entries(counts)) {
|
||||
|
@ -33,8 +33,8 @@ class CountCommand extends Command {
|
|||
},
|
||||
description: value.join("\n"),
|
||||
author: {
|
||||
name: this.message.author.username,
|
||||
icon_url: this.message.author.avatarURL
|
||||
name: this.author.username,
|
||||
icon_url: this.author.avatarURL
|
||||
}
|
||||
}]
|
||||
});
|
||||
|
|
|
@ -4,7 +4,7 @@ import Command from "../../classes/command.js";
|
|||
class EvalCommand extends Command {
|
||||
async run() {
|
||||
const owners = process.env.OWNER.split(",");
|
||||
if (!owners.includes(this.message.author.id)) return "Only the bot owner can use eval!";
|
||||
if (!owners.includes(this.author.id)) return "Only the bot owner can use eval!";
|
||||
const code = this.args.join(" ");
|
||||
try {
|
||||
const evaled = eval(code);
|
||||
|
|
|
@ -4,7 +4,7 @@ import Command from "../../classes/command.js";
|
|||
class EvalRawCommand extends Command {
|
||||
async run() {
|
||||
const owners = process.env.OWNER.split(",");
|
||||
if (!owners.includes(this.message.author.id)) return "Only the bot owner can use evalraw!";
|
||||
if (!owners.includes(this.author.id)) return "Only the bot owner can use evalraw!";
|
||||
const code = this.args.join(" ");
|
||||
try {
|
||||
const evaled = eval(code);
|
||||
|
|
|
@ -7,7 +7,7 @@ import Command from "../../classes/command.js";
|
|||
class ExecCommand extends Command {
|
||||
async run() {
|
||||
const owners = process.env.OWNER.split(",");
|
||||
if (!owners.includes(this.message.author.id)) return "Only the bot owner can use exec!";
|
||||
if (!owners.includes(this.author.id)) return "Only the bot owner can use exec!";
|
||||
const code = this.args.join(" ");
|
||||
try {
|
||||
const execed = await exec(code);
|
||||
|
|
|
@ -8,7 +8,7 @@ const tips = ["You can change the bot's prefix using the prefix command.", "Imag
|
|||
|
||||
class HelpCommand extends Command {
|
||||
async run() {
|
||||
const { prefix } = this.message.channel.guild ? await database.getGuild(this.message.channel.guild.id) : "N/A";
|
||||
const { prefix } = this.channel.guild ? await database.getGuild(this.channel.guild.id) : "N/A";
|
||||
if (this.args.length !== 0 && (collections.commands.has(this.args[0].toLowerCase()) || collections.aliases.has(this.args[0].toLowerCase()))) {
|
||||
const command = collections.aliases.get(this.args[0].toLowerCase()) ?? this.args[0].toLowerCase();
|
||||
const info = collections.info.get(command);
|
||||
|
@ -19,7 +19,7 @@ class HelpCommand extends Command {
|
|||
name: "esmBot Help",
|
||||
icon_url: this.client.user.avatarURL
|
||||
},
|
||||
title: `${this.message.channel.guild ? prefix : ""}${command}`,
|
||||
title: `${this.channel.guild ? prefix : ""}${command}`,
|
||||
url: "https://projectlounge.pw/esmBot/help.html",
|
||||
description: command === "tags" ? "The main tags command. Check the help page for more info: https://projectlounge.pw/esmBot/help.html" : info.description,
|
||||
color: 16711680,
|
||||
|
@ -49,7 +49,7 @@ class HelpCommand extends Command {
|
|||
}
|
||||
return embed;
|
||||
} else {
|
||||
if (this.message.channel.guild && !this.message.channel.permissionsOf(this.client.user.id).has("embedLinks")) return "I don't have the `Embed Links` permission!";
|
||||
if (this.channel.guild && !this.channel.permissionsOf(this.client.user.id).has("embedLinks")) return "I don't have the `Embed Links` permission!";
|
||||
const pages = [];
|
||||
if (help.categories === help.categoryTemplate && !help.generated) await help.generateList();
|
||||
for (const category of Object.keys(help.categories)) {
|
||||
|
@ -85,7 +85,7 @@ class HelpCommand extends Command {
|
|||
},
|
||||
fields: [{
|
||||
name: "Prefix",
|
||||
value: this.message.channel.guild ? prefix : "N/A"
|
||||
value: this.channel.guild ? prefix : "N/A"
|
||||
}, {
|
||||
name: "Tip",
|
||||
value: random(tips)
|
||||
|
@ -100,6 +100,7 @@ class HelpCommand extends Command {
|
|||
static description = "Gets a list of commands";
|
||||
static aliases = ["commands"];
|
||||
static arguments = ["{command}"];
|
||||
static slashAllowed = false;
|
||||
}
|
||||
|
||||
export default HelpCommand;
|
||||
|
|
|
@ -7,7 +7,7 @@ import Command from "../../classes/command.js";
|
|||
|
||||
class ImageSearchCommand extends Command {
|
||||
async run() {
|
||||
if (this.message.channel.guild && !this.message.channel.permissionsOf(this.client.user.id).has("embedLinks")) return "I don't have the `Embed Links` permission!";
|
||||
if (this.channel.guild && !this.channel.permissionsOf(this.client.user.id).has("embedLinks")) return "I don't have the `Embed Links` permission!";
|
||||
if (this.args.length === 0) return "You need to provide something to search for!";
|
||||
this.acknowledge();
|
||||
const embeds = [];
|
||||
|
@ -27,8 +27,8 @@ class ImageSearchCommand extends Command {
|
|||
url: encodeURI(value.img_src)
|
||||
},
|
||||
author: {
|
||||
name: this.message.author.username,
|
||||
icon_url: this.message.author.avatarURL
|
||||
name: this.author.username,
|
||||
icon_url: this.author.avatarURL
|
||||
}
|
||||
}]
|
||||
});
|
||||
|
|
|
@ -3,7 +3,7 @@ import Command from "../../classes/command.js";
|
|||
class ImageReloadCommand extends Command {
|
||||
async run() {
|
||||
const owners = process.env.OWNER.split(",");
|
||||
if (!owners.includes(this.message.author.id)) return "Only the bot owner can reload the image servers!";
|
||||
if (!owners.includes(this.author.id)) return "Only the bot owner can reload the image servers!";
|
||||
const amount = await this.ipc.serviceCommand("image", { type: "reload" }, true);
|
||||
if (amount > 0) {
|
||||
return `Successfully connected to ${amount} image servers.`;
|
||||
|
|
|
@ -7,6 +7,7 @@ class InviteCommand extends Command {
|
|||
|
||||
static description = "Gets my invite link";
|
||||
static aliases = ["botinfo", "credits"];
|
||||
static slashAllowed = false;
|
||||
}
|
||||
|
||||
export default InviteCommand;
|
|
@ -2,10 +2,16 @@ import Command from "../../classes/command.js";
|
|||
|
||||
class PingCommand extends Command {
|
||||
async run() {
|
||||
const pingMessage = await this.client.createMessage(this.message.channel.id, Object.assign({
|
||||
content: "🏓 Ping?"
|
||||
}, this.reference));
|
||||
pingMessage.edit(`🏓 Pong!\n\`\`\`\nLatency: ${pingMessage.timestamp - this.message.timestamp}ms${this.message.channel.guild ? `\nShard Latency: ${Math.round(this.client.shards.get(this.client.guildShardMap[this.message.channel.guild.id]).latency)}ms` : ""}\n\`\`\``);
|
||||
if (this.type === "classic") {
|
||||
const pingMessage = await this.client.createMessage(this.channel.id, Object.assign({
|
||||
content: "🏓 Ping?"
|
||||
}, this.reference));
|
||||
pingMessage.edit(`🏓 Pong!\n\`\`\`\nLatency: ${pingMessage.timestamp - this.message.timestamp}ms${this.channel.guild ? `\nShard Latency: ${Math.round(this.client.shards.get(this.client.guildShardMap[this.channel.guild.id]).latency)}ms` : ""}\n\`\`\``);
|
||||
} else {
|
||||
await this.interaction.createMessage("🏓 Ping?");
|
||||
const pingMessage = await this.interaction.getOriginalMessage();
|
||||
await this.interaction.editOriginalMessage(`🏓 Pong!\n\`\`\`\nLatency: ${pingMessage.timestamp - Math.floor((this.interaction.id / 4194304) + 1420070400000)}ms${this.interaction.guildID ? `\nShard Latency: ${Math.round(this.client.shards.get(this.client.guildShardMap[this.interaction.guildID]).latency)}ms` : ""}\n\`\`\``);
|
||||
}
|
||||
}
|
||||
|
||||
static description = "Pings Discord's servers";
|
||||
|
|
|
@ -3,12 +3,12 @@ import Command from "../../classes/command.js";
|
|||
|
||||
class PrefixCommand extends Command {
|
||||
async run() {
|
||||
if (!this.message.channel.guild) return "This command only works in servers!";
|
||||
const guild = await database.getGuild(this.message.channel.guild.id);
|
||||
if (!this.channel.guild) return "This command only works in servers!";
|
||||
const guild = await database.getGuild(this.channel.guild.id);
|
||||
if (this.args.length !== 0) {
|
||||
const owners = process.env.OWNER.split(",");
|
||||
if (!this.message.member.permissions.has("administrator") && !owners.includes(this.message.member.id)) return "You need to be an administrator to change the bot prefix!";
|
||||
await database.setPrefix(this.args[0], this.message.channel.guild);
|
||||
await database.setPrefix(this.args[0], this.channel.guild);
|
||||
return `The prefix has been changed to ${this.args[0]}.`;
|
||||
} else {
|
||||
return `The current prefix is \`${guild.prefix}\`.`;
|
||||
|
@ -18,6 +18,7 @@ class PrefixCommand extends Command {
|
|||
static description = "Checks/changes the server prefix";
|
||||
static aliases = ["setprefix", "changeprefix", "checkprefix"];
|
||||
static arguments = ["{prefix}"];
|
||||
static slashAllowed = false;
|
||||
}
|
||||
|
||||
export default PrefixCommand;
|
|
@ -7,7 +7,7 @@ import imageDetect from "../../utils/imagedetect.js";
|
|||
|
||||
class QrReadCommand extends Command {
|
||||
async run() {
|
||||
const image = await imageDetect(this.client, this.message);
|
||||
const image = await imageDetect(this.client, this.message, this.interaction, this.options);
|
||||
if (image === undefined) return "You need to provide an image/GIF with a QR code to read!";
|
||||
this.acknowledge();
|
||||
const data = await (await fetch(image.path)).buffer();
|
||||
|
@ -18,6 +18,15 @@ class QrReadCommand extends Command {
|
|||
}
|
||||
|
||||
static description = "Reads a QR code";
|
||||
static flags = [{
|
||||
name: "image",
|
||||
type: 11,
|
||||
description: "An image/GIF attachment"
|
||||
}, {
|
||||
name: "link",
|
||||
type: 3,
|
||||
description: "An image/GIF URL"
|
||||
}];
|
||||
}
|
||||
|
||||
export default QrReadCommand;
|
||||
|
|
|
@ -4,13 +4,22 @@ import imageDetect from "../../utils/imagedetect.js";
|
|||
class RawCommand extends Command {
|
||||
async run() {
|
||||
this.acknowledge();
|
||||
const image = await imageDetect(this.client, this.message);
|
||||
const image = await imageDetect(this.client, this.message, this.interaction, this.options);
|
||||
if (image === undefined) return "You need to provide an image/GIF to get a raw URL!";
|
||||
return image.path;
|
||||
}
|
||||
|
||||
static description = "Gets a direct image URL (useful for saving GIFs from sites like Tenor)";
|
||||
static aliases = ["gif", "getgif", "giflink", "imglink", "getimg", "rawgif", "rawimg"];
|
||||
static flags = [{
|
||||
name: "image",
|
||||
type: 11,
|
||||
description: "An image/GIF attachment"
|
||||
}, {
|
||||
name: "link",
|
||||
type: 3,
|
||||
description: "An image/GIF URL"
|
||||
}];
|
||||
}
|
||||
|
||||
export default RawCommand;
|
||||
|
|
|
@ -5,7 +5,7 @@ class ReloadCommand extends Command {
|
|||
run() {
|
||||
return new Promise((resolve) => {
|
||||
const owners = process.env.OWNER.split(",");
|
||||
if (!owners.includes(this.message.author.id)) return resolve("Only the bot owner can reload commands!");
|
||||
if (!owners.includes(this.author.id)) return resolve("Only the bot owner can reload commands!");
|
||||
if (this.args.length === 0) return resolve("You need to provide a command to reload!");
|
||||
this.ipc.broadcast("reload", this.args[0]);
|
||||
this.ipc.register("reloadSuccess", () => {
|
||||
|
|
|
@ -3,8 +3,8 @@ import Command from "../../classes/command.js";
|
|||
class RestartCommand extends Command {
|
||||
async run() {
|
||||
const owners = process.env.OWNER.split(",");
|
||||
if (!owners.includes(this.message.author.id)) return "Only the bot owner can restart me!";
|
||||
await this.client.createMessage(this.message.channel.id, Object.assign({
|
||||
if (!owners.includes(this.author.id)) return "Only the bot owner can restart me!";
|
||||
await this.client.createMessage(this.channel.id, Object.assign({
|
||||
content: "esmBot is restarting."
|
||||
}, this.reference));
|
||||
this.ipc.restartAllClusters(true);
|
||||
|
|
|
@ -2,44 +2,44 @@ import Command from "../../classes/command.js";
|
|||
|
||||
class ServerInfoCommand extends Command {
|
||||
async run() {
|
||||
if (!this.message.channel.guild) return "This command only works in servers!";
|
||||
const owner = await this.message.channel.guild.members.get(this.message.channel.guild.ownerID);
|
||||
if (!this.channel.guild) return "This command only works in servers!";
|
||||
const owner = await this.channel.guild.members.get(this.channel.guild.ownerID);
|
||||
return {
|
||||
embeds: [{
|
||||
title: this.message.channel.guild.name,
|
||||
title: this.channel.guild.name,
|
||||
thumbnail: {
|
||||
url: this.message.channel.guild.iconURL
|
||||
url: this.channel.guild.iconURL
|
||||
},
|
||||
image: {
|
||||
url: this.message.channel.guild.bannerURL
|
||||
url: this.channel.guild.bannerURL
|
||||
},
|
||||
color: 16711680,
|
||||
fields: [
|
||||
{
|
||||
name: "🔢 **ID:**",
|
||||
value: this.message.channel.guild.id
|
||||
value: this.channel.guild.id
|
||||
},
|
||||
{
|
||||
name: "👤 **Owner:**",
|
||||
value: owner ? `${owner.user.username}#${owner.user.discriminator}` : this.message.channel.guild.ownerID
|
||||
value: owner ? `${owner.user.username}#${owner.user.discriminator}` : this.channel.guild.ownerID
|
||||
},
|
||||
{
|
||||
name: "🗓 **Created on:**",
|
||||
value: `<t:${Math.floor(this.message.channel.guild.createdAt / 1000)}:F>`
|
||||
value: `<t:${Math.floor(this.channel.guild.createdAt / 1000)}:F>`
|
||||
},
|
||||
{
|
||||
name: "👥 **Users:**",
|
||||
value: this.message.channel.guild.memberCount,
|
||||
value: this.channel.guild.memberCount,
|
||||
inline: true
|
||||
},
|
||||
{
|
||||
name: "💬 **Channels:**",
|
||||
value: this.message.channel.guild.channels.size,
|
||||
value: this.channel.guild.channels.size,
|
||||
inline: true
|
||||
},
|
||||
{
|
||||
name: "😃 **Emojis:**",
|
||||
value: this.message.channel.guild.emojis.length,
|
||||
value: this.channel.guild.emojis.length,
|
||||
inline: true
|
||||
}
|
||||
]
|
||||
|
|
|
@ -10,6 +10,7 @@ class SnowflakeCommand extends Command {
|
|||
static description = "Converts a Discord snowflake id into a timestamp";
|
||||
static aliases = ["timestamp", "snowstamp", "snow"];
|
||||
static arguments = ["[id]"];
|
||||
static slashAllowed = false;
|
||||
}
|
||||
|
||||
export default SnowflakeCommand;
|
||||
|
|
|
@ -5,7 +5,7 @@ class SoundReloadCommand extends Command {
|
|||
run() {
|
||||
return new Promise((resolve) => {
|
||||
const owners = process.env.OWNER.split(",");
|
||||
if (!owners.includes(this.message.author.id)) return "Only the bot owner can reload Lavalink!";
|
||||
if (!owners.includes(this.author.id)) return "Only the bot owner can reload Lavalink!";
|
||||
this.acknowledge();
|
||||
this.ipc.broadcast("soundreload");
|
||||
this.ipc.register("soundReloadSuccess", (msg) => {
|
||||
|
|
|
@ -62,7 +62,7 @@ class StatsCommand extends Command {
|
|||
},
|
||||
{
|
||||
"name": "Shard",
|
||||
"value": this.message.channel.guild ? this.client.guildShardMap[this.message.channel.guild.id] : "N/A",
|
||||
"value": this.channel.guild ? this.client.guildShardMap[this.channel.guild.id] : "N/A",
|
||||
"inline": true
|
||||
},
|
||||
{
|
||||
|
|
|
@ -3,7 +3,7 @@ import imagedetect from "../../utils/imagedetect.js";
|
|||
|
||||
class StickerCommand extends Command {
|
||||
async run() {
|
||||
const result = await imagedetect(this.client, this.message, false, false, true);
|
||||
const result = await imagedetect(this.client, this.message, this.interaction, this.options, false, false, true);
|
||||
if (!result) return "You need to provide a sticker!";
|
||||
if (result.format_type === 1) { // PNG
|
||||
return `https://cdn.discordapp.com/stickers/${result.id}.png`;
|
||||
|
|
|
@ -2,7 +2,7 @@ import Command from "../../classes/command.js";
|
|||
|
||||
class UserInfoCommand extends Command {
|
||||
async run() {
|
||||
const getUser = this.message.mentions.length >= 1 ? this.message.mentions[0] : (this.args.length !== 0 ? await this.ipc.fetchUser(this.args[0]) : this.message.author);
|
||||
const getUser = this.message.mentions.length >= 1 ? this.message.mentions[0] : (this.args.length !== 0 ? await this.ipc.fetchUser(this.args[0]) : this.author);
|
||||
let user;
|
||||
if (getUser) {
|
||||
user = getUser;
|
||||
|
@ -10,18 +10,18 @@ class UserInfoCommand extends Command {
|
|||
try {
|
||||
user = await this.client.getRESTUser(this.args[0]);
|
||||
} catch {
|
||||
user = this.message.author;
|
||||
user = this.author;
|
||||
}
|
||||
} else if (this.args.join(" ") !== "") {
|
||||
const userRegex = new RegExp(this.args.join("|"), "i");
|
||||
const member = this.client.users.find(element => {
|
||||
return userRegex.test(element.username);
|
||||
});
|
||||
user = member ?? this.message.author;
|
||||
user = member ?? this.author;
|
||||
} else {
|
||||
user = this.message.author;
|
||||
user = this.author;
|
||||
}
|
||||
const member = this.message.channel.guild ? this.message.channel.guild.members.get(user.id) : undefined;
|
||||
const member = this.channel.guild ? this.channel.guild.members.get(user.id) : undefined;
|
||||
return {
|
||||
embeds: [{
|
||||
title: `${user.username}#${user.discriminator}`,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue