Compare commits

...

3 commits

Author SHA1 Message Date
dd572e637d
Merge branch 'typescript' into HEAD 2021-04-12 20:43:26 +02:00
2dd776c86d
Added functionality to remove docs embed. 2021-04-12 20:42:16 +02:00
WatDuhHekBro
793822f3d0 Fixed help command 2021-04-12 12:46:48 -05:00
2 changed files with 17 additions and 4 deletions

View file

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

View file

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