From 51d19d5787ea79e34d01da7c0224ceb28f65af2b Mon Sep 17 00:00:00 2001 From: Keanu Date: Sun, 11 Apr 2021 10:58:06 +0200 Subject: [PATCH 1/2] Added Discord.JS Docs command. --- src/commands/utility/docs.ts | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 src/commands/utility/docs.ts diff --git a/src/commands/utility/docs.ts b/src/commands/utility/docs.ts new file mode 100644 index 0000000..8c1d74b --- /dev/null +++ b/src/commands/utility/docs.ts @@ -0,0 +1,17 @@ +import {NamedCommand, RestCommand} from "../../core"; +import {URL} from "url"; +import {getContent} from "../../lib"; + +export default new NamedCommand({ + description: "Provides you with info from the Discord.JS docs.", + 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}) { + 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}); + } + }) +}); From 0a265dcd5c2f0784f421cbddba0f60ea612caf1e Mon Sep 17 00:00:00 2001 From: Keanu Date: Sun, 11 Apr 2021 11:11:21 +0200 Subject: [PATCH 2/2] Removed unused run args and Command imports. --- src/commands/fun/8ball.ts | 2 +- src/commands/fun/cookie.ts | 4 ++-- src/commands/fun/eco.ts | 2 +- src/commands/fun/figlet.ts | 4 ++-- src/commands/fun/insult.ts | 4 ++-- src/commands/fun/love.ts | 4 ++-- src/commands/fun/neko.ts | 4 ++-- src/commands/fun/ok.ts | 4 ++-- src/commands/fun/owoify.ts | 4 ++-- src/commands/fun/party.ts | 4 ++-- src/commands/fun/poll.ts | 4 ++-- src/commands/fun/ravi.ts | 4 ++-- src/commands/fun/thonk.ts | 6 +++--- src/commands/fun/urban.ts | 4 ++-- src/commands/fun/vaporwave.ts | 4 ++-- src/commands/fun/weather.ts | 4 ++-- src/commands/fun/whois.ts | 6 +++--- src/commands/utility/calc.ts | 4 ++-- src/commands/utility/code.ts | 2 +- src/commands/utility/desc.ts | 4 ++-- src/commands/utility/emote.ts | 4 ++-- src/commands/utility/info.ts | 18 +++++++++--------- src/commands/utility/invite.ts | 4 ++-- src/commands/utility/lsemotes.ts | 6 +++--- src/commands/utility/react.ts | 4 ++-- src/commands/utility/say.ts | 4 ++-- src/commands/utility/scanemotes.ts | 6 +++--- src/commands/utility/shorten.ts | 2 +- src/commands/utility/streaminfo.ts | 6 +++--- src/commands/utility/todo.ts | 10 +++++----- src/commands/utility/translate.ts | 2 +- 31 files changed, 72 insertions(+), 72 deletions(-) diff --git a/src/commands/fun/8ball.ts b/src/commands/fun/8ball.ts index 898eafe..f79a2c0 100644 --- a/src/commands/fun/8ball.ts +++ b/src/commands/fun/8ball.ts @@ -30,7 +30,7 @@ export default new NamedCommand({ run: "Please provide a question.", any: new Command({ description: "Question to ask the 8-ball.", - async run({send, message, channel, guild, author, member, client, args}) { + async run({send, message}) { const sender = message.author; send(`${random(responses)} <@${sender.id}>`); } diff --git a/src/commands/fun/cookie.ts b/src/commands/fun/cookie.ts index 2275c08..71d9c20 100644 --- a/src/commands/fun/cookie.ts +++ b/src/commands/fun/cookie.ts @@ -31,7 +31,7 @@ export default new NamedCommand({ run: ":cookie: Here's a cookie!", subcommands: { all: new NamedCommand({ - async run({send, message, channel, guild, author, member, client, args}) { + async run({send, author}) { send(`${author} gave everybody a cookie!`); } }) @@ -39,7 +39,7 @@ export default new NamedCommand({ id: "user", user: new Command({ description: "User to give cookie to.", - async run({send, message, channel, guild, author, member, client, args}) { + async run({send, author, args}) { const sender = author; const mention: User = args[0]; diff --git a/src/commands/fun/eco.ts b/src/commands/fun/eco.ts index 241411d..4644101 100644 --- a/src/commands/fun/eco.ts +++ b/src/commands/fun/eco.ts @@ -34,7 +34,7 @@ export default new NamedCommand({ }), any: new RestCommand({ description: "See how much money someone else has by using their username.", - async run({send, guild, channel, args, message, combined}) { + async run({send, guild, channel, combined}) { if (isAuthorized(guild, channel)) { const member = await getMemberByName(guild!, combined); if (typeof member !== "string") send(getMoneyEmbed(member.user)); diff --git a/src/commands/fun/figlet.ts b/src/commands/fun/figlet.ts index a25ed2a..b2f9bb0 100644 --- a/src/commands/fun/figlet.ts +++ b/src/commands/fun/figlet.ts @@ -1,11 +1,11 @@ -import {Command, NamedCommand, RestCommand} from "../../core"; +import {NamedCommand, RestCommand} from "../../core"; import figlet from "figlet"; export default new NamedCommand({ description: "Generates a figlet of your input.", run: "You have to provide input for me to create a figlet!", any: new RestCommand({ - async run({send, message, channel, guild, author, member, client, args, combined}) { + async run({send, combined}) { return send( figlet.textSync(combined, { horizontalLayout: "full" diff --git a/src/commands/fun/insult.ts b/src/commands/fun/insult.ts index 3cd982d..251444a 100644 --- a/src/commands/fun/insult.ts +++ b/src/commands/fun/insult.ts @@ -1,8 +1,8 @@ -import {Command, NamedCommand} from "../../core"; +import {NamedCommand} from "../../core"; export default new NamedCommand({ description: "Insult TravBot! >:D", - async run({send, message, channel, guild, author, member, client, args}) { + async run({send, channel, author}) { channel.startTyping(); setTimeout(() => { send( diff --git a/src/commands/fun/love.ts b/src/commands/fun/love.ts index e7d2557..25a7c8a 100644 --- a/src/commands/fun/love.ts +++ b/src/commands/fun/love.ts @@ -1,9 +1,9 @@ -import {Command, NamedCommand, CHANNEL_TYPE} from "../../core"; +import {NamedCommand, CHANNEL_TYPE} from "../../core"; export default new NamedCommand({ description: "Chooses someone to love.", channelType: CHANNEL_TYPE.GUILD, - async run({send, message, channel, guild, author, client, args}) { + async run({send, guild}) { const member = guild!.members.cache.random(); send(`I love ${member.nickname ?? member.user.username}!`); } diff --git a/src/commands/fun/neko.ts b/src/commands/fun/neko.ts index 1722232..f430406 100644 --- a/src/commands/fun/neko.ts +++ b/src/commands/fun/neko.ts @@ -36,12 +36,12 @@ const endpoints: {sfw: {[key: string]: string}} = { export default new NamedCommand({ description: "Provides you with a random image with the selected argument.", - async run({send, message, channel, guild, author, member, client, args}) { + async run({send}) { send(`Please provide an image type. Available arguments:\n\`[${Object.keys(endpoints.sfw).join(", ")}]\`.`); }, any: new Command({ description: "Image type to send.", - async run({send, message, channel, guild, author, member, client, args}) { + async run({send, args}) { const arg = args[0]; if (!(arg in endpoints.sfw)) return send("Couldn't find that endpoint!"); let url = new URL(`https://nekos.life/api/v2${endpoints.sfw[arg]}`); diff --git a/src/commands/fun/ok.ts b/src/commands/fun/ok.ts index 66bfa6b..13296a3 100644 --- a/src/commands/fun/ok.ts +++ b/src/commands/fun/ok.ts @@ -1,4 +1,4 @@ -import {Command, NamedCommand} from "../../core"; +import {NamedCommand} from "../../core"; import {random} from "../../lib"; const responses = [ @@ -61,7 +61,7 @@ const responses = [ export default new NamedCommand({ description: "Sends random ok message.", - async run({send, message, channel, guild, author, member, client, args}) { + async run({send}) { send(`ok ${random(responses)}`); } }); diff --git a/src/commands/fun/owoify.ts b/src/commands/fun/owoify.ts index cbc4ccf..3cc2dd5 100644 --- a/src/commands/fun/owoify.ts +++ b/src/commands/fun/owoify.ts @@ -1,4 +1,4 @@ -import {Command, NamedCommand, RestCommand} from "../../core"; +import {NamedCommand, RestCommand} from "../../core"; import {getContent} from "../../lib"; import {URL} from "url"; @@ -6,7 +6,7 @@ export default new NamedCommand({ description: "OwO-ifies the input.", run: "You need to specify some text to owoify.", any: new RestCommand({ - async run({send, message, channel, guild, author, member, client, args, combined}) { + async run({send, combined}) { let url = new URL(`https://nekos.life/api/v2/owoify?text=${combined}`); const content = (await getContent(url.toString())) as any; // Apparently, the object in question is {owo: string}. send(content.owo); diff --git a/src/commands/fun/party.ts b/src/commands/fun/party.ts index db4c0e3..ce58b13 100644 --- a/src/commands/fun/party.ts +++ b/src/commands/fun/party.ts @@ -1,8 +1,8 @@ -import {Command, NamedCommand} from "../../core"; +import {NamedCommand} from "../../core"; export default new NamedCommand({ description: "Initiates a celebratory stream from the bot.", - async run({send, message, channel, guild, author, member, client, args}) { + async run({send, client}) { send("This calls for a celebration!"); client.user!.setActivity({ type: "STREAMING", diff --git a/src/commands/fun/poll.ts b/src/commands/fun/poll.ts index 5795db1..3909968 100644 --- a/src/commands/fun/poll.ts +++ b/src/commands/fun/poll.ts @@ -1,5 +1,5 @@ import {MessageEmbed} from "discord.js"; -import {Command, NamedCommand, RestCommand} from "../../core"; +import {NamedCommand, RestCommand} from "../../core"; export default new NamedCommand({ description: "Create a poll.", @@ -7,7 +7,7 @@ export default new NamedCommand({ run: "Please provide a question.", any: new RestCommand({ description: "Question for the poll.", - async run({send, message, channel, guild, author, member, client, args, combined}) { + async run({send, message, combined}) { const embed = new MessageEmbed() .setAuthor( `Poll created by ${message.author.username}`, diff --git a/src/commands/fun/ravi.ts b/src/commands/fun/ravi.ts index e0862e0..ff64376 100644 --- a/src/commands/fun/ravi.ts +++ b/src/commands/fun/ravi.ts @@ -4,7 +4,7 @@ import {Random} from "../../lib"; export default new NamedCommand({ description: "Ravioli ravioli...", usage: "[number from 1 to 9]", - async run({send, message, channel, guild, author, member, client, args}) { + async run({send}) { send({ embed: { title: "Ravioli ravioli...", @@ -18,7 +18,7 @@ export default new NamedCommand({ }); }, number: new Command({ - async run({send, message, channel, guild, author, member, client, args}) { + async run({send, args}) { const arg: number = args[0]; if (arg >= 1 && arg <= 9) { diff --git a/src/commands/fun/thonk.ts b/src/commands/fun/thonk.ts index de09d20..821216f 100644 --- a/src/commands/fun/thonk.ts +++ b/src/commands/fun/thonk.ts @@ -1,4 +1,4 @@ -import {Command, NamedCommand, RestCommand} from "../../core"; +import {NamedCommand, RestCommand} from "../../core"; const letters: {[letter: string]: string[]} = { a: "aáàảãạâấầẩẫậăắằẳẵặ".split(""), @@ -34,7 +34,7 @@ let phrase = "I have no currently set phrase!"; export default new NamedCommand({ description: "Transforms your text into vietnamese.", usage: "thonk ([text])", - async run({send, message, channel, guild, author, member, client, args}) { + async run({send, author}) { const msg = await send(transform(phrase)); msg.createReactionCollector( (reaction, user) => { @@ -45,7 +45,7 @@ export default new NamedCommand({ ); }, any: new RestCommand({ - async run({send, message, channel, guild, author, member, client, args, combined}) { + async run({send, author, combined}) { const msg = await send(transform(combined)); msg.createReactionCollector( (reaction, user) => { diff --git a/src/commands/fun/urban.ts b/src/commands/fun/urban.ts index 928ca57..9964008 100644 --- a/src/commands/fun/urban.ts +++ b/src/commands/fun/urban.ts @@ -1,4 +1,4 @@ -import {Command, NamedCommand, RestCommand} from "../../core"; +import {NamedCommand, RestCommand} from "../../core"; import {MessageEmbed} from "discord.js"; import urban from "relevant-urban"; @@ -6,7 +6,7 @@ export default new NamedCommand({ description: "Gives you a definition of the inputted word.", run: "Please input a word.", any: new RestCommand({ - async run({send, message, channel, guild, author, member, client, args, combined}) { + async run({send, combined}) { // [Bug Fix]: Use encodeURIComponent() when emojis are used: "TypeError [ERR_UNESCAPED_CHARACTERS]: Request path contains unescaped characters" urban(encodeURIComponent(combined)) .then((res) => { diff --git a/src/commands/fun/vaporwave.ts b/src/commands/fun/vaporwave.ts index 71ae065..6486c25 100644 --- a/src/commands/fun/vaporwave.ts +++ b/src/commands/fun/vaporwave.ts @@ -1,4 +1,4 @@ -import {Command, NamedCommand, RestCommand} from "../../core"; +import {NamedCommand, RestCommand} from "../../core"; const vaporwave = (() => { const map = new Map(); @@ -25,7 +25,7 @@ export default new NamedCommand({ description: "Transforms your text into vaporwave.", run: "You need to enter some text!", any: new RestCommand({ - async run({send, message, channel, guild, author, member, client, args, combined}) { + async run({send, combined}) { const text = getVaporwaveText(combined); if (text !== "") send(text); else send("Make sure to enter at least one valid character."); diff --git a/src/commands/fun/weather.ts b/src/commands/fun/weather.ts index 44c82b7..b30daa1 100644 --- a/src/commands/fun/weather.ts +++ b/src/commands/fun/weather.ts @@ -1,4 +1,4 @@ -import {Command, NamedCommand, RestCommand} from "../../core"; +import {NamedCommand, RestCommand} from "../../core"; import {MessageEmbed} from "discord.js"; import {find} from "weather-js"; @@ -6,7 +6,7 @@ export default new NamedCommand({ description: "Shows weather info of specified location.", run: "You need to provide a city.", any: new RestCommand({ - async run({send, message, channel, guild, author, member, client, args, combined}) { + async run({send, combined}) { find( { search: combined, diff --git a/src/commands/fun/whois.ts b/src/commands/fun/whois.ts index 507c14f..92d29d3 100644 --- a/src/commands/fun/whois.ts +++ b/src/commands/fun/whois.ts @@ -43,7 +43,7 @@ const registry: {[id: string]: string} = { export default new NamedCommand({ description: "Tells you who you or the specified user is.", aliases: ["whoami"], - async run({send, message, channel, guild, author, member, client, args}) { + async run({send, author}) { const id = author.id; if (id in registry) { @@ -54,7 +54,7 @@ export default new NamedCommand({ }, id: "user", user: new Command({ - async run({send, message, channel, guild, author, member, client, args}) { + async run({send, args}) { const user: User = args[0]; const id = user.id; @@ -67,7 +67,7 @@ export default new NamedCommand({ }), any: new RestCommand({ channelType: CHANNEL_TYPE.GUILD, - async run({send, message, channel, guild, author, client, args, combined}) { + async run({send, guild, combined}) { const member = await getMemberByName(guild!, combined); if (typeof member !== "string") { diff --git a/src/commands/utility/calc.ts b/src/commands/utility/calc.ts index ac0727d..649ba1f 100644 --- a/src/commands/utility/calc.ts +++ b/src/commands/utility/calc.ts @@ -1,4 +1,4 @@ -import {Command, NamedCommand, RestCommand} from "../../core"; +import {NamedCommand, RestCommand} from "../../core"; import * as math from "mathjs"; import {MessageEmbed} from "discord.js"; @@ -6,7 +6,7 @@ export default new NamedCommand({ description: "Calculates a specified math expression.", run: "Please provide a calculation.", any: new RestCommand({ - async run({send, message, channel, guild, author, member, client, args, combined}) { + async run({send, combined}) { let resp; try { resp = math.evaluate(combined); diff --git a/src/commands/utility/code.ts b/src/commands/utility/code.ts index 39e41b7..5c73897 100644 --- a/src/commands/utility/code.ts +++ b/src/commands/utility/code.ts @@ -1,4 +1,4 @@ -import {Command, NamedCommand} from "../../core"; +import {NamedCommand} from "../../core"; export default new NamedCommand({ description: "Gives you the Github link.", diff --git a/src/commands/utility/desc.ts b/src/commands/utility/desc.ts index 9930df3..4307469 100644 --- a/src/commands/utility/desc.ts +++ b/src/commands/utility/desc.ts @@ -1,11 +1,11 @@ -import {Command, NamedCommand, RestCommand} from "../../core"; +import {NamedCommand, RestCommand} from "../../core"; export default new NamedCommand({ description: "Renames current voice channel.", usage: "", run: "Please provide a new voice channel name.", any: new RestCommand({ - async run({send, message, channel, guild, author, member, client, args, combined}) { + async run({send, message, combined}) { const voiceChannel = message.member?.voice.channel; if (!voiceChannel) return send("You are not in a voice channel."); diff --git a/src/commands/utility/emote.ts b/src/commands/utility/emote.ts index 4d79446..0cb48a2 100644 --- a/src/commands/utility/emote.ts +++ b/src/commands/utility/emote.ts @@ -1,4 +1,4 @@ -import {Command, NamedCommand, RestCommand} from "../../core"; +import {NamedCommand, RestCommand} from "../../core"; import {processEmoteQueryFormatted} from "./modules/emote-utils"; export default new NamedCommand({ @@ -8,7 +8,7 @@ export default new NamedCommand({ any: new RestCommand({ description: "The emote(s) to send.", usage: "", - async run({send, guild, channel, message, args}) { + async run({send, args}) { const output = processEmoteQueryFormatted(args); if (output.length > 0) send(output); } diff --git a/src/commands/utility/info.ts b/src/commands/utility/info.ts index c9368e6..b490bcd 100644 --- a/src/commands/utility/info.ts +++ b/src/commands/utility/info.ts @@ -8,20 +8,20 @@ import moment, {utc} from "moment"; export default new NamedCommand({ description: "Command to provide all sorts of info about the current server, a user, etc.", - async run({send, message, channel, guild, author, member, client, args}) { + async run({send, author, member}) { send(await getUserInfo(author, member)); }, subcommands: { avatar: new NamedCommand({ description: "Shows your own, or another user's avatar.", usage: "()", - async run({send, message, channel, guild, author, member, client, args}) { + async run({send, author}) { send(author.displayAvatarURL({dynamic: true, size: 2048})); }, id: "user", user: new Command({ description: "Shows your own, or another user's avatar.", - async run({send, message, channel, guild, author, member, client, args}) { + async run({send, args}) { send( args[0].displayAvatarURL({ dynamic: true, @@ -33,7 +33,7 @@ export default new NamedCommand({ any: new RestCommand({ description: "Shows another user's avatar by searching their name", channelType: CHANNEL_TYPE.GUILD, - async run({send, message, channel, guild, author, client, args, combined}) { + async run({send, guild, combined}) { const member = await getMemberByName(guild!, combined); if (typeof member !== "string") { @@ -51,7 +51,7 @@ export default new NamedCommand({ }), bot: new NamedCommand({ description: "Displays info about the bot.", - async run({send, message, channel, guild, author, member, client, args}) { + async run({send, guild, client}) { const core = os.cpus()[0]; const embed = new MessageEmbed() .setColor(guild?.me?.displayHexColor || "BLUE") @@ -94,20 +94,20 @@ export default new NamedCommand({ description: "Displays info about the current guild or another guild.", usage: "(/)", channelType: CHANNEL_TYPE.GUILD, - async run({send, message, channel, guild, author, member, client, args}) { + async run({send, guild}) { send(await getGuildInfo(guild!, guild)); }, id: "guild", guild: new Command({ description: "Display info about a guild by its ID.", - async run({send, message, channel, guild, author, member, client, args}) { + async run({send, guild, args}) { const targetGuild = args[0] as Guild; send(await getGuildInfo(targetGuild, guild)); } }), any: new RestCommand({ description: "Display info about a guild by finding its name.", - async run({send, message, channel, guild, author, member, client, args, combined}) { + async run({send, guild, combined}) { const targetGuild = getGuildByName(combined); if (typeof targetGuild !== "string") { @@ -122,7 +122,7 @@ export default new NamedCommand({ id: "user", user: new Command({ description: "Displays info about mentioned user.", - async run({send, message, channel, guild, author, client, args}) { + async run({send, guild, args}) { const user = args[0] as User; // Transforms the User object into a GuildMember object of the current guild. const member = guild?.members.resolve(args[0]); diff --git a/src/commands/utility/invite.ts b/src/commands/utility/invite.ts index 9dc0fa3..58b38d8 100644 --- a/src/commands/utility/invite.ts +++ b/src/commands/utility/invite.ts @@ -1,8 +1,8 @@ -import {Command, NamedCommand} from "../../core"; +import {NamedCommand} from "../../core"; export default new NamedCommand({ description: "Gives you the invite link.", - async run({send, message, channel, guild, author, member, client, args}) { + async run({send, client, args}) { send( `https://discordapp.com/api/oauth2/authorize?client_id=${client.user!.id}&permissions=${ args[0] || 8 diff --git a/src/commands/utility/lsemotes.ts b/src/commands/utility/lsemotes.ts index 7e1e2d9..955328a 100644 --- a/src/commands/utility/lsemotes.ts +++ b/src/commands/utility/lsemotes.ts @@ -1,5 +1,5 @@ import {GuildEmoji, MessageEmbed, User} from "discord.js"; -import {Command, NamedCommand, RestCommand, paginate, SendFunction} from "../../core"; +import {NamedCommand, RestCommand, paginate, SendFunction} from "../../core"; import {split} from "../../lib"; import vm from "vm"; @@ -8,13 +8,13 @@ const REGEX_TIMEOUT_MS = 1000; export default new NamedCommand({ description: "Lists all emotes the bot has in it's registry,", usage: " (-flags)", - async run({send, message, channel, guild, author, member, client, args}) { + async run({send, author, client}) { displayEmoteList(client.emojis.cache.array(), send, author); }, any: new RestCommand({ description: "Filters emotes by via a regular expression. Flags can be added by adding a dash at the end. For example, to do a case-insensitive search, do %prefix%lsemotes somepattern -i", - async run({send, message, channel, guild, author, member, client, args}) { + async run({send, author, client, args}) { // If a guild ID is provided, filter all emotes by that guild (but only if there aren't any arguments afterward) if (args.length === 1 && /^\d{17,}$/.test(args[0])) { const guildID: string = args[0]; diff --git a/src/commands/utility/react.ts b/src/commands/utility/react.ts index ef1aebb..39301c9 100644 --- a/src/commands/utility/react.ts +++ b/src/commands/utility/react.ts @@ -1,4 +1,4 @@ -import {Command, NamedCommand, RestCommand} from "../../core"; +import {NamedCommand, RestCommand} from "../../core"; import {Message, Channel, TextChannel} from "discord.js"; import {processEmoteQueryArray} from "./modules/emote-utils"; @@ -8,7 +8,7 @@ export default new NamedCommand({ usage: 'react ()', run: "You need to enter some emotes first.", any: new RestCommand({ - async run({send, message, channel, guild, author, member, client, args}) { + async run({send, message, channel, guild, client, args}) { let target: Message | undefined; let distance = 1; diff --git a/src/commands/utility/say.ts b/src/commands/utility/say.ts index 0ffe639..5d8805a 100644 --- a/src/commands/utility/say.ts +++ b/src/commands/utility/say.ts @@ -1,4 +1,4 @@ -import {Command, NamedCommand, RestCommand} from "../../core"; +import {NamedCommand, RestCommand} from "../../core"; export default new NamedCommand({ description: "Repeats your message.", @@ -6,7 +6,7 @@ export default new NamedCommand({ run: "Please provide a message for me to say!", any: new RestCommand({ description: "Message to repeat.", - async run({send, message, channel, guild, author, member, client, args, combined}) { + async run({send, author, combined}) { send(`*${author} says:*\n${combined}`); } }) diff --git a/src/commands/utility/scanemotes.ts b/src/commands/utility/scanemotes.ts index 08fb74f..e9fbcd0 100644 --- a/src/commands/utility/scanemotes.ts +++ b/src/commands/utility/scanemotes.ts @@ -1,4 +1,4 @@ -import {Command, NamedCommand, CHANNEL_TYPE} from "../../core"; +import {NamedCommand, CHANNEL_TYPE} from "../../core"; import {pluralise} from "../../lib"; import moment from "moment"; import {Collection, TextChannel} from "discord.js"; @@ -9,7 +9,7 @@ export default new NamedCommand({ description: "Scans all text channels in the current guild and returns the number of times each emoji specific to the guild has been used. Has a cooldown of 24 hours per guild.", channelType: CHANNEL_TYPE.GUILD, - async run({send, message, channel, guild, author, member, client, args}) { + async run({send, message, channel, guild}) { // Test if the command is on cooldown. This isn't the strictest cooldown possible, because in the event that the bot crashes, the cooldown will be reset. But for all intends and purposes, it's a good enough cooldown. It's a per-server cooldown. const startTime = Date.now(); const cooldown = 86400000; // 24 hours @@ -185,7 +185,7 @@ export default new NamedCommand({ forcereset: new NamedCommand({ description: "Forces the cooldown timer to reset.", permission: PERMISSIONS.BOT_SUPPORT, - async run({send, message, channel, guild, author, member, client, args}) { + async run({send, guild}) { lastUsedTimestamps.set(guild!.id, 0); send("Reset the cooldown on `scanemotes`."); } diff --git a/src/commands/utility/shorten.ts b/src/commands/utility/shorten.ts index 9d74544..c8a4618 100644 --- a/src/commands/utility/shorten.ts +++ b/src/commands/utility/shorten.ts @@ -5,7 +5,7 @@ export default new NamedCommand({ description: "Shortens a given URL.", run: "Please provide a URL.", any: new Command({ - async run({send, message, channel, guild, author, member, client, args}) { + async run({send, args}) { https.get("https://is.gd/create.php?format=simple&url=" + encodeURIComponent(args[0]), function (res) { var body = ""; res.on("data", function (chunk) { diff --git a/src/commands/utility/streaminfo.ts b/src/commands/utility/streaminfo.ts index c122b8b..b58b1f8 100644 --- a/src/commands/utility/streaminfo.ts +++ b/src/commands/utility/streaminfo.ts @@ -1,9 +1,9 @@ -import {Command, NamedCommand, RestCommand} from "../../core"; +import {NamedCommand, RestCommand} from "../../core"; import {streamList} from "../../modules/streamNotifications"; export default new NamedCommand({ description: "Sets the description of your stream. You can embed links by writing `[some name](some link)`", - async run({send, message, channel, guild, author, member, client, args}) { + async run({send, author, member}) { const userID = author.id; if (streamList.has(userID)) { @@ -22,7 +22,7 @@ export default new NamedCommand({ } }, any: new RestCommand({ - async run({send, message, channel, guild, author, member, client, args, combined}) { + async run({send, author, member, combined}) { const userID = author.id; if (streamList.has(userID)) { diff --git a/src/commands/utility/todo.ts b/src/commands/utility/todo.ts index 9057166..3962126 100644 --- a/src/commands/utility/todo.ts +++ b/src/commands/utility/todo.ts @@ -1,11 +1,11 @@ -import {Command, NamedCommand, RestCommand} from "../../core"; +import {NamedCommand, RestCommand} from "../../core"; import moment from "moment"; import {Storage} from "../../structures"; import {MessageEmbed} from "discord.js"; export default new NamedCommand({ description: "Keep and edit your personal todo list.", - async run({send, message, channel, guild, author, member, client, args}) { + async run({send, author}) { const user = Storage.getUser(author.id); const embed = new MessageEmbed().setTitle(`Todo list for ${author.tag}`).setColor("BLUE"); @@ -23,7 +23,7 @@ export default new NamedCommand({ add: new NamedCommand({ run: "You need to specify a note to add.", any: new RestCommand({ - async run({send, message, channel, guild, author, member, client, args, combined}) { + async run({send, author, combined}) { const user = Storage.getUser(author.id); user.todoList[Date.now().toString()] = combined; console.debug(user.todoList); @@ -35,7 +35,7 @@ export default new NamedCommand({ remove: new NamedCommand({ run: "You need to specify a note to remove.", any: new RestCommand({ - async run({send, message, channel, guild, author, member, client, args, combined}) { + async run({send, author, combined}) { const user = Storage.getUser(author.id); let isFound = false; @@ -55,7 +55,7 @@ export default new NamedCommand({ }) }), clear: new NamedCommand({ - async run({send, message, channel, guild, author, member, client, args}) { + async run({send, author}) { const user = Storage.getUser(author.id); user.todoList = {}; Storage.save(); diff --git a/src/commands/utility/translate.ts b/src/commands/utility/translate.ts index d4a1aab..e3ca9ed 100644 --- a/src/commands/utility/translate.ts +++ b/src/commands/utility/translate.ts @@ -8,7 +8,7 @@ export default new NamedCommand({ any: new Command({ run: "You need to enter some text to translate.", any: new RestCommand({ - async run({send, message, channel, guild, author, member, client, args}) { + async run({send, args}) { const lang = args[0]; const input = args.slice(1).join(" "); translate(input, {