From ba81db17f982c6765421118f875432fdf361a593 Mon Sep 17 00:00:00 2001 From: "Navy.gif" Date: Sat, 10 Sep 2022 10:49:03 +0300 Subject: [PATCH] delete method & cleanup --- .../client/wrappers/InteractionWrapper.js | 23 ++++--------------- .../client/wrappers/InvokerWrapper.js | 4 ++++ .../client/wrappers/MessageWrapper.js | 4 ++++ 3 files changed, 12 insertions(+), 19 deletions(-) diff --git a/src/structure/client/wrappers/InteractionWrapper.js b/src/structure/client/wrappers/InteractionWrapper.js index a8cad78..6cf8559 100644 --- a/src/structure/client/wrappers/InteractionWrapper.js +++ b/src/structure/client/wrappers/InteractionWrapper.js @@ -69,25 +69,6 @@ class InteractionWrapper { return this.interaction.editReply(options); } - // async promptInteraction(opts = {}, time = 30) { - // if (!opts.components) throw new Error('Missing components. Use promptMessage'); - // let message = null; - // if (this.replied || this.deferred) message = await this.editReply(opts); - // else message = await this.reply(opts); - - // return new Promise((resolve) => { - // message.createMessageComponentCollector({ - // time: time*1000, - // componentType: opts.componentType || 'BUTTON', - // max: 1, - // filter: (i) => i.user.id === this.user.id - // }).on('collect', resolve) - // .on('end', (collected) => { - // if (!collected.size) resolve(null); - // }); - // }); - // } - replyEmbed(embed) { if (!embed.color) embed.color = EmbedDefaultColor; return this.reply({ embeds: [embed] }); @@ -110,6 +91,10 @@ class InteractionWrapper { return this.interaction.deleteReply(); } + delete() { + return this.interaction.delete(); + } + update(...args) { return this.interaction.update(...args); } diff --git a/src/structure/client/wrappers/InvokerWrapper.js b/src/structure/client/wrappers/InvokerWrapper.js index 90d3935..f6ded45 100644 --- a/src/structure/client/wrappers/InvokerWrapper.js +++ b/src/structure/client/wrappers/InvokerWrapper.js @@ -98,6 +98,10 @@ class InvokerWrapper { return this.target.deleteReply(); } + delete() { + return this.target.delete(); + } + async promptMessage(str, opts = {}) { if (str instanceof Object) { diff --git a/src/structure/client/wrappers/MessageWrapper.js b/src/structure/client/wrappers/MessageWrapper.js index 9a9a4ea..18b2c2c 100644 --- a/src/structure/client/wrappers/MessageWrapper.js +++ b/src/structure/client/wrappers/MessageWrapper.js @@ -99,6 +99,10 @@ class MessageWrapper { // throw new Error('Message not replied to'); } + delete() { + return this.message.delete(); + } + awaitReactions(...opts) { return this.message.awaitReactions(...opts); }