From 15c432d739257e78accdbcd7ca2722c27290b17f Mon Sep 17 00:00:00 2001 From: "Navy.gif" Date: Mon, 25 Apr 2022 14:07:48 +0300 Subject: [PATCH] wrapper stuff --- src/structure/client/wrappers/GuildWrapper.js | 2 +- .../client/wrappers/InvokerWrapper.js | 4 ++++ .../client/wrappers/MessageWrapper.js | 18 ++++++++++++++++++ 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/src/structure/client/wrappers/GuildWrapper.js b/src/structure/client/wrappers/GuildWrapper.js index d5e82bb..10a8913 100644 --- a/src/structure/client/wrappers/GuildWrapper.js +++ b/src/structure/client/wrappers/GuildWrapper.js @@ -42,7 +42,7 @@ class GuildWrapper { try { await this.client.storageManager.mongodb.guilds.updateOne({ guildId: this.id - }, settings); + }, { _version: '3.slash', ...settings }); this._settings = { ...this._settings, ...settings diff --git a/src/structure/client/wrappers/InvokerWrapper.js b/src/structure/client/wrappers/InvokerWrapper.js index 92f9695..89d1713 100644 --- a/src/structure/client/wrappers/InvokerWrapper.js +++ b/src/structure/client/wrappers/InvokerWrapper.js @@ -51,6 +51,10 @@ class InvokerWrapper { return this.target.subcommand; } + get subcommandGroup() { + return this.target.subcommandGroup; + } + inGuild() { return Boolean(this.target.guildId); } diff --git a/src/structure/client/wrappers/MessageWrapper.js b/src/structure/client/wrappers/MessageWrapper.js index 91527ea..4d2ecf2 100644 --- a/src/structure/client/wrappers/MessageWrapper.js +++ b/src/structure/client/wrappers/MessageWrapper.js @@ -8,6 +8,8 @@ class MessageWrapper { this.message = message; 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; } + 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() { return undefined; }