wrapper stuff

This commit is contained in:
Erik 2022-04-25 14:07:48 +03:00
parent dfa21a5aad
commit 15c432d739
Signed by: Navy.gif
GPG Key ID: 811EC0CD80E7E5FB
3 changed files with 23 additions and 1 deletions

View File

@ -42,7 +42,7 @@ class GuildWrapper {
try { try {
await this.client.storageManager.mongodb.guilds.updateOne({ await this.client.storageManager.mongodb.guilds.updateOne({
guildId: this.id guildId: this.id
}, settings); }, { _version: '3.slash', ...settings });
this._settings = { this._settings = {
...this._settings, ...this._settings,
...settings ...settings

View File

@ -51,6 +51,10 @@ class InvokerWrapper {
return this.target.subcommand; return this.target.subcommand;
} }
get subcommandGroup() {
return this.target.subcommandGroup;
}
inGuild() { inGuild() {
return Boolean(this.target.guildId); return Boolean(this.target.guildId);
} }

View File

@ -8,6 +8,8 @@ class MessageWrapper {
this.message = message; this.message = message;
this._reply = null; this._reply = null;
this._subcommand = null;
this._subcommandGroup = null;
} }
@ -48,6 +50,22 @@ class MessageWrapper {
return this.guild ? this.guild.prefix : this.client.getUserWrapper(this.author.id, false).prefix; return this.guild ? this.guild.prefix : this.client.getUserWrapper(this.author.id, false).prefix;
} }
get subcommand() {
return this._subcommand || null;
}
set subcommand(cmd) {
this._subcommand = cmd;
}
get subcommandGroup() {
return this._subcommandGroup || null;
}
set subcommandGroup(grp) {
this._subcommandGroup = grp;
}
deferReply() { deferReply() {
return undefined; return undefined;
} }