who needs application commands when you have SWAG
This commit is contained in:
parent
e66945fccd
commit
de714b78ff
1 changed files with 17 additions and 34 deletions
|
@ -5,10 +5,9 @@ class Command {
|
|||
this.origOptions = options;
|
||||
this.type = options.type;
|
||||
this.args = options.args;
|
||||
if (options.type === "classic") {
|
||||
this.message = options.message;
|
||||
this.channel = options.message.room_id;
|
||||
this.guild = options.message.guild;
|
||||
this.guild = options.message.room_id;
|
||||
this.author = options.message.sender;
|
||||
this.member = options.message.member;
|
||||
this.content = options.content;
|
||||
|
@ -24,22 +23,6 @@ class Command {
|
|||
repliedUser: false
|
||||
}
|
||||
};
|
||||
} else if (options.type === "application") {
|
||||
this.interaction = options.interaction;
|
||||
this.args = [];
|
||||
this.channel = options.interaction.channel;
|
||||
this.guild = options.interaction.guild;
|
||||
this.author = this.member = options.interaction.guildID ? options.interaction.member : options.interaction.user;
|
||||
if (options.interaction.data.options) {
|
||||
this.options = options.interaction.data.options.raw.reduce((obj, item) => {
|
||||
obj[item.name] = item.value;
|
||||
return obj;
|
||||
}, {});
|
||||
this.optionsArray = options.interaction.data.options.raw;
|
||||
} else {
|
||||
this.options = {};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
async run() {
|
||||
|
|
Loading…
Reference in a new issue