delete method & cleanup

This commit is contained in:
Erik 2022-09-10 10:49:03 +03:00
parent bfd1c8f1a6
commit ba81db17f9
Signed by untrusted user: Navy.gif
GPG Key ID: 811EC0CD80E7E5FB
3 changed files with 12 additions and 19 deletions

View File

@ -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);
}

View File

@ -98,6 +98,10 @@ class InvokerWrapper {
return this.target.deleteReply();
}
delete() {
return this.target.delete();
}
async promptMessage(str, opts = {}) {
if (str instanceof Object) {

View File

@ -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);
}