mrmBot-Matrix/classes/command.js

49 lines
1.2 KiB
JavaScript
Raw Normal View History

class Command {
2022-03-22 20:43:26 +00:00
constructor(client, cluster, worker, ipc, options) {
this.client = client;
this.cluster = cluster;
2021-07-05 04:15:27 +00:00
this.worker = worker;
this.ipc = ipc;
2022-03-22 20:43:26 +00:00
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!";
}
2022-03-22 20:43:26 +00:00
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 = [];
2022-03-22 20:43:26 +00:00
static slashAllowed = true;
}
export default Command;