mirror of
https://github.com/keanuplayz/TravBot-v3.git
synced 2024-08-15 02:33:12 +00:00
Compare commits
No commits in common. "dd572e637dba63535ee7693a58aecba91432d728" and "9bf44c160a52639094b8fd2fb3bcc387f527bd10" have entirely different histories.
dd572e637d
...
9bf44c160a
2 changed files with 4 additions and 17 deletions
|
@ -1,5 +1,5 @@
|
|||
import {
|
||||
RestCommand,
|
||||
Command,
|
||||
NamedCommand,
|
||||
CHANNEL_TYPE,
|
||||
getPermissionName,
|
||||
|
@ -51,7 +51,7 @@ export default new NamedCommand({
|
|||
.setColor(EMBED_COLOR);
|
||||
});
|
||||
},
|
||||
any: new RestCommand({
|
||||
any: new Command({
|
||||
async run({send, args}) {
|
||||
const resultingBlob = await getCommandInfo(args);
|
||||
if (typeof resultingBlob === "string") return send(resultingBlob);
|
||||
|
|
|
@ -7,24 +7,11 @@ 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, author, args}) {
|
||||
async run({send, 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());
|
||||
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);
|
||||
});
|
||||
return send({embed: content});
|
||||
}
|
||||
})
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue