Slash command preparations
This commit is contained in:
parent
a438fe26df
commit
f996180fa9
20 changed files with 136 additions and 34 deletions
|
@ -1,35 +1,49 @@
|
|||
class Command {
|
||||
constructor(client, cluster, worker, ipc, message, args, content, specialArgs) {
|
||||
constructor(client, cluster, worker, ipc, options) {
|
||||
this.client = client;
|
||||
this.cluster = cluster;
|
||||
this.worker = worker;
|
||||
this.ipc = ipc;
|
||||
this.message = message;
|
||||
this.args = args;
|
||||
this.content = content;
|
||||
this.specialArgs = specialArgs;
|
||||
this.reference = {
|
||||
messageReference: {
|
||||
channelID: this.message.channel.id,
|
||||
messageID: this.message.id,
|
||||
guildID: this.message.channel.guild ? this.message.channel.guild.id : undefined,
|
||||
failIfNotExists: false
|
||||
},
|
||||
allowedMentions: {
|
||||
repliedUser: false
|
||||
}
|
||||
};
|
||||
this.type = options.type;
|
||||
this.args = options.args;
|
||||
if (options.type === "classic") {
|
||||
this.message = options.message;
|
||||
this.content = options.content;
|
||||
this.specialArgs = options.specialArgs;
|
||||
this.reference = {
|
||||
messageReference: {
|
||||
channelID: this.message.channel.id,
|
||||
messageID: this.message.id,
|
||||
guildID: this.message.channel.guild ? this.message.channel.guild.id : undefined,
|
||||
failIfNotExists: false
|
||||
},
|
||||
allowedMentions: {
|
||||
repliedUser: false
|
||||
}
|
||||
};
|
||||
} else {
|
||||
this.interaction = options.interaction;
|
||||
}
|
||||
}
|
||||
|
||||
async run() {
|
||||
return "It works!";
|
||||
}
|
||||
|
||||
async acknowledge() {
|
||||
if (this.type === "classic") {
|
||||
await this.message.channel.sendTyping();
|
||||
} else {
|
||||
await this.interaction.acknowledge();
|
||||
}
|
||||
}
|
||||
|
||||
static description = "No description found";
|
||||
static aliases = [];
|
||||
static arguments = [];
|
||||
static flags = [];
|
||||
static requires = [];
|
||||
static slashAllowed = true;
|
||||
}
|
||||
|
||||
export default Command;
|
|
@ -96,7 +96,7 @@ class ImageCommand extends Command {
|
|||
if (magickParams.params.type === "image/gif") {
|
||||
status = await this.processMessage(this.message);
|
||||
} else {
|
||||
this.client.sendChannelTyping(this.message.channel.id);
|
||||
this.acknowledge();
|
||||
}
|
||||
|
||||
try {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue