From 793822f3d060c781e29e79dd850737ff11d0c1e2 Mon Sep 17 00:00:00 2001 From: WatDuhHekBro <44940783+WatDuhHekBro@users.noreply.github.com> Date: Mon, 12 Apr 2021 12:46:48 -0500 Subject: [PATCH 1/2] Fixed help command --- src/commands/system/help.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/commands/system/help.ts b/src/commands/system/help.ts index 588aa92..a9c4df8 100644 --- a/src/commands/system/help.ts +++ b/src/commands/system/help.ts @@ -1,5 +1,5 @@ import { - Command, + RestCommand, NamedCommand, CHANNEL_TYPE, getPermissionName, @@ -51,7 +51,7 @@ export default new NamedCommand({ .setColor(EMBED_COLOR); }); }, - any: new Command({ + any: new RestCommand({ async run({send, args}) { const resultingBlob = await getCommandInfo(args); if (typeof resultingBlob === "string") return send(resultingBlob); From 2dd776c86d3240d74dbafdf0044054b2a088d92b Mon Sep 17 00:00:00 2001 From: Keanu Date: Mon, 12 Apr 2021 20:42:16 +0200 Subject: [PATCH 2/2] Added functionality to remove docs embed. --- src/commands/utility/docs.ts | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/commands/utility/docs.ts b/src/commands/utility/docs.ts index 8c1d74b..0363355 100644 --- a/src/commands/utility/docs.ts +++ b/src/commands/utility/docs.ts @@ -7,11 +7,24 @@ export default new NamedCommand({ run: "You need to specify a term to query the docs with.", any: new RestCommand({ description: "What to query the docs with.", - async run({send, args}) { + async run({send, author, args}) { var queryString = args[0]; let url = new URL(`https://djsdocs.sorta.moe/v2/embed?src=master&q=${queryString}`); const content = await getContent(url.toString()); - return send({embed: content}); + const msg = await send({embed: content}); + const react = await msg.react("❌"); + + const collector = msg.createReactionCollector( + (reaction, user) => { + if (user.id === author.id && reaction.emoji.name === "❌") msg.delete(); + return false; + }, + {time: 60000} + ); + + collector.on("end", () => { + react.users.remove(msg.author); + }); } }) });