diff options
| author | 8cy <[email protected]> | 2020-06-27 22:52:54 -0700 |
|---|---|---|
| committer | 8cy <[email protected]> | 2020-06-27 22:52:54 -0700 |
| commit | 80951013e391aab140800e4f386867e6c391553f (patch) | |
| tree | 3d7101237ef1cd8d6fe2a2fab751a2dc55ae7d84 /src/commands | |
| parent | more config shit (diff) | |
| download | dep-core-80951013e391aab140800e4f386867e6c391553f.tar.xz dep-core-80951013e391aab140800e4f386867e6c391553f.zip | |
add ts defs so not a lot of errors left
- made .todo file for epic error tracking
Diffstat (limited to 'src/commands')
73 files changed, 487 insertions, 349 deletions
diff --git a/src/commands/animals/bunny.ts b/src/commands/animals/bunny.ts index fb3b2b8..0da4942 100644 --- a/src/commands/animals/bunny.ts +++ b/src/commands/animals/bunny.ts @@ -1,10 +1,11 @@ -import { Command, CommandoMessage } from 'discord.js-commando'; +import { Command, CommandoMessage, CommandoClient } from 'discord.js-commando'; +//@ts-ignore no types import emoji from 'emoji-random' import { MessageEmbed } from 'discord.js'; import axios from 'axios'; module.exports = class BunnyAnimals extends Command { - constructor(client) { + constructor(client: CommandoClient) { super(client, { name: 'bunny', aliases: [ @@ -29,10 +30,10 @@ module.exports = class BunnyAnimals extends Command { .setAuthor('bunnies.io') .setColor(0xFFCC4D) .setImage(await (await axios.get('https://api.bunnies.io/v2/loop/random/?media=gif,png')).data.media.gif) - msg.say(emb) + return msg.say(emb) } catch (err) { console.log(err) - msg.reply('Woops, there was an error with the (https://api.bunnies.io) API. ' + emoji.random()) + return msg.reply('Woops, there was an error with the (https://api.bunnies.io) API. ' + emoji.random()) } } };
\ No newline at end of file diff --git a/src/commands/animals/cat.ts b/src/commands/animals/cat.ts index 2530830..d4781a5 100644 --- a/src/commands/animals/cat.ts +++ b/src/commands/animals/cat.ts @@ -1,10 +1,11 @@ -import { Command, CommandoMessage } from 'discord.js-commando'; +import { Command, CommandoMessage, CommandoClient } from 'discord.js-commando'; +//@ts-ignore no types import emoji from 'emoji-random' import { MessageEmbed } from 'discord.js'; import axios from 'axios'; module.exports = class CatAnimals extends Command { - constructor(client) { + constructor(client: CommandoClient) { super(client, { name: 'cat', aliases: [ @@ -29,10 +30,10 @@ module.exports = class CatAnimals extends Command { .setAuthor('random.cat', 'https://i.imgur.com/Ik0Gf0r.png', 'https://random.cat') .setColor(0xFFCC4D) .setImage(await (await axios.get('https://aws.random.cat/meow')).data.file) - msg.say(emb) + return msg.say(emb) } catch (err) { console.log(err) - msg.reply('Woops, there was an error with the (http://random.cat) API. ' + emoji.random()) + return msg.reply('Woops, there was an error with the (http://random.cat) API. ' + emoji.random()) } } };
\ No newline at end of file diff --git a/src/commands/animals/cow.ts b/src/commands/animals/cow.ts index 80eedf0..3c84f09 100644 --- a/src/commands/animals/cow.ts +++ b/src/commands/animals/cow.ts @@ -1,8 +1,9 @@ -import { Command, CommandoMessage } from 'discord.js-commando'; +import { Command, CommandoMessage, CommandoClient } from 'discord.js-commando'; +//@ts-ignore no types import cows from 'cows'; module.exports = class CowAnimals extends Command { - constructor(client) { + constructor(client: CommandoClient) { super(client, { name: 'cow', aliases: ['cows'], @@ -21,6 +22,6 @@ module.exports = class CowAnimals extends Command { run(msg: CommandoMessage) { let cowNumber = Math.round((Math.random() * cows().length)) let cow = cows()[cowNumber] - msg.reply(`\`\`\`${cow}\`\`\``); + return msg.reply(`\`\`\`${cow}\`\`\``); } };
\ No newline at end of file diff --git a/src/commands/animals/dog.ts b/src/commands/animals/dog.ts index 118c951..0498dbf 100644 --- a/src/commands/animals/dog.ts +++ b/src/commands/animals/dog.ts @@ -1,10 +1,11 @@ -import { Command, CommandoMessage } from 'discord.js-commando'; +import { Command, CommandoMessage, CommandoClient } from 'discord.js-commando'; +//@ts-ignore no types import emoji from 'emoji-random' import { MessageEmbed } from 'discord.js'; import axios from 'axios'; module.exports = class DogAnimals extends Command { - constructor(client) { + constructor(client: CommandoClient) { super(client, { name: 'dog', aliases: [ @@ -29,10 +30,10 @@ module.exports = class DogAnimals extends Command { .setAuthor('dog.ceo', 'https://dog.ceo/img/favicon.png', 'https://dog.ceo/dog-api/') .setColor(0xFFCC4D) .setImage(await (await axios.get('https://dog.ceo/api/breeds/image/random')).data.message) - msg.say(emb) + return msg.say(emb) } catch (err) { console.log(err) - msg.reply('Woops, there was an error with the (http://dog.ceo/dog-api) API. ' + emoji.random()) + return msg.reply('Woops, there was an error with the (http://dog.ceo/dog-api) API. ' + emoji.random()) } } };
\ No newline at end of file diff --git a/src/commands/animals/duck.ts b/src/commands/animals/duck.ts index dbc4f94..a3683e0 100644 --- a/src/commands/animals/duck.ts +++ b/src/commands/animals/duck.ts @@ -1,10 +1,11 @@ -import { Command, CommandoMessage } from 'discord.js-commando'; +import { Command, CommandoMessage, CommandoClient } from 'discord.js-commando'; +//@ts-ignore no types import emoji from 'emoji-random' import { MessageEmbed } from 'discord.js'; import axios from 'axios'; module.exports = class DuckAnimals extends Command { - constructor(client) { + constructor(client: CommandoClient) { super(client, { name: 'duck', aliases: [ @@ -29,10 +30,10 @@ module.exports = class DuckAnimals extends Command { .setAuthor('random-d.uk', 'https://random-d.uk/favicon.ico', 'https://random-d.uk') .setColor(0xFFCC4D) .setImage(await (await axios.get('https://random-d.uk/api/v1/random?type=gif')).data.url) - msg.say(emb) + return msg.say(emb) } catch (err) { console.log(err) - msg.reply('Woops, there was an error with the (https://random-d.uk) API. ' + emoji.random()) + return msg.reply('Woops, there was an error with the (https://random-d.uk) API. ' + emoji.random()) } } };
\ No newline at end of file diff --git a/src/commands/animals/fox.ts b/src/commands/animals/fox.ts index 86cab3a..155a987 100644 --- a/src/commands/animals/fox.ts +++ b/src/commands/animals/fox.ts @@ -1,10 +1,11 @@ -import { Command, CommandoMessage } from 'discord.js-commando'; +import { Command, CommandoMessage, CommandoClient } from 'discord.js-commando'; +//@ts-ignore no types import emoji from 'emoji-random' import { MessageEmbed } from 'discord.js'; import axios from 'axios'; module.exports = class FoxAnimals extends Command { - constructor(client) { + constructor(client: CommandoClient) { super(client, { name: 'fox', aliases: [ @@ -29,10 +30,10 @@ module.exports = class FoxAnimals extends Command { .setAuthor('randomfox.ca') .setColor(0xFFCC4D) .setImage(await (await axios.get('https://randomfox.ca/floof/')).data.image) - msg.say(emb) + return msg.say(emb) } catch (err) { console.log(err) - msg.reply('Woops, there was an error with the (https://randomfox.ca/) API. ' + emoji.random()) + return msg.reply('Woops, there was an error with the (https://randomfox.ca/) API. ' + emoji.random()) } } };
\ No newline at end of file diff --git a/src/commands/animals/owl.ts b/src/commands/animals/owl.ts index 9f219ac..6a5f583 100644 --- a/src/commands/animals/owl.ts +++ b/src/commands/animals/owl.ts @@ -1,10 +1,11 @@ -import { Command, CommandoMessage } from 'discord.js-commando'; +import { Command, CommandoMessage, CommandoClient } from 'discord.js-commando'; +//@ts-ignore no types import emoji from 'emoji-random' import { MessageEmbed } from 'discord.js'; import axios from 'axios'; module.exports = class OwlAnimals extends Command { - constructor(client) { + constructor(client: CommandoClient) { super(client, { name: 'owl', aliases: [ @@ -29,10 +30,10 @@ module.exports = class OwlAnimals extends Command { .setAuthor('pics.floofybot.moe/owl', 'http://pics.floofybot.moe/assets/favicon.svg', 'http://pics.floofybot.moe/') .setColor(0xFFCC4D) .setImage(await (await axios.get('http://pics.floofybot.moe/owl')).data.image) - msg.say(emb) + return msg.say(emb) } catch (err) { console.log(err) - msg.reply('Woops, there was an error with the (http://pics.floofybot.moe/) API. ' + emoji.random()) + return msg.reply('Woops, there was an error with the (http://pics.floofybot.moe/) API. ' + emoji.random()) } } };
\ No newline at end of file diff --git a/src/commands/anime/uwufy.ts b/src/commands/anime/uwufy.ts index 45bb3d1..f9f0187 100644 --- a/src/commands/anime/uwufy.ts +++ b/src/commands/anime/uwufy.ts @@ -1,9 +1,10 @@ -import { Command, CommandoMessage } from 'discord.js-commando'; +import { Command, CommandoMessage, CommandoClient } from 'discord.js-commando'; +//@ts-ignore no types import emoji from 'emoji-random'; import uwufy from 'uwufy' module.exports = class UwufyAnime extends Command { - constructor(client) { + constructor(client: CommandoClient) { super(client, { name: 'uwufy', aliases: ['uwu', 'owofy', 'owo'], @@ -31,8 +32,8 @@ module.exports = class UwufyAnime extends Command { }, }); } - run(msg: CommandoMessage, { userMsg }) { + run(msg: CommandoMessage, { userMsg }: any) { msg.reply(uwufy(userMsg) + ' ' + emoji.random()) - msg.delete(); + return msg.delete(); } };
\ No newline at end of file diff --git a/src/commands/anime/waifu.ts b/src/commands/anime/waifu.ts index 80363e3..d72348f 100644 --- a/src/commands/anime/waifu.ts +++ b/src/commands/anime/waifu.ts @@ -1,10 +1,11 @@ -import { Command, CommandoMessage } from 'discord.js-commando'; +import { Command, CommandoMessage, CommandoClient } from 'discord.js-commando'; import request from 'node-superfetch'; import { MessageEmbed } from 'discord.js'; +//@ts-ignore yes it does tf import { shorten } from '../../utils/Util.js' module.exports = class WaifuAnime extends Command { - constructor(client) { + constructor(client: CommandoClient) { super(client, { name: 'waifu', aliases: ['thiswaifudoesnotexist', 'this-waifu-does-not-exist'], @@ -29,6 +30,6 @@ module.exports = class WaifuAnime extends Command { .setDescription(shorten(text, 1000)) .setColor(0xFFCC4D) .setThumbnail(`https://www.thiswaifudoesnotexist.net/example-${num}.jpg`) - msg.reply(emb) + return msg.reply(emb) } };
\ No newline at end of file diff --git a/src/commands/crypto/btc.ts b/src/commands/crypto/btc.ts index 596b9e4..88cbf5a 100644 --- a/src/commands/crypto/btc.ts +++ b/src/commands/crypto/btc.ts @@ -1,10 +1,11 @@ -import { Command, CommandoMessage } from 'discord.js-commando'; +import { Command, CommandoMessage, CommandoClient } from 'discord.js-commando'; +//@ts-ignore import emoji from 'emoji-random'; import btc from 'btc-value'; btc.setApiKey('a43419ce-fc59-4951-8af9-20c5e36ef73f'); module.exports = class BTCCrypto extends Command { - constructor(client) { + constructor(client: CommandoClient) { super(client, { name: 'btc', aliases: ['bitcoin', 'crypto'], @@ -32,10 +33,10 @@ module.exports = class BTCCrypto extends Command { clientPermissions: ['SEND_MESSAGES', 'READ_MESSAGE_HISTORY'] }); } - run(msg: CommandoMessage, { currencyName }) { + run(msg: CommandoMessage, { currencyName }: any) { currencyName = currencyName.toUpperCase(); - btc({ isDecimal: true, currencyCode: currencyName }).then(value => { - msg.reply(`The current price of *Bitcoin* is **${value} ${currencyName}**. ${emoji.random()}`); + return btc({ isDecimal: true, currencyCode: currencyName }).then(value => { + return msg.reply(`The current price of *Bitcoin* is **${value} ${currencyName}**. ${emoji.random()}`); }); } };
\ No newline at end of file diff --git a/src/commands/crypto/btcchange.ts b/src/commands/crypto/btcchange.ts index f0b05b0..002a2cb 100644 --- a/src/commands/crypto/btcchange.ts +++ b/src/commands/crypto/btcchange.ts @@ -1,10 +1,11 @@ -import { Command, CommandoMessage } from 'discord.js-commando'; +import { Command, CommandoMessage, CommandoClient } from 'discord.js-commando'; import btc from 'btc-value'; +//@ts-ignore no types import emoji from 'emoji-random'; btc.setApiKey('a43419ce-fc59-4951-8af9-20c5e36ef73f'); module.exports = class BTCChangeCrypto extends Command { - constructor(client) { + constructor(client: CommandoClient) { super(client, { name: 'btcchange', aliases: ['bitcoinchange', 'cryptochange', 'btcc'], @@ -33,21 +34,21 @@ module.exports = class BTCChangeCrypto extends Command { clientPermissions: ['SEND_MESSAGES', 'READ_MESSAGE_HISTORY'] }); } - run(msg: CommandoMessage, { timeAmount }) { + run(msg: CommandoMessage, { timeAmount }: any) { if (timeAmount == 'day') { - btc.getPercentageChangeLastDay().then(percentage => { - msg.reply('The fluction amount of *Bitcoin* in the last **' + timeAmount + '** is **' + percentage + '%**. ' + emoji.random()); + return btc.getPercentageChangeLastDay().then(percentage => { + return msg.reply('The fluction amount of *Bitcoin* in the last **' + timeAmount + '** is **' + percentage + '%**. ' + emoji.random()); }); } else if (timeAmount == 'hour') { - btc.getPercentageChangeLastHour().then(percentage => { - msg.reply('The fluction amount of *Bitcoin* in the last **' + timeAmount + '** is **' + percentage + '%**. ' + emoji.random()); + return btc.getPercentageChangeLastHour().then(percentage => { + return msg.reply('The fluction amount of *Bitcoin* in the last **' + timeAmount + '** is **' + percentage + '%**. ' + emoji.random()); }); } else if (timeAmount == 'week') { - btc.getPercentageChangeLastWeek().then(percentage => { - msg.reply('The fluction amount of *Bitcoin* in the last **' + timeAmount + '** is **' + percentage + '%**. ' + emoji.random()); + return btc.getPercentageChangeLastWeek().then(percentage => { + return msg.reply('The fluction amount of *Bitcoin* in the last **' + timeAmount + '** is **' + percentage + '%**. ' + emoji.random()); }); } else { - msg.reply('*' + timeAmount + '* is not a valid range. ' + emoji.random()); + return msg.reply('*' + timeAmount + '* is not a valid range. ' + emoji.random()); } } };
\ No newline at end of file diff --git a/src/commands/crypto/securitykey.ts b/src/commands/crypto/securitykey.ts index 649320a..a1852e7 100644 --- a/src/commands/crypto/securitykey.ts +++ b/src/commands/crypto/securitykey.ts @@ -1,9 +1,10 @@ -import { Command, CommandoMessage } from 'discord.js-commando'; +import { Command, CommandoMessage, CommandoClient } from 'discord.js-commando'; +//@ts-ignore no types import emoji from 'emoji-random' import crypto from 'crypto' module.exports = class RateCrypto extends Command { - constructor(client) { + constructor(client: CommandoClient) { super(client, { name: 'securitykey', aliases: ['security-key'], @@ -21,6 +22,6 @@ module.exports = class RateCrypto extends Command { } run(msg: CommandoMessage) { msg.reply(`Check your DMs! ${emoji.random()}`) - msg.author.send(crypto.randomBytes(15).toString('hex') + ' ' + emoji.random()) + return msg.author.send(crypto.randomBytes(15).toString('hex') + ' ' + emoji.random()) } };
\ No newline at end of file diff --git a/src/commands/minecraft/getbody.ts b/src/commands/minecraft/getbody.ts index d33192b..072a9d2 100644 --- a/src/commands/minecraft/getbody.ts +++ b/src/commands/minecraft/getbody.ts @@ -1,8 +1,8 @@ -import { Command, CommandoMessage } from 'discord.js-commando'; +import { Command, CommandoMessage, CommandoClient } from 'discord.js-commando'; import { MessageEmbed } from 'discord.js'; module.exports = class GetBodyMinecraft extends Command { - constructor(client) { + constructor(client: CommandoClient) { super(client, { name: 'getbody', aliases: [ @@ -33,13 +33,13 @@ module.exports = class GetBodyMinecraft extends Command { ] }); } - async run(msg: CommandoMessage, { uUsername }) { + async run(msg: CommandoMessage, { uUsername }: any) { let emb = new MessageEmbed() .setColor(0xFFCC4D) .setAuthor(uUsername, `https://minotar.net/body/${encodeURIComponent(uUsername)}`) .setImage(`https://minotar.net/body/${encodeURIComponent(uUsername)}`) console.debug(`URL for ${uUsername}:`, emb.image?.url) - msg.reply(emb) + return msg.reply(emb) } };
\ No newline at end of file diff --git a/src/commands/minecraft/getface.ts b/src/commands/minecraft/getface.ts index b53e6fb..7565d68 100644 --- a/src/commands/minecraft/getface.ts +++ b/src/commands/minecraft/getface.ts @@ -1,8 +1,8 @@ -import { Command, CommandoMessage } from 'discord.js-commando'; +import { Command, CommandoMessage, CommandoClient } from 'discord.js-commando'; import { MessageEmbed } from 'discord.js'; module.exports = class GetFaceMinecraft extends Command { - constructor(client) { + constructor(client: CommandoClient) { super(client, { name: 'getface', aliases: [ @@ -33,11 +33,11 @@ module.exports = class GetFaceMinecraft extends Command { ] }); } - async run(msg: CommandoMessage, { uUsername }) { + async run(msg: CommandoMessage, { uUsername }: any) { let emb = new MessageEmbed() .setColor(0xFFCC4D) .setAuthor(uUsername, `https://minotar.net/helm/${encodeURIComponent(uUsername)}`) .setImage(`https://minotar.net/helm/${encodeURIComponent(uUsername)}`) - msg.reply(emb) + return msg.reply(emb) } };
\ No newline at end of file diff --git a/src/commands/minecraft/gethead.ts b/src/commands/minecraft/gethead.ts index 665d01e..4ae61e2 100644 --- a/src/commands/minecraft/gethead.ts +++ b/src/commands/minecraft/gethead.ts @@ -1,8 +1,8 @@ -import { Command, CommandoMessage } from 'discord.js-commando'; +import { Command, CommandoMessage, CommandoClient } from 'discord.js-commando'; import { MessageEmbed } from 'discord.js'; module.exports = class GetHeadMinecraft extends Command { - constructor(client) { + constructor(client: CommandoClient) { super(client, { name: 'gethead', aliases: [ @@ -33,11 +33,11 @@ module.exports = class GetHeadMinecraft extends Command { ] }); } - async run(msg: CommandoMessage, { uUsername }) { + async run(msg: CommandoMessage, { uUsername }: any) { let emb = new MessageEmbed() .setColor(0xFFCC4D) .setAuthor(uUsername, `https://minotar.net/helm/${encodeURIComponent(uUsername)}`) .setImage(`https://minotar.net/cube/${encodeURIComponent(uUsername)}/100.png`) - msg.reply(emb) + return msg.reply(emb) } };
\ No newline at end of file diff --git a/src/commands/minecraft/getminime.ts b/src/commands/minecraft/getminime.ts index 13352f0..c06c7aa 100644 --- a/src/commands/minecraft/getminime.ts +++ b/src/commands/minecraft/getminime.ts @@ -1,8 +1,8 @@ -import { Command, CommandoMessage } from 'discord.js-commando'; +import { Command, CommandoMessage, CommandoClient } from 'discord.js-commando'; import { MessageEmbed } from 'discord.js'; module.exports = class GetMiniMeMinecraft extends Command { - constructor(client) { + constructor(client: CommandoClient) { super(client, { name: 'getminime', aliases: [ @@ -39,7 +39,7 @@ module.exports = class GetMiniMeMinecraft extends Command { ] }); } - async run(msg: CommandoMessage, { uUsername, uTrans }) { + async run(msg: CommandoMessage, { uUsername, uTrans }: any) { console.debug('Transparency value:', uTrans) let emb = new MessageEmbed() @@ -50,10 +50,10 @@ module.exports = class GetMiniMeMinecraft extends Command { if (uTrans) { emb.setImage(`http://avatar.yourminecraftservers.com/avatar/trnsp/steve/tall/128/${encodeURIComponent(uUsername)}.png`) } else { - emb.setImage(`http://avatar.yourminecraftservers.com/avatar/rad/steve/tall/128/${encodeURIComponent(username)}.png`) + emb.setImage(`http://avatar.yourminecraftservers.com/avatar/rad/steve/tall/128/${encodeURIComponent(uUsername)}.png`) } console.debug(`Image URL for ${uUsername}: ${emb.image?.url}`) - msg.reply(emb) + return msg.reply(emb) } };
\ No newline at end of file diff --git a/src/commands/minecraft/getskin.ts b/src/commands/minecraft/getskin.ts index ff2deb2..137e9b0 100644 --- a/src/commands/minecraft/getskin.ts +++ b/src/commands/minecraft/getskin.ts @@ -1,8 +1,8 @@ -import { Command, CommandoMessage } from 'discord.js-commando'; +import { Command, CommandoMessage, CommandoClient } from 'discord.js-commando'; import { MessageEmbed } from 'discord.js'; module.exports = class GetSkinMinecraft extends Command { - constructor(client) { + constructor(client: CommandoClient) { super(client, { name: 'getskin', aliases: [ @@ -33,11 +33,11 @@ module.exports = class GetSkinMinecraft extends Command { ] }); } - async run(msg: CommandoMessage, { uUsername }) { + async run(msg: CommandoMessage, { uUsername }: any) { let emb = new MessageEmbed() .setColor(0xFFCC4D) .setAuthor(uUsername, `https://minotar.net/helm/${encodeURIComponent(uUsername)}`) .setImage(`https://minotar.net/skin/${encodeURIComponent(uUsername)}`) - msg.reply(emb) + return msg.reply(emb) } };
\ No newline at end of file diff --git a/src/commands/minecraft/minecraftserverstatus.ts b/src/commands/minecraft/minecraftserverstatus.ts index 156a04f..706b43f 100644 --- a/src/commands/minecraft/minecraftserverstatus.ts +++ b/src/commands/minecraft/minecraftserverstatus.ts @@ -1,10 +1,11 @@ -import { Command, CommandoMessage } from 'discord.js-commando'; +import { Command, CommandoMessage, CommandoClient } from 'discord.js-commando'; import { MessageEmbed } from 'discord.js'; import axios from 'axios' +//@ts-ignore no types import emoji from 'emoji-random' module.exports = class MinecraftServerMinecraft extends Command { - constructor(client) { + constructor(client: CommandoClient) { super(client, { name: 'minecraftserverstatus', aliases: [ @@ -42,12 +43,13 @@ module.exports = class MinecraftServerMinecraft extends Command { ] }); } - async run(msg: CommandoMessage, { ip, port }) { + async run(msg: CommandoMessage, { ip, port }: any) { const res = ( await axios(`https://mcapi.us/server/status?ip=${ip}&port=${port}`).catch(err => { console.error(err) return msg.reply('Woops, an error has occured. ' + emoji.random()) }) + //@ts-ignore yes this exists... ).data if (res.status !== 'success') { diff --git a/src/commands/moderation/addrole.ts b/src/commands/moderation/addrole.ts index 63f2f14..015775b 100644 --- a/src/commands/moderation/addrole.ts +++ b/src/commands/moderation/addrole.ts @@ -1,8 +1,9 @@ -import { Command, CommandoMessage } from 'discord.js-commando'; +import { Command, CommandoMessage, CommandoClient } from 'discord.js-commando'; +//@ts-ignore this has no types import emoji from 'emoji-random' module.exports = class AddRoleModeration extends Command { - constructor(client) { + constructor(client: CommandoClient) { super(client, { name: 'addrole', aliases: ['roleadd'], @@ -36,8 +37,8 @@ module.exports = class AddRoleModeration extends Command { guildOnly: true }); } - run(msg: CommandoMessage, { userID, roleID }) { - msg.reply('Command disabled.') + run(msg: CommandoMessage, { userID, roleID }: any) { + return msg.reply(`Command disabled. ${emoji.random()}`) // let role = roleID // console.log('role:', role) // let member = userID diff --git a/src/commands/moderation/ban.ts b/src/commands/moderation/ban.ts index b33a344..6bf6168 100644 --- a/src/commands/moderation/ban.ts +++ b/src/commands/moderation/ban.ts @@ -1,8 +1,9 @@ -import { Command, CommandoMessage } from 'discord.js-commando'; +import { Command, CommandoMessage, CommandoClient } from 'discord.js-commando'; +//@ts-ignore this has no types import emoji from 'emoji-random' module.exports = class BanModeration extends Command { - constructor(client) { + constructor(client: CommandoClient) { super(client, { name: 'ban', aliases: ['banuser', 'ban-user'], @@ -23,19 +24,21 @@ module.exports = class BanModeration extends Command { guildOnly: true }); } + //@ts-ignore this is not promsise based run(msg: CommandoMessage) { let userID = msg.mentions.members?.first() if (!userID?.id) { - msg.reply('No member was mentioned. ' + emoji.random()) + return msg.reply('No member was mentioned. ' + emoji.random()) } else if (userID?.id == msg.author.id) { - msg.reply('You cannot ban yourself.' + emoji.random()) + return msg.reply('You cannot ban yourself.' + emoji.random()) } else if (userID?.id == this.client.user?.id) { - msg.reply('Not funny. ' + emoji.random()) + return msg.reply('Not funny. ' + emoji.random()) } else if (!msg.guild.member(userID.id)) { - msg.reply('Member does not exist in server.') + return msg.reply('Member does not exist in server.') } else { msg.guild.members.ban(userID.id) - msg.say(`**${userID}** has been banned!`).then(m => { + return msg.say(`**${userID}** has been banned!`).then(m => { + //@ts-ignore yes this exists m.react('🇫'); }) } diff --git a/src/commands/moderation/clear.ts b/src/commands/moderation/clear.ts index 5175556..c306231 100644 --- a/src/commands/moderation/clear.ts +++ b/src/commands/moderation/clear.ts @@ -1,8 +1,9 @@ -import { Command, CommandoMessage } from 'discord.js-commando'; +import { Command, CommandoMessage, CommandoClient } from 'discord.js-commando'; +//@ts-ignore no types import emoji from 'emoji-random'; module.exports = class ClearModeration extends Command { - constructor(client) { + constructor(client: CommandoClient) { super(client, { name: 'clear', aliases: ['delete', 'del', 'c'], @@ -32,26 +33,35 @@ module.exports = class ClearModeration extends Command { clientPermissions: ['SEND_MESSAGES', 'READ_MESSAGE_HISTORY', 'MANAGE_MESSAGES'] }); } - async run(msg: CommandoMessage, { deleteAmount }) { + //@ts-ignore this is not promise based + async run(msg: CommandoMessage, { deleteAmount }: any) { if (msg.member.hasPermission('MANAGE_MESSAGES')) { if (!deleteAmount) { - msg.reply('You haven\'t specified an amount of messages which should be deleted. ' + emoji.random()).then(deleteNotificationMessage => { + return msg.reply('You haven\'t specified an amount of messages which should be deleted. ' + emoji.random()).then(deleteNotificationMessage => { + //@ts-ignore this exists deleteNotificationMessage.delete({ timeout: 2000 }); + //@ts-ignore this exists msg.delete({ timeout: 2000 }) }); } else if (isNaN(deleteAmount)) { - msg.reply('The amount parameter isn\'t a number. ' + emoji.random()).then(deleteNotificationMessage => { + return msg.reply('The amount parameter isn\'t a number. ' + emoji.random()).then(deleteNotificationMessage => { + //@ts-ignore this exists deleteNotificationMessage.delete({ timeout: 2000 }); + //@ts-ignore this exists msg.delete({ timeout: 2000 }) }); } else if (deleteAmount > 100) { - msg.reply('You can\'t delete more than 100 messages at once. ' + emoji.random()).then(deleteNotificationMessage => { + return msg.reply('You can\'t delete more than 100 messages at once. ' + emoji.random()).then(deleteNotificationMessage => { + //@ts-ignore this exists deleteNotificationMessage.delete({ timeout: 2000 }); + //@ts-ignore this exists msg.delete({ timeout: 2000 }) }); } else if (deleteAmount < 1) { - msg.reply('You have to delete at least 1 message. ' + emoji.random()).then(deleteNotificationMessage => { + return msg.reply('You have to delete at least 1 message. ' + emoji.random()).then(deleteNotificationMessage => { + //@ts-ignore this exists deleteNotificationMessage.delete({ timeout: 2000 }); + //@ts-ignore this exists msg.delete({ timeout: 2000 }) }); } @@ -69,15 +79,18 @@ module.exports = class ClearModeration extends Command { }).then(messages => { // I am on v11 discord.js // why the hell did i put this msg here lol, its 07:56 on 2020/04/27 and i woke up at 6am and i dont really know // why i put this msg here lol, i am on v12 so that msg mustve been a while ago lol + //@ts-ignore this exists msg.channel.bulkDelete(messages); }); - msg.reply('It\'s been deleted ~uwu ' + emoji.random()).then(deleteNotificationMessage => { + return msg.reply('It\'s been deleted ~uwu ' + emoji.random()).then(deleteNotificationMessage => { + //@ts-ignore this exists deleteNotificationMessage.delete({ timeout: 2000 }); + //@ts-ignore this exists msg.delete({ timeout: 2000 }) }); } } else { - msg.reply('Insufficent permsissions. ' + emoji.random()); + return msg.reply('Insufficent permsissions. ' + emoji.random()); } } };
\ No newline at end of file diff --git a/src/commands/moderation/kick.ts b/src/commands/moderation/kick.ts index 37d08e9..c3e57a2 100644 --- a/src/commands/moderation/kick.ts +++ b/src/commands/moderation/kick.ts @@ -1,8 +1,9 @@ -import { Command, CommandoMessage } from 'discord.js-commando'; +import { Command, CommandoMessage, CommandoClient } from 'discord.js-commando'; +//@ts-ignore this has no types import emoji from 'emoji-random' module.exports = class KickModeration extends Command { - constructor(client) { + constructor(client: CommandoClient) { super(client, { name: 'kick', aliases: ['kickuser', 'kick-user'], @@ -23,19 +24,22 @@ module.exports = class KickModeration extends Command { guildOnly: true }); } + //@ts-ignore this aint async run(msg: CommandoMessage) { let userID = msg.mentions.members?.first() if (!userID?.id) { - msg.reply('No member was mentioned. ' + emoji.random()) + return msg.reply('No member was mentioned. ' + emoji.random()) } else if (userID?.id == msg.author.id) { - msg.reply('You cannot kick yourself.' + emoji.random()) + return msg.reply('You cannot kick yourself.' + emoji.random()) } else if (userID?.id == this.client.user?.id) { - msg.reply('Not funny. ' + emoji.random()) + return msg.reply('Not funny. ' + emoji.random()) } else if (!msg.guild.member(userID.id)) { - msg.reply('Member does not exist in server.') + return msg.reply('Member does not exist in server.') } else { + //@ts-ignore stupid typescript error this exists msg.guild.members.prune(userID.id) - msg.say(`**${userID}** has been kicked!`).then(m => { + return msg.say(`**${userID}** has been kicked!`).then(m => { + //@ts-ignore this exists m.react('🇫'); }) } diff --git a/src/commands/moderation/removerole.ts b/src/commands/moderation/removerole.ts index d86dbf2..e8a950c 100644 --- a/src/commands/moderation/removerole.ts +++ b/src/commands/moderation/removerole.ts @@ -1,7 +1,9 @@ -import { Command, CommandoMessage } from 'discord.js-commando'; +import { Command, CommandoMessage, CommandoClient } from 'discord.js-commando'; +//@ts-ignore no types +import emoji from 'emoji-random'; module.exports = class RemoveRoleModeration extends Command { - constructor(client) { + constructor(client: CommandoClient) { super(client, { name: 'removerole', aliases: ['roleremove'], @@ -35,8 +37,8 @@ module.exports = class RemoveRoleModeration extends Command { ] }); } - run(msg: CommandoMessage, { userID, roleID }) { - msg.reply('Command disabled.') + run(msg: CommandoMessage, { userID, roleID }: any) { + return msg.reply(`Command disabled. ${emoji.random()}`) // let role = roleID // console.log('role:', role) // let member = userID diff --git a/src/commands/nsfw/danbooru.ts b/src/commands/nsfw/danbooru.ts index 4ab5347..065c01b 100644 --- a/src/commands/nsfw/danbooru.ts +++ b/src/commands/nsfw/danbooru.ts @@ -1,9 +1,9 @@ -import { Command, CommandoMessage } from 'discord.js-commando'; +import { Command, CommandoMessage, CommandoClient } from 'discord.js-commando'; import { MessageEmbed } from 'discord.js'; import axios from 'axios' export default class DanbooruNSFW extends Command { - constructor(client) { + constructor(client: CommandoClient) { super(client, { name: 'danbooru', group: 'nsfw', @@ -30,7 +30,7 @@ export default class DanbooruNSFW extends Command { nsfw: true }); } - async run(msg: CommandoMessage, { tTags }) { + async run(msg: CommandoMessage, { tTags }: any) { const tags = await tTags.trim().toLowerCase() console.log(tags) const blacklist = ['loli', 'shota', 'cub', 'young', 'child', 'baby', 'guro', 'gore', 'vore', 'scat', 'poop', 'kid', 'shit', 'turd', 'feces', 'excrement', 'excrete']; @@ -44,13 +44,16 @@ export default class DanbooruNSFW extends Command { const res = await axios.get(`https://danbooru.donmai.us/posts.json?limit=200&tags=${tags}+-rating:safe`) .catch(error => console.log(error)) + //@ts-ignore yes data exists const randomInt = Math.floor(Math.random() * res.data.length) + //@ts-ignore yes data exists if (blacklist.includes(res.data[randomInt].tags)) { return msg.reply('Sorry! This image had a tag that was blacklisted! ⛔') } - let getRating = (rating) => { + //@ts-ignore yes all code paths return a value + let getRating = (rating: any) => { if (rating === 's') { return 'Safe' } if (rating === 'q') { @@ -65,10 +68,13 @@ export default class DanbooruNSFW extends Command { let emb = new MessageEmbed() .setColor(0xFFCC4D) .setTitle(`Danbooru - ${!tags ? 'Random Image' : tags}`) + //@ts-ignore yes data exists .setDescription(`[Source](http://danbooru.donmai.us/posts/${res.data[randomInt].id})\n\nFixed bug where responses were being evaluated out of 100 instead of data length!`) + //@ts-ignore yes data exists .setImage(res.data[randomInt].file_url) .setTimestamp(new Date()) + //@ts-ignore yes data exists .setFooter(`Score: ${res.data[randomInt].score} | Rating: ${getRating(res.data[randomInt].rating)}`, msg.author.avatarURL()) - msg.say(emb); + return msg.say(emb); } }
\ No newline at end of file diff --git a/src/commands/nsfw/gelbooru.ts b/src/commands/nsfw/gelbooru.ts index 44c0ccc..a9890fa 100644 --- a/src/commands/nsfw/gelbooru.ts +++ b/src/commands/nsfw/gelbooru.ts @@ -1,9 +1,9 @@ -import { Command, CommandoMessage } from 'discord.js-commando'; +import { Command, CommandoMessage, CommandoClient } from 'discord.js-commando'; import { MessageEmbed } from 'discord.js'; import axios from 'axios' export default class GelbooruNSFW extends Command { - constructor(client) { + constructor(client: CommandoClient) { super(client, { name: 'gelbooru', group: 'nsfw', @@ -30,7 +30,7 @@ export default class GelbooruNSFW extends Command { nsfw: true }); } - async run(msg: CommandoMessage, { tTags }) { + async run(msg: CommandoMessage, { tTags }: any) { const tags = await tTags.trim() const blacklist = ['loli', 'shota', 'cub', 'young', 'child', 'baby', 'guro', 'gore', 'vore', 'scat', 'poop', 'kid', 'shit', 'turd', 'feces', 'excrement', 'excrete']; @@ -43,13 +43,17 @@ export default class GelbooruNSFW extends Command { const res = await axios.get(`https://gelbooru.com/index.php?page=dapi&s=post&q=index&limit=100&tags=${tags}+-rating:safe&json=1`) .catch(error => console.log(error)) + //@ts-ignore yes data exists const randomInt = Math.floor(Math.random() * res.data.length) + //@ts-ignore yes data exists if (blacklist.includes(res.data[randomInt].tags.toLowerCase())) { return msg.reply('Sorry! This image had a tag that was blacklisted! ⛔') } - let getRating = (rating) => { + + //@ts-ignore yes all code paths return a value + let getRating = (rating: any) => { if (rating === 's') { return 'Safe' } if (rating === 'q') { @@ -64,10 +68,13 @@ export default class GelbooruNSFW extends Command { let emb = new MessageEmbed() .setColor(0xFFCC4D) .setTitle(`Gelbooru - ${!tags ? 'Random Image' : tags}`) + //@ts-ignore yes data exists .setDescription(`[Source](https://gelbooru.com/index.php?page=post&s=view&id=${res.data[randomInt].id})\n\nFixed bug where responses were being evaluated out of 100 instead of data length!`) + //@ts-ignore yes data exists .setImage(res.data[randomInt].file_url) .setTimestamp(new Date()) + //@ts-ignore yes data exists .setFooter(`Score: ${res.data[randomInt].score} | Rating: ${getRating(res.data[randomInt].rating)}`, msg.author.avatarURL()) - msg.say(emb); + return msg.say(emb); } }
\ No newline at end of file diff --git a/src/commands/nsfw/rule34.ts b/src/commands/nsfw/rule34.ts index 0e453cf..568b07a 100644 --- a/src/commands/nsfw/rule34.ts +++ b/src/commands/nsfw/rule34.ts @@ -1,9 +1,9 @@ -import { Command, CommandoMessage } from 'discord.js-commando'; +import { Command, CommandoMessage, CommandoClient } from 'discord.js-commando'; import { MessageEmbed } from 'discord.js'; import axios from 'axios' export default class Rule34NSFW extends Command { - constructor(client) { + constructor(client: CommandoClient) { super(client, { name: 'rule34', aliases: ['r34'], @@ -31,7 +31,7 @@ export default class Rule34NSFW extends Command { nsfw: true }); } - async run(msg: CommandoMessage, { tTags }) { + async run(msg: CommandoMessage, { tTags }: any) { const tags = await tTags.trim() const blacklist = ['loli', 'shota', 'cub', 'young', 'child', 'baby', 'guro', 'gore', 'vore', 'scat', 'poop', 'kid', 'shit', 'turd', 'feces', 'excrement', 'excrete']; @@ -44,8 +44,10 @@ export default class Rule34NSFW extends Command { const res = await axios.get(`http://rule34.xxx/index.php?page=dapi&s=post&q=index&limit=100&tags=${tags}+-rating:safe&json=1`) .catch(error => console.log(error)) + //@ts-ignore yes data exists const randomInt = Math.floor(Math.random() * res.data.length) + //@ts-ignore yes data exists if (blacklist.includes(res.data[randomInt].tags.toLowerCase())) { return msg.reply('Sorry! This image had a tag that was blacklisted! ⛔') } @@ -53,10 +55,13 @@ export default class Rule34NSFW extends Command { let emb = new MessageEmbed() .setColor(0xFFCC4D) .setTitle(`Rule34 - ${!tags ? 'Random Image' : tags}`) + //@ts-ignore yes data exists .setDescription(`[Source](https://rule34.xxx/index.php?page=post&s=view&id=${res.data[randomInt].id})\n\nFixed bug where responses were being evaluated out of 100 instead of data length!`) + //@ts-ignore yes data exists .setImage(`https://rule34.xxx/images/${res.data[randomInt].directory}/${res.data[randomInt].image}`) .setTimestamp(new Date()) + //@ts-ignore yes data exists .setFooter(`Score: ${res.data[randomInt].score} | Rating: ${res.data[randomInt].rating}`, msg.author.avatarURL()) - msg.say(emb); + return msg.say(emb); } }
\ No newline at end of file diff --git a/src/commands/roleplay/blush.ts b/src/commands/roleplay/blush.ts index bbf0107..9d7352a 100644 --- a/src/commands/roleplay/blush.ts +++ b/src/commands/roleplay/blush.ts @@ -1,8 +1,9 @@ -import { Command, CommandoMessage } from 'discord.js-commando'; +import { Command, CommandoMessage, CommandoClient } from 'discord.js-commando'; +//@ts-ignore no types import emoji from 'emoji-random'; module.exports = class BlushRoleplay extends Command { - constructor(client) { + constructor(client: CommandoClient) { super(client, { name: 'blush', group: 'roleplay', @@ -24,7 +25,7 @@ module.exports = class BlushRoleplay extends Command { ] }); } - run(msg: CommandoMessage, { uUser }) { - msg.say(`_**${msg.author.username}** blushes at **${uUser.username}**._` + ' ' + emoji.random()) + run(msg: CommandoMessage, { uUser }: any) { + return msg.say(`_**${msg.author.username}** blushes at **${uUser.username}**._` + ' ' + emoji.random()) } };
\ No newline at end of file diff --git a/src/commands/roleplay/celebrate.ts b/src/commands/roleplay/celebrate.ts index 6924b39..f84f6f3 100644 --- a/src/commands/roleplay/celebrate.ts +++ b/src/commands/roleplay/celebrate.ts @@ -1,8 +1,9 @@ -import { Command, CommandoMessage } from 'discord.js-commando'; +import { Command, CommandoMessage, CommandoClient } from 'discord.js-commando'; +//@ts-ignore no types import emoji from 'emoji-random'; module.exports = class CelebrateRoleplay extends Command { - constructor(client) { + constructor(client: CommandoClient) { super(client, { name: 'celebrate', group: 'roleplay', @@ -18,6 +19,6 @@ module.exports = class CelebrateRoleplay extends Command { }); } run(msg: CommandoMessage) { - msg.say(`_**${msg.author.username}** celebrates._` + ' ' + emoji.random()) + return msg.say(`_**${msg.author.username}** celebrates._` + ' ' + emoji.random()) } };
\ No newline at end of file diff --git a/src/commands/roleplay/eat.ts b/src/commands/roleplay/eat.ts index ba2c364..25f4cbb 100644 --- a/src/commands/roleplay/eat.ts +++ b/src/commands/roleplay/eat.ts @@ -1,8 +1,9 @@ -import { Command, CommandoMessage } from 'discord.js-commando'; +import { Command, CommandoMessage, CommandoClient } from 'discord.js-commando'; +//@ts-ignore no types import emoji from 'emoji-random'; module.exports = class EatRoleplay extends Command { - constructor(client) { + constructor(client: CommandoClient) { super(client, { name: 'eat', group: 'roleplay', @@ -18,6 +19,6 @@ module.exports = class EatRoleplay extends Command { }); } run(msg: CommandoMessage) { - msg.say(`_**${msg.author.username}** eats._` + ' ' + emoji.random()) + return msg.say(`_**${msg.author.username}** eats._` + ' ' + emoji.random()) } };
\ No newline at end of file diff --git a/src/commands/roleplay/fistbump.ts b/src/commands/roleplay/fistbump.ts index e60bc80..dc6d32d 100644 --- a/src/commands/roleplay/fistbump.ts +++ b/src/commands/roleplay/fistbump.ts @@ -1,8 +1,9 @@ -import { Command, CommandoMessage } from 'discord.js-commando'; +import { Command, CommandoMessage, CommandoClient } from 'discord.js-commando'; +//@ts-ignore no types import emoji from 'emoji-random'; module.exports = class FistBumpRoleplay extends Command { - constructor(client) { + constructor(client: CommandoClient) { super(client, { name: 'fistbump', aliases: ['fist-bump'], @@ -25,7 +26,7 @@ module.exports = class FistBumpRoleplay extends Command { ] }); } - run(msg: CommandoMessage, { uUser }) { - msg.say(`_**${msg.author.username}** fist-bumps **${uUser.username}**._` + ' ' + emoji.random()) + run(msg: CommandoMessage, { uUser }: any) { + return msg.say(`_**${msg.author.username}** fist-bumps **${uUser.username}**._` + ' ' + emoji.random()) } };
\ No newline at end of file diff --git a/src/commands/roleplay/highfive.ts b/src/commands/roleplay/highfive.ts index 52dfa3d..605d505 100644 --- a/src/commands/roleplay/highfive.ts +++ b/src/commands/roleplay/highfive.ts @@ -1,8 +1,9 @@ -import { Command, CommandoMessage } from 'discord.js-commando'; +import { Command, CommandoMessage, CommandoClient } from 'discord.js-commando'; +//@ts-ignore no types import emoji from 'emoji-random'; module.exports = class HighFiveRoleplay extends Command { - constructor(client) { + constructor(client: CommandoClient) { super(client, { name: 'highfive', aliases: ['high-five'], @@ -25,7 +26,7 @@ module.exports = class HighFiveRoleplay extends Command { ] }); } - run(msg: CommandoMessage, { uUser }) { - msg.say(`_**${msg.author.username}** high-fives **${uUser.username}**._` + ' ' + emoji.random()) + run(msg: CommandoMessage, { uUser }: any) { + return msg.say(`_**${msg.author.username}** high-fives **${uUser.username}**._` + ' ' + emoji.random()) } };
\ No newline at end of file diff --git a/src/commands/roleplay/holdhands.ts b/src/commands/roleplay/holdhands.ts index acfa78e..7a46667 100644 --- a/src/commands/roleplay/holdhands.ts +++ b/src/commands/roleplay/holdhands.ts @@ -1,8 +1,9 @@ -import { Command, CommandoMessage } from 'discord.js-commando'; +import { Command, CommandoMessage, CommandoClient } from 'discord.js-commando'; +//@ts-ignore no types import emoji from 'emoji-random'; module.exports = class HoldHandsRoleplay extends Command { - constructor(client) { + constructor(client: CommandoClient) { super(client, { name: 'holdhands', aliases: ['hold-hands', 'holdhand', 'hold-hand'], @@ -25,7 +26,7 @@ module.exports = class HoldHandsRoleplay extends Command { ] }); } - run(msg: CommandoMessage, { uUser }) { - msg.say(`_**${msg.author.username}** holds **${uUser.username}** hand._` + ' ' + emoji.random()) + run(msg: CommandoMessage, { uUser }: any) { + return msg.say(`_**${msg.author.username}** holds **${uUser.username}** hand._` + ' ' + emoji.random()) } };
\ No newline at end of file diff --git a/src/commands/roleplay/hug.ts b/src/commands/roleplay/hug.ts index b77f681..e31e53f 100644 --- a/src/commands/roleplay/hug.ts +++ b/src/commands/roleplay/hug.ts @@ -1,8 +1,9 @@ -import { Command, CommandoMessage } from 'discord.js-commando'; +import { Command, CommandoMessage, CommandoClient } from 'discord.js-commando'; +//@ts-ignore no types import emoji from 'emoji-random'; module.exports = class HugRoleplay extends Command { - constructor(client) { + constructor(client: CommandoClient) { super(client, { name: 'hug', group: 'roleplay', @@ -24,7 +25,7 @@ module.exports = class HugRoleplay extends Command { ] }); } - run(msg: CommandoMessage, { uUser }) { - msg.say(`_**${msg.author.username}** hugs **${uUser.username}**._` + ' ' + emoji.random()) + run(msg: CommandoMessage, { uUser }: any) { + return msg.say(`_**${msg.author.username}** hugs **${uUser.username}**._` + ' ' + emoji.random()) } };
\ No newline at end of file diff --git a/src/commands/roleplay/inhale.ts b/src/commands/roleplay/inhale.ts index 4765a86..8a49bd1 100644 --- a/src/commands/roleplay/inhale.ts +++ b/src/commands/roleplay/inhale.ts @@ -1,8 +1,9 @@ -import { Command, CommandoMessage } from 'discord.js-commando'; +import { Command, CommandoMessage, CommandoClient } from 'discord.js-commando'; +//@ts-ignore no types import emoji from 'emoji-random'; module.exports = class InhaleRoleplay extends Command { - constructor(client) { + constructor(client: CommandoClient) { super(client, { name: 'inhale', group: 'roleplay', @@ -24,7 +25,7 @@ module.exports = class InhaleRoleplay extends Command { ] }); } - run(msg: CommandoMessage, { uUser }) { - msg.say(`_**${msg.author.username}** inhales **${uUser.username}** but gained no abilities._` + ' ' + emoji.random()) + run(msg: CommandoMessage, { uUser }: any) { + return msg.say(`_**${msg.author.username}** inhales **${uUser.username}** but gained no abilities._` + ' ' + emoji.random()) } };
\ No newline at end of file diff --git a/src/commands/roleplay/kill.ts b/src/commands/roleplay/kill.ts index 5756ad0..15446cd 100644 --- a/src/commands/roleplay/kill.ts +++ b/src/commands/roleplay/kill.ts @@ -1,8 +1,9 @@ -import { Command, CommandoMessage } from 'discord.js-commando'; +import { Command, CommandoMessage, CommandoClient } from 'discord.js-commando'; +//@ts-ignore no types import emoji from 'emoji-random'; module.exports = class KillRoleplay extends Command { - constructor(client) { + constructor(client: CommandoClient) { super(client, { name: 'kill', group: 'roleplay', @@ -24,7 +25,7 @@ module.exports = class KillRoleplay extends Command { ] }); } - run(msg: CommandoMessage, { uUser }) { - msg.say(`_**${msg.author.username}** kills **${uUser.username}**._` + ' ' + emoji.random()) + run(msg: CommandoMessage, { uUser }: any) { + return msg.say(`_**${msg.author.username}** kills **${uUser.username}**._` + ' ' + emoji.random()) } };
\ No newline at end of file diff --git a/src/commands/roleplay/kiss.ts b/src/commands/roleplay/kiss.ts index 7b455c7..6dbec4e 100644 --- a/src/commands/roleplay/kiss.ts +++ b/src/commands/roleplay/kiss.ts @@ -1,8 +1,9 @@ -import { Command, CommandoMessage } from 'discord.js-commando'; +import { Command, CommandoMessage, CommandoClient } from 'discord.js-commando'; +//@ts-ignore no types import emoji from 'emoji-random'; module.exports = class KissRoleplay extends Command { - constructor(client) { + constructor(client: CommandoClient) { super(client, { name: 'kiss', group: 'roleplay', @@ -24,7 +25,7 @@ module.exports = class KissRoleplay extends Command { ] }); } - run(msg: CommandoMessage, { uUser }) { - msg.say(`_**${msg.author.username}** kisses **${uUser.username}**._` + ' ' + emoji.random()) + run(msg: CommandoMessage, { uUser }: any) { + return msg.say(`_**${msg.author.username}** kisses **${uUser.username}**._` + ' ' + emoji.random()) } };
\ No newline at end of file diff --git a/src/commands/roleplay/pat.ts b/src/commands/roleplay/pat.ts index 70649a4..82c47d2 100644 --- a/src/commands/roleplay/pat.ts +++ b/src/commands/roleplay/pat.ts @@ -1,8 +1,9 @@ -import { Command, CommandoMessage } from 'discord.js-commando'; +import { Command, CommandoMessage, CommandoClient } from 'discord.js-commando'; +//@ts-ignore no types import emoji from 'emoji-random'; module.exports = class PatRoleplay extends Command { - constructor(client) { + constructor(client: CommandoClient) { super(client, { name: 'pat', group: 'roleplay', @@ -24,7 +25,7 @@ module.exports = class PatRoleplay extends Command { ] }); } - run(msg: CommandoMessage, { uUser }) { - msg.say(`_**${msg.author.username}** pat **${uUser.username}**._` + ' ' + emoji.random()) + run(msg: CommandoMessage, { uUser }: any) { + return msg.say(`_**${msg.author.username}** pat **${uUser.username}**._` + ' ' + emoji.random()) } };
\ No newline at end of file diff --git a/src/commands/roleplay/poke.ts b/src/commands/roleplay/poke.ts index 6d8525d..a008bcb 100644 --- a/src/commands/roleplay/poke.ts +++ b/src/commands/roleplay/poke.ts @@ -1,8 +1,9 @@ -import { Command, CommandoMessage } from 'discord.js-commando'; +import { Command, CommandoMessage, CommandoClient } from 'discord.js-commando'; +//@ts-ignore no types import emoji from 'emoji-random'; module.exports = class PokeRoleplay extends Command { - constructor(client) { + constructor(client: CommandoClient) { super(client, { name: 'poke', group: 'roleplay', @@ -24,7 +25,7 @@ module.exports = class PokeRoleplay extends Command { ] }); } - run(msg: CommandoMessage, { uUser }) { - msg.say(`_**${msg.author.username}** pokes **${uUser.username}**._` + ' ' + emoji.random()) + run(msg: CommandoMessage, { uUser }: any) { + return msg.say(`_**${msg.author.username}** pokes **${uUser.username}**._` + ' ' + emoji.random()) } };
\ No newline at end of file diff --git a/src/commands/roleplay/punch.ts b/src/commands/roleplay/punch.ts index 980bcff..8e5d8f8 100644 --- a/src/commands/roleplay/punch.ts +++ b/src/commands/roleplay/punch.ts @@ -1,8 +1,9 @@ -import { Command, CommandoMessage } from 'discord.js-commando'; +import { Command, CommandoMessage, CommandoClient } from 'discord.js-commando'; +//@ts-ignore no types import emoji from 'emoji-random'; module.exports = class PunchRoleplay extends Command { - constructor(client) { + constructor(client: CommandoClient) { super(client, { name: 'punch', group: 'roleplay', @@ -24,7 +25,7 @@ module.exports = class PunchRoleplay extends Command { ] }); } - run(msg: CommandoMessage, { uUser }) { - msg.say(`_**${msg.author.username}** punches **${uUser.username}**._` + ' ' + emoji.random()) + run(msg: CommandoMessage, { uUser }: any) { + return msg.say(`_**${msg.author.username}** punches **${uUser.username}**._` + ' ' + emoji.random()) } };
\ No newline at end of file diff --git a/src/commands/roleplay/slap.ts b/src/commands/roleplay/slap.ts index f007cb7..afe6546 100644 --- a/src/commands/roleplay/slap.ts +++ b/src/commands/roleplay/slap.ts @@ -1,8 +1,9 @@ -import { Command, CommandoMessage } from 'discord.js-commando'; +import { Command, CommandoMessage, CommandoClient } from 'discord.js-commando'; +//@ts-ignore no types import emoji from 'emoji-random'; module.exports = class SlapRoleplay extends Command { - constructor(client) { + constructor(client: CommandoClient) { super(client, { name: 'slap', group: 'roleplay', @@ -24,7 +25,7 @@ module.exports = class SlapRoleplay extends Command { ] }); } - run(msg: CommandoMessage, { uUser }) { - msg.say(`_**${msg.author.username}** slaps **${uUser.username}**._` + ' ' + emoji.random()) + run(msg: CommandoMessage, { uUser }: any) { + return msg.say(`_**${msg.author.username}** slaps **${uUser.username}**._` + ' ' + emoji.random()) } };
\ No newline at end of file diff --git a/src/commands/roleplay/sleep.ts b/src/commands/roleplay/sleep.ts index 0d8beb2..5186044 100644 --- a/src/commands/roleplay/sleep.ts +++ b/src/commands/roleplay/sleep.ts @@ -1,8 +1,9 @@ -import { Command, CommandoMessage } from 'discord.js-commando'; +import { Command, CommandoMessage, CommandoClient } from 'discord.js-commando'; +//@ts-ignore no types import emoji from 'emoji-random'; module.exports = class SleepRoleplay extends Command { - constructor(client) { + constructor(client: CommandoClient) { super(client, { name: 'sleep', group: 'roleplay', @@ -18,6 +19,6 @@ module.exports = class SleepRoleplay extends Command { }); } run(msg: CommandoMessage) { - msg.say(`_**${msg.author.username}** falls asleep._` + ' ' + emoji.random()) + return msg.say(`_**${msg.author.username}** falls asleep._` + ' ' + emoji.random()) } };
\ No newline at end of file diff --git a/src/commands/roleplay/wakeup.ts b/src/commands/roleplay/wakeup.ts index d8418a7..cdf99b4 100644 --- a/src/commands/roleplay/wakeup.ts +++ b/src/commands/roleplay/wakeup.ts @@ -1,8 +1,9 @@ -import { Command, CommandoMessage } from 'discord.js-commando'; +import { Command, CommandoMessage, CommandoClient } from 'discord.js-commando'; +//@ts-ignore no types import emoji from 'emoji-random'; module.exports = class WakeUpRoleplay extends Command { - constructor(client) { + constructor(client: CommandoClient) { super(client, { name: 'wakeup', aliases: ['wake-up'], @@ -19,6 +20,6 @@ module.exports = class WakeUpRoleplay extends Command { }); } run(msg: CommandoMessage) { - msg.say(`_**${msg.author.username}** wakes up._` + ' ' + emoji.random()) + return msg.say(`_**${msg.author.username}** wakes up._` + ' ' + emoji.random()) } };
\ No newline at end of file diff --git a/src/commands/roleplay/wave.ts b/src/commands/roleplay/wave.ts index 5c0b0f2..21e04f6 100644 --- a/src/commands/roleplay/wave.ts +++ b/src/commands/roleplay/wave.ts @@ -1,8 +1,9 @@ -import { Command, CommandoMessage } from 'discord.js-commando'; +import { Command, CommandoMessage, CommandoClient } from 'discord.js-commando'; +//@ts-ignore no types import emoji from 'emoji-random'; module.exports = class WaveRoleplay extends Command { - constructor(client) { + constructor(client: CommandoClient) { super(client, { name: 'wave', group: 'roleplay', @@ -24,7 +25,7 @@ module.exports = class WaveRoleplay extends Command { ] }); } - run(msg: CommandoMessage, { uUser }) { - msg.say(`_**${msg.author.username}** waves at **${uUser.username}**._` + ' ' + emoji.random()) + run(msg: CommandoMessage, { uUser }: any) { + return msg.say(`_**${msg.author.username}** waves at **${uUser.username}**._` + ' ' + emoji.random()) } };
\ No newline at end of file diff --git a/src/commands/roleplay/wink.ts b/src/commands/roleplay/wink.ts index dd80613..4b2061b 100644 --- a/src/commands/roleplay/wink.ts +++ b/src/commands/roleplay/wink.ts @@ -1,8 +1,9 @@ -import { Command, CommandoMessage } from 'discord.js-commando'; +import { Command, CommandoMessage, CommandoClient } from 'discord.js-commando'; +//@ts-ignore no types import emoji from 'emoji-random'; module.exports = class WinkRoleplay extends Command { - constructor(client) { + constructor(client: CommandoClient) { super(client, { name: 'wink', group: 'roleplay', @@ -24,7 +25,7 @@ module.exports = class WinkRoleplay extends Command { ] }); } - run(msg: CommandoMessage, { uUser }) { - msg.say(`_**${msg.author.username}** winks at **${uUser.username}**._` + ' ' + emoji.random()) + run(msg: CommandoMessage, { uUser }: any) { + return msg.say(`_**${msg.author.username}** winks at **${uUser.username}**._` + ' ' + emoji.random()) } };
\ No newline at end of file diff --git a/src/commands/server/goodbye.ts b/src/commands/server/goodbye.ts index 8a4669f..b924654 100644 --- a/src/commands/server/goodbye.ts +++ b/src/commands/server/goodbye.ts @@ -1,4 +1,5 @@ -import { Command, CommandoMessage } from 'discord.js-commando'; +import { Command, CommandoMessage, CommandoClient } from 'discord.js-commando'; +//@ts-ignore no types import emoji from 'emoji-random'; import Goodbye from '../../models/goodbye.js'; import mongo from 'mongoose'; @@ -6,7 +7,7 @@ import config from '../../config.json'; mongo.connect(config['mongodburi'], { useNewUrlParser: true, useUnifiedTopology: true }) module.exports = class GoodbyeServer extends Command { - constructor(client) { + constructor(client: CommandoClient) { super(client, { name: 'goodbye', group: 'server', @@ -34,7 +35,8 @@ module.exports = class GoodbyeServer extends Command { guildOnly: true }); } - async run(msg: CommandoMessage, { wType }) { + //@ts-ignore doesnt matter if not all code paths return a value + async run(msg: CommandoMessage, { wType }: any) { const goodbye = new Goodbye({ _id: mongo.Types.ObjectId(), username: msg.author.username, @@ -54,17 +56,24 @@ module.exports = class GoodbyeServer extends Command { } else if (guild && wType == 'remove') { await Goodbye.findOneAndDelete({ guildID: msg.guild.id }) msg.say('The current goodbye channel has been unset! ' + emoji.random()).then(mnotif => { + //@ts-ignore this exists mnotif.delete({ timeout: 2000 }) + //@ts-ignore this exists msg.delete({ timeout: 2000 }) }) } else if (!guild && wType == 'remove') { msg.reply('There is no current goodbye channel set for this guild! ' + emoji.random()).then(mnotif => { + //@ts-ignore this exists mnotif.delete({ timeout: 2000 }) + //@ts-ignore this exists msg.delete({ timeout: 2000 }) }) } else if (guild && wType == 'set') { + //@ts-ignore this exists msg.reply(`There already is a goodbye channel set! It's ${guild.channelname}! ` + emoji.random()).then(mnotif => { + //@ts-ignore this exists mnotif.delete({ timeout: 2000 }) + //@ts-ignore this exists msg.delete({ timeout: 2000 }) }) } else if (!guild && wType == 'set') { @@ -73,17 +82,20 @@ module.exports = class GoodbyeServer extends Command { .catch(err => console.log(err)) msg.reply(`The goodbye channel has been set to ${msg.channel}! ` + emoji.random()).then(mnotif => { + //@ts-ignore this exists mnotif.delete({ timeout: 2000 }) + //@ts-ignore this exists msg.delete({ timeout: 2000 }) }) } else if (!guild) { msg.reply('There is no current goodbye channel set for this guild! To set one, do `uwu!goodbye set` in the channel you want to set it in. ' + emoji.random()) } else if (guild) { + //@ts-ignore this exists msg.reply(`The current goodbye channel is ${guild.channelname}. ` + emoji.random()) } }) } else { - msg.reply('Insufficent permissions! ' + emoji.random()) + return msg.reply('Insufficent permissions! ' + emoji.random()) } } };
\ No newline at end of file diff --git a/src/commands/server/membercount.ts b/src/commands/server/membercount.ts index 7b737ee..ef1d271 100644 --- a/src/commands/server/membercount.ts +++ b/src/commands/server/membercount.ts @@ -1,8 +1,9 @@ -import { Command, CommandoMessage } from 'discord.js-commando'; +import { Command, CommandoMessage, CommandoClient } from 'discord.js-commando'; +//@ts-ignore no types import emoji from 'emoji-random'; module.exports = class MemberCountServer extends Command { - constructor(client) { + constructor(client: CommandoClient) { super(client, { name: 'membercount', aliases: ['memberc', 'mcount', 'mc'], @@ -25,6 +26,6 @@ module.exports = class MemberCountServer extends Command { }); } run(msg: CommandoMessage) { - msg.reply(`There are **${msg.guild.memberCount}** members in **${msg.guild.name}**. ` + emoji.random()); + return msg.reply(`There are **${msg.guild.memberCount}** members in **${msg.guild.name}**. ` + emoji.random()); } };
\ No newline at end of file diff --git a/src/commands/server/oldestmember.ts b/src/commands/server/oldestmember.ts index 4d5cd17..974e476 100644 --- a/src/commands/server/oldestmember.ts +++ b/src/commands/server/oldestmember.ts @@ -1,10 +1,12 @@ -import { Command, CommandoMessage } from 'discord.js-commando'; +import { Command, CommandoMessage, CommandoClient } from 'discord.js-commando'; +//@ts-ignore no types import emoji from 'emoji-random' import { formatDistance, formatRelative } from 'date-fns' +//@ts-ignore no types import { stripIndents } from 'common-tags' module.exports = class OldestMemberServer extends Command { - constructor(client) { + constructor(client: CommandoClient) { super(client, { name: 'oldestmember', aliases: [ @@ -38,13 +40,14 @@ module.exports = class OldestMemberServer extends Command { return -1 } return 0 - }) - .first()?.user - + }).first()?.user; + + // TODO: + //@ts-ignore no idea why const { createdAt } = oldest const age = formatDistance(createdAt, new Date()) const date = formatRelative(createdAt, new Date()) - msg.reply(stripIndents`${oldest.tag} is the oldest member in this server. + return msg.reply(stripIndents`${oldest?.tag} is the oldest member in this server. Their account is **${age}** old (created **${date}**).` + ' ' + emoji.random()) } };
\ No newline at end of file diff --git a/src/commands/server/poll.ts b/src/commands/server/poll.ts index eb91e5f..6230f86 100644 --- a/src/commands/server/poll.ts +++ b/src/commands/server/poll.ts @@ -1,9 +1,10 @@ -import { Command, CommandoMessage } from 'discord.js-commando'; +import { Command, CommandoMessage, CommandoClient } from 'discord.js-commando'; import { MessageEmbed } from 'discord.js'; +//@ts-ignore no types import emoji from 'emoji-random' module.exports = class PollServer extends Command { - constructor(client) { + constructor(client: CommandoClient) { super(client, { name: 'poll', group: 'server', @@ -19,21 +20,25 @@ module.exports = class PollServer extends Command { guildOnly: true }); } + //@ts-ignore this is not async run(msg: CommandoMessage) { let messageArray = msg.content.split(' ') let args = messageArray.slice(1) if (!args || args.length < 1) { - msg.reply(`No poll content was specified. ${emoji.random()}`) + return msg.reply(`No poll content was specified. ${emoji.random()}`) } else { let emb = new MessageEmbed() .setColor(0xFFCC4D) .setFooter('React to vote.') .setDescription(args.join(' ')) .setTitle(`Poll Created by ${msg.author.username} ${emoji.random()}`) - msg.say(emb).then(fMsg => { + return msg.say(emb).then(fMsg => { + //@ts-ignore yes these exist fMsg.react('✅') + //@ts-ignore yes these exist fMsg.react('❎') + //@ts-ignore yes these exist msg.delete({ timeout: 1000 }) }) } diff --git a/src/commands/server/quotemessage.ts b/src/commands/server/quotemessage.ts index 315c581..d421f68 100644 --- a/src/commands/server/quotemessage.ts +++ b/src/commands/server/quotemessage.ts @@ -1,11 +1,10 @@ -import { Command, CommandoMessage } from 'discord.js-commando'; -import emoji from 'emoji-random' +import { Command, CommandoMessage, CommandoClient } from 'discord.js-commando'; import { MessageEmbed } from 'discord.js'; -import tt from '../../utils/truncateText.js' +const tt = require('../../utils/truncateText.js') import path from 'path' module.exports = class QuoteMessageServer extends Command { - constructor(client) { + constructor(client: CommandoClient) { super(client, { name: 'quotemessage', aliases: [ @@ -33,7 +32,7 @@ module.exports = class QuoteMessageServer extends Command { ] }); } - run(msg: CommandoMessage, { mMsg }) { + run(msg: CommandoMessage, { mMsg }: any) { let emb = new MessageEmbed() .setColor(0xFFCC4D) .setTimestamp(mMsg.createdAt) @@ -61,13 +60,14 @@ module.exports = class QuoteMessageServer extends Command { const linkRegex = /https?:\/\/(?:\w+\.)?[\w-]+\.[\w]{2,3}(?:\/[\w-_.]+)+\.(?:png|jpg|jpeg|gif|webp)/; // embed (that may or may not exist) with an img in it - const imageEmbed = mMsg.embeds.find( - msgEmbed => msgEmbed.type === 'rich' && msgEmbed.image && extensions.includes(path.extname(msgEmbed.image.url)) - ) + const imageEmbed = mMsg.embeds.find((msgEmbed: { type: string; image: { url: string; }; }) => { + msgEmbed.type === 'rich' && msgEmbed.image && extensions.includes(path.extname(msgEmbed.image.url)) + }) + if (imageEmbed) messageImage = imageEmbed.image.url // uploaded img - const attachment = mMsg.attachments.find(file => extensions.includes(path.extname(file.url))) + const attachment = mMsg.attachments.find((file: { url: string; }) => extensions.includes(path.extname(file.url))) if (attachment) { messageImage = attachment.url } @@ -83,6 +83,6 @@ module.exports = class QuoteMessageServer extends Command { // if there was an img, set embed image to it if (messageImage) emb.setImage(messageImage) - msg.say(emb) + return msg.say(emb) } };
\ No newline at end of file diff --git a/src/commands/server/randommember.ts b/src/commands/server/randommember.ts index e818e61..5514561 100644 --- a/src/commands/server/randommember.ts +++ b/src/commands/server/randommember.ts @@ -1,8 +1,9 @@ -import { Command, CommandoMessage } from 'discord.js-commando'; +import { Command, CommandoMessage, CommandoClient } from 'discord.js-commando'; +//@ts-ignore no types import emoji from 'emoji-random' module.exports = class RandomMemberServer extends Command { - constructor(client) { + constructor(client: CommandoClient) { super(client, { name: 'randommember', aliases: [ @@ -27,7 +28,7 @@ module.exports = class RandomMemberServer extends Command { run(msg: CommandoMessage) { if (msg.channel.type === 'dm') { const members = [this.client.user, msg.channel.recipient]; - return msg.reply(`I choose ${members[Math.floor(Math.random() * members.length)].username}! ${emoji.random()}`); + return msg.reply(`I choose ${members[Math.floor(Math.random() * members.length)]?.username}! ${emoji.random()}`); } return msg.reply(`I choose ${msg.guild.members.cache.random().displayName}! ${emoji.random()}`); } diff --git a/src/commands/server/roleinfo.ts b/src/commands/server/roleinfo.ts index 9493734..cfd5d33 100644 --- a/src/commands/server/roleinfo.ts +++ b/src/commands/server/roleinfo.ts @@ -1,9 +1,8 @@ -import { Command, CommandoMessage } from 'discord.js-commando'; -import emoji from 'emoji-random' +import { Command, CommandoMessage, CommandoClient } from 'discord.js-commando'; import { MessageEmbed } from 'discord.js'; module.exports = class RoleInfoServer extends Command { - constructor(client) { + constructor(client: CommandoClient) { super(client, { name: 'roleinfo', aliases: [ @@ -29,7 +28,7 @@ module.exports = class RoleInfoServer extends Command { ] }); } - run(msg: CommandoMessage, { rRole }) { + run(msg: CommandoMessage, { rRole }: any) { let emb = new MessageEmbed() .setColor(0xFFCC4D) .setTitle(`${rRole.name} (${rRole.id})`) @@ -56,6 +55,6 @@ module.exports = class RoleInfoServer extends Command { value: `Use ${msg.anyUsage(`color ${rRole.hexColor}`)}` } ]) - msg.say(emb) + return msg.say(emb) } };
\ No newline at end of file diff --git a/src/commands/server/roles.ts b/src/commands/server/roles.ts index 8ec4a01..4ab14fe 100644 --- a/src/commands/server/roles.ts +++ b/src/commands/server/roles.ts @@ -1,10 +1,9 @@ -import { Command, CommandoMessage } from 'discord.js-commando'; -import emoji from 'emoji-random' +import { Command, CommandoMessage, CommandoClient } from 'discord.js-commando'; import { MessageEmbed } from 'discord.js'; -import tt from '../../utils/truncateText.js' +const tt = require('../../utils/truncateText.js') module.exports = class RolesServer extends Command { - constructor(client) { + constructor(client: CommandoClient) { super(client, { name: 'roles', aliases: [ @@ -36,6 +35,6 @@ module.exports = class RolesServer extends Command { .array() .join(', ') )) - msg.say(emb) + return msg.say(emb) } };
\ No newline at end of file diff --git a/src/commands/server/server.ts b/src/commands/server/server.ts index f488bc9..974a435 100644 --- a/src/commands/server/server.ts +++ b/src/commands/server/server.ts @@ -1,8 +1,8 @@ -import { Command, CommandoMessage } from 'discord.js-commando'; +import { Command, CommandoMessage, CommandoClient } from 'discord.js-commando'; import { MessageEmbed } from 'discord.js'; module.exports = class ServerServer extends Command { - constructor(client) { + constructor(client: CommandoClient) { super(client, { name: 'server', aliases: [ @@ -46,9 +46,9 @@ module.exports = class ServerServer extends Command { .addField('Text channels', `${msg.guild.channels.cache.filter(c => c.type === 'text').size}`, true) .addField('Voice channels', `${msg.guild.channels.cache.filter(c => c.type === 'voice').size}`, true) .addField('Guild created', `${msg.guild.createdAt}`, false) - .addField(`${this.client.user.username} joined`, `${msg.guild.members.cache.get('699473263998271489').joinedAt}`) + .addField(`${this.client.user?.username} joined`, `${msg.guild.members.cache.get('699473263998271489')?.joinedAt}`) .setColor(0xFFCC4D); - msg.say(embed); + return msg.say(embed); } };
\ No newline at end of file diff --git a/src/commands/server/welcome.ts b/src/commands/server/welcome.ts index e2a197d..68b3046 100644 --- a/src/commands/server/welcome.ts +++ b/src/commands/server/welcome.ts @@ -1,4 +1,5 @@ -import { Command, CommandoMessage } from 'discord.js-commando'; +import { Command, CommandoMessage, CommandoClient } from 'discord.js-commando'; +//@ts-ignore no types import emoji from 'emoji-random'; import Welcome from '../../models/welcome.js'; import mongo from 'mongoose'; @@ -6,7 +7,7 @@ import config from '../../config.json'; mongo.connect(config['mongodburi'], { useNewUrlParser: true, useUnifiedTopology: true }) module.exports = class WelcomeServer extends Command { - constructor(client) { + constructor(client: CommandoClient) { super(client, { name: 'welcome', group: 'server', @@ -34,7 +35,8 @@ module.exports = class WelcomeServer extends Command { guildOnly: true }); } - async run(msg: CommandoMessage, { wType }) { + //@ts-ignore doesnt matter if not all code paths return + async run(msg: CommandoMessage, { wType }: any) { const welcome = new Welcome({ _id: mongo.Types.ObjectId(), username: msg.author.username, @@ -45,26 +47,33 @@ module.exports = class WelcomeServer extends Command { channelID: msg.channel.id, time: msg.createdAt }) - const guildExist = await Welcome.findOne({ guildID: msg.guild.id }) + // const guildExist = await Welcome.findOne({ guildID: msg.guild.id }) if (msg.member.hasPermission('MANAGE_GUILD')) { Welcome.findOne({ guildID: msg.guild.id }, async (error, guild) => { if (error) { - console.log(error) + return console.log(error) } else if (guild && wType == 'remove') { await Welcome.findOneAndDelete({ guildID: msg.guild.id }) - msg.say('The current welcome channel has been unset! ' + emoji.random()).then(mnotif => { + return msg.say('The current welcome channel has been unset! ' + emoji.random()).then(mnotif => { + //@ts-ignore this exists mnotif.delete({ timeout: 2000 }) + //@ts-ignore this exists msg.delete({ timeout: 2000 }) }) } else if (!guild && wType == 'remove') { - msg.reply('There is no current welcome channel set for this guild! ' + emoji.random()).then(mnotif => { + return msg.reply('There is no current welcome channel set for this guild! ' + emoji.random()).then(mnotif => { + //@ts-ignore this exists mnotif.delete({ timeout: 2000 }) + //@ts-ignore this exists msg.delete({ timeout: 2000 }) }) } else if (guild && wType == 'set') { - msg.reply(`There already is a welcome channel set! It's ${guild.channelname}! ` + emoji.random()).then(mnotif => { + //@ts-ignore this exists + return msg.reply(`There already is a welcome channel set! It's ${guild.channelname}! ` + emoji.random()).then(mnotif => { + //@ts-ignore this exists mnotif.delete({ timeout: 2000 }) + //@ts-ignore this exists msg.delete({ timeout: 2000 }) }) } else if (!guild && wType == 'set') { @@ -72,18 +81,21 @@ module.exports = class WelcomeServer extends Command { .then(result => console.log(result)) .catch(err => console.log(err)) - msg.reply(`The welcome channel has been set to ${msg.channel}! ` + emoji.random()).then(mnotif => { + return msg.reply(`The welcome channel has been set to ${msg.channel}! ` + emoji.random()).then(mnotif => { + //@ts-ignore this exists mnotif.delete({ timeout: 2000 }) + //@ts-ignore this exists msg.delete({ timeout: 2000 }) }) } else if (!guild) { - msg.reply('There is no current welcome channel set for this guild! To set one, do `uwu!welcome set` in the channel you want to set it in. ' + emoji.random()) + return msg.reply('There is no current welcome channel set for this guild! To set one, do `uwu!welcome set` in the channel you want to set it in. ' + emoji.random()) } else if (guild) { - msg.reply(`The current welcome channel is ${guild.channelname}. ` + emoji.random()) + //@ts-ignore this exists + return msg.reply(`The current welcome channel is ${guild.channelname}. ` + emoji.random()) } }) } else { - msg.reply('Insufficent permissions! ' + emoji.random()) + return msg.reply('Insufficent permissions! ' + emoji.random()) } } };
\ No newline at end of file diff --git a/src/commands/user/age.ts b/src/commands/user/age.ts index f541d67..13ead86 100644 --- a/src/commands/user/age.ts +++ b/src/commands/user/age.ts @@ -1,10 +1,12 @@ -import { Command, CommandoMessage } from 'discord.js-commando'; +import { Command, CommandoMessage, CommandoClient } from 'discord.js-commando'; +//@ts-ignore no types import emoji from 'emoji-random' import { formatDistance, formatRelative } from 'date-fns' +//@ts-ignore no types import { stripIndents } from 'common-tags' module.exports = class AgeUser extends Command { - constructor(client) { + constructor(client: CommandoClient) { super(client, { name: 'age', aliases: [ @@ -31,10 +33,10 @@ module.exports = class AgeUser extends Command { ] }); } - async run(msg: CommandoMessage, { uUser }) { + async run(msg: CommandoMessage, { uUser }: any) { const target = uUser || msg.author const { createdAt } = target - msg.reply(stripIndents`${formatDistance(createdAt, new Date())} old. - Created on ${formatRelative(createdAt, new Date())}`) + return msg.reply(stripIndents`${formatDistance(createdAt, new Date())} old. + Created on ${formatRelative(createdAt, new Date())} ${emoji.random()}`) } };
\ No newline at end of file diff --git a/src/commands/user/id.ts b/src/commands/user/id.ts index b5d9060..a4d974d 100644 --- a/src/commands/user/id.ts +++ b/src/commands/user/id.ts @@ -1,9 +1,9 @@ -import { Command, CommandoMessage } from 'discord.js-commando'; +import { Command, CommandoMessage, CommandoClient } from 'discord.js-commando'; +//@ts-ignore no types import emoji from 'emoji-random'; -import { MessageEmbed } from 'discord.js'; module.exports = class IDUser extends Command { - constructor(client) { + constructor(client: CommandoClient) { super(client, { name: 'id', group: 'user', @@ -21,12 +21,12 @@ module.exports = class IDUser extends Command { key: 'uUser', prompt: 'Which user would you like to get the ID of?', type: 'user', - default: msg => msg.author + default: (msg: { author: any; }) => msg.author } ] }); } - run(msg: CommandoMessage, { uUser }) { - msg.reply(`**${uUser.id === msg.author.id ? 'Your' : `${uUser.username}'s`}** ID is **${uUser.id}**. ${emoji.random()}`) + run(msg: CommandoMessage, { uUser }: any) { + return msg.reply(`**${uUser.id === msg.author.id ? 'Your' : `${uUser.username}'s`}** ID is **${uUser.id}**. ${emoji.random()}`) } };
\ No newline at end of file diff --git a/src/commands/user/nickname.ts b/src/commands/user/nickname.ts index 3833f68..43c46cc 100644 --- a/src/commands/user/nickname.ts +++ b/src/commands/user/nickname.ts @@ -1,8 +1,9 @@ -import { Command, CommandoMessage } from 'discord.js-commando'; +import { Command, CommandoMessage, CommandoClient } from 'discord.js-commando'; +//@ts-ignore no types import emoji from 'emoji-random'; module.exports = class NickNameUser extends Command { - constructor(client) { + constructor(client: CommandoClient) { super(client, { name: 'nickname', aliases: ['nick', 'name'], @@ -28,8 +29,8 @@ module.exports = class NickNameUser extends Command { guildOnly: true }); } - run(msg: CommandoMessage, { userNick }) { + run(msg: CommandoMessage, { userNick }: any) { msg.member.setNickname(userNick) - msg.reply(`Your nickname has been changed to ${userNick}. ` + emoji.random()) + return msg.reply(`Your nickname has been changed to ${userNick}. ` + emoji.random()) } };
\ No newline at end of file diff --git a/src/commands/user/nitro.ts b/src/commands/user/nitro.ts index 1302a0a..a54eb38 100644 --- a/src/commands/user/nitro.ts +++ b/src/commands/user/nitro.ts @@ -1,9 +1,10 @@ -import { Command, CommandoMessage } from 'discord.js-commando'; +import { Command, CommandoMessage, CommandoClient } from 'discord.js-commando'; import { MessageEmbed } from 'discord.js'; +//@ts-ignore no types import { stripIndents } from 'common-tags' module.exports = class NitroUser extends Command { - constructor(client) { + constructor(client: CommandoClient) { super(client, { name: 'nitro', group: 'user', @@ -25,6 +26,6 @@ module.exports = class NitroUser extends Command { .setDescription(stripIndents` This message can only be viewed by users with Discord Nitro. [Lift off with Discord Nitro today](https://discordapp.com/nitro)`) - msg.say(emb) + return msg.say(emb) } };
\ No newline at end of file diff --git a/src/commands/utility/average.ts b/src/commands/utility/average.ts index 51ac9e6..233236c 100644 --- a/src/commands/utility/average.ts +++ b/src/commands/utility/average.ts @@ -1,10 +1,13 @@ -import { Command, CommandoMessage } from 'discord.js-commando'; +import { Command, CommandoMessage, CommandoClient } from 'discord.js-commando'; +//@ts-ignore no types import emoji from 'emoji-random' import { formatDistance, formatRelative } from 'date-fns' +//TODO: check if this has types +//@ts-ignore no types import { stripIndents } from 'common-tags' module.exports = class AverageUtility extends Command { - constructor(client) { + constructor(client: CommandoClient) { super(client, { name: 'average', aliases: [ @@ -34,10 +37,10 @@ module.exports = class AverageUtility extends Command { ] }); } - async run(msg: CommandoMessage, { nNum }) { + async run(msg: CommandoMessage, { nNum }: any) { // this is really a string if (nNum.length < 2) msg.reply('Please provide **2** or more numbers.') - const reducer = (accumulator, currentValue) => accumulator + currentValue - msg.reply(`The average of the specified numbers is ${nNum.reduce(reducer) / nNum.length}.` + ' ' + emoji.random()) + const reducer = (accumulator: any, currentValue: any) => accumulator + currentValue + return msg.reply(`The average of the specified numbers is ${nNum.reduce(reducer) / nNum.length}.` + ' ' + emoji.random()) } };
\ No newline at end of file diff --git a/src/commands/utility/csgoserverstatus.ts b/src/commands/utility/csgoserverstatus.ts index eba0aad..5f0cfe7 100644 --- a/src/commands/utility/csgoserverstatus.ts +++ b/src/commands/utility/csgoserverstatus.ts @@ -1,11 +1,12 @@ -import { Command, CommandoMessage } from 'discord.js-commando'; -import { MessageEmbed } from 'discord.js'; +import { Command, CommandoMessage, CommandoClient } from 'discord.js-commando'; +//@ts-ignore no types import emoji from 'emoji-random' +//@ts-ignore no @types import gamedig from 'gamedig' -import gameDigHelper from '../../utils/gameDigHelper.js' +const gameDigHelper = require('../../utils/gameDigHelper.js') module.exports = class CSGOServerStatusUtility extends Command { - constructor(client) { + constructor(client: CommandoClient) { super(client, { name: 'csgoserverstatus', aliases: [ @@ -45,33 +46,34 @@ module.exports = class CSGOServerStatusUtility extends Command { ] }); } - async run(msg: CommandoMessage, { host, port }) { + async run(msg: CommandoMessage, { host, port }: any) { try { const options = { host, - type: 'csgo' + type: 'csgo', } if (port) { + //@ts-ignore this get auto appended options.port = port } - gamedig + return gamedig .query(options) - .then(data => { + .then((data: any) => { let emb = gameDigHelper(data) emb.setColor(0xFFCC4D) emb.setThumbnail('https://steamcdn-a.akamaihd.net/steam/apps/730/header.jpg') return msg.replyEmbed(emb) }) - .catch(err => { + .catch((err: string) => { if (err === 'UDP Watchdog Timeout') return msg.reply('Server timed out, it\'s probably offline. ' + emoji.random()) console.error(err) return msg.reply('Woops, an unknown error has occured. ' + emoji.random()) }) } finally { - msg.channel.stopTyping() + return msg.channel.stopTyping() } } };
\ No newline at end of file diff --git a/src/commands/utility/fortnitestats.ts b/src/commands/utility/fortnitestats.ts index 01f1f99..8eb65c4 100644 --- a/src/commands/utility/fortnitestats.ts +++ b/src/commands/utility/fortnitestats.ts @@ -1,12 +1,13 @@ -import { Command, CommandoMessage } from 'discord.js-commando'; +import { Command, CommandoMessage, CommandoClient } from 'discord.js-commando'; import { MessageEmbed } from 'discord.js'; +//@ts-ignore to types import emoji from 'emoji-random' import axios from 'axios' import config from '../../config.json' const platforms = ['pc', 'xbl', 'psn'] module.exports = class FortniteStatsUtility extends Command { - constructor(client) { + constructor(client: CommandoClient) { super(client, { name: 'fortnitestats', aliases: [ @@ -40,7 +41,7 @@ module.exports = class FortniteStatsUtility extends Command { key: 'pPlatform', prompt: 'What platform would you like to search on.', type: 'string', - parse: platform => platform.toLowerCase(), + parse: (platform: string) => platform.toLowerCase(), oneOf: platforms }, { @@ -51,7 +52,9 @@ module.exports = class FortniteStatsUtility extends Command { ] }); } - async run(msg: CommandoMessage, { pPlatform, pUsername }) { + //TODO: + //@ts-ignore this is not async + async run(msg: CommandoMessage, { pPlatform, pUsername }: any) { try { const stats = ( await axios @@ -62,6 +65,7 @@ module.exports = class FortniteStatsUtility extends Command { console.error(err) return msg.reply('Woops, There was an error with the (https://api.fortnitetracker.com) API. ' + emoji.random()) }) + //@ts-ignore yes it does exist lmao ).data if (stats.error === 'Player Not Found') { @@ -96,7 +100,7 @@ module.exports = class FortniteStatsUtility extends Command { return msg.replyEmbed(emb); } finally { - msg.channel.stopTyping() + return msg.channel.stopTyping() } } };
\ No newline at end of file diff --git a/src/commands/utility/gmodserverstatus.ts b/src/commands/utility/gmodserverstatus.ts index cf59d4b..50c0e61 100644 --- a/src/commands/utility/gmodserverstatus.ts +++ b/src/commands/utility/gmodserverstatus.ts @@ -1,11 +1,12 @@ -import { Command, CommandoMessage } from 'discord.js-commando'; -import { MessageEmbed } from 'discord.js'; +import { Command, CommandoMessage, CommandoClient } from 'discord.js-commando'; +//@ts-ignore no types import emoji from 'emoji-random' +//@ts-ignore no types import gamedig from 'gamedig' -import gameDigHelper from '../../utils/gameDigHelper.js' +const gameDigHelper = require('../../utils/gameDigHelper.js') module.exports = class GModServerStatusUtility extends Command { - constructor(client) { + constructor(client: CommandoClient) { super(client, { name: 'gmodserverstatus', aliases: [ @@ -44,7 +45,7 @@ module.exports = class GModServerStatusUtility extends Command { ] }); } - async run(msg: CommandoMessage, { host, port }) { + async run(msg: CommandoMessage, { host, port }: any) { try { const options = { host, @@ -52,25 +53,26 @@ module.exports = class GModServerStatusUtility extends Command { } if (port) { + //@ts-ignore added auto options.port = port } - gamedig + return gamedig .query(options) - .then(data => { + .then((data: any) => { let emb = gameDigHelper(data) emb.setColor(0xFFCC4D) emb.setThumbnail('https://steamcdn-a.akamaihd.net/steam/apps/4000/header.jpg') return msg.replyEmbed(emb) }) - .catch(err => { + .catch((err: string) => { if (err === 'UDP Watchdog Timeout') return msg.reply('Server timed out, it\'s probably offline. ' + emoji.random()) console.error(err) return msg.reply('Woops, an unknown error has occured. ' + emoji.random()) }) } finally { - msg.channel.stopTyping() + return msg.channel.stopTyping() } } };
\ No newline at end of file diff --git a/src/commands/utility/google.ts b/src/commands/utility/google.ts index 68185cc..2c84bd5 100644 --- a/src/commands/utility/google.ts +++ b/src/commands/utility/google.ts @@ -1,9 +1,8 @@ -import { Command, CommandoMessage } from 'discord.js-commando'; -import emoji from 'emoji-random'; +import { Command, CommandoMessage, CommandoClient } from 'discord.js-commando'; import { MessageEmbed } from 'discord.js'; module.exports = class GoogleUtility extends Command { - constructor(client) { + constructor(client: CommandoClient) { super(client, { name: 'google', group: 'utility', @@ -25,11 +24,11 @@ module.exports = class GoogleUtility extends Command { ] }); } - async run(msg: CommandoMessage, { gTerm }) { + run(msg: CommandoMessage, { gTerm }: any) { let embed = new MessageEmbed() .setTitle('**Google Search**') .setColor(0xFFCC4D) .addField('Searching Google for`' + gTerm + '`...', `[Click Here](https://google.com/search?q=${gTerm.replace(/ /g, '%20')})`) - msg.say(embed) + return msg.say(embed) } };
\ No newline at end of file diff --git a/src/commands/utility/iss.ts b/src/commands/utility/iss.ts index d49b499..3bb4ff6 100644 --- a/src/commands/utility/iss.ts +++ b/src/commands/utility/iss.ts @@ -1,9 +1,10 @@ -import { Command, CommandoMessage } from 'discord.js-commando'; +import { Command, CommandoMessage, CommandoClient } from 'discord.js-commando'; +//@ts-ignore no types import emoji from 'emoji-random'; import request from 'node-superfetch' module.exports = class ISSUtility extends Command { - constructor(client) { + constructor(client: CommandoClient) { super(client, { name: 'iss', aliases: ['internationalspacestation', 'international-space-station'], @@ -22,6 +23,7 @@ module.exports = class ISSUtility extends Command { async run(msg: CommandoMessage) { try { const { body } = await request.get('http://api.open-notify.org/iss-now.json') + //@ts-ignore this exists const pos = body.iss_position return msg.reply(`The ISS is currentaly at **${pos.latitude}, ${pos.longitude}**. ${emoji.random()}`) } catch (err) { diff --git a/src/commands/utility/romannumeral.ts b/src/commands/utility/romannumeral.ts index 8dcc331..39b9320 100644 --- a/src/commands/utility/romannumeral.ts +++ b/src/commands/utility/romannumeral.ts @@ -1,9 +1,11 @@ -import { Command, CommandoMessage } from 'discord.js-commando'; +import { Command, CommandoMessage, CommandoClient } from 'discord.js-commando'; +//@ts-ignore no types import emoji from 'emoji-random' +//@ts-ignore no types import romanize from 'romanize' module.exports = class RomanNumeralUtility extends Command { - constructor(client) { + constructor(client: CommandoClient) { super(client, { name: 'romannumeral', aliases: [ @@ -31,12 +33,12 @@ module.exports = class RomanNumeralUtility extends Command { ] }); } - run(msg: CommandoMessage, { nNum }) { + run(msg: CommandoMessage, { nNum }: any) { if (nNum === parseInt(nNum, 10)) { msg.reply(romanize(nNum)) } - const back = value => { + const back = (value: string) => { let res = 0 const decimal = [1000, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, 4, 1] @@ -50,6 +52,6 @@ module.exports = class RomanNumeralUtility extends Command { return res } - msg.reply(back(nNum) + ' ' + emoji.random()) + return msg.reply(back(nNum) + ' ' + emoji.random()) } };
\ No newline at end of file diff --git a/src/commands/utility/rustserverstatus.ts b/src/commands/utility/rustserverstatus.ts index f7f58bc..dd91487 100644 --- a/src/commands/utility/rustserverstatus.ts +++ b/src/commands/utility/rustserverstatus.ts @@ -1,11 +1,12 @@ -import { Command, CommandoMessage } from 'discord.js-commando'; -import { MessageEmbed } from 'discord.js'; +import { Command, CommandoMessage, CommandoClient } from 'discord.js-commando'; +//@ts-ignore no types import emoji from 'emoji-random' +//@ts-ignore no types import gamedig from 'gamedig' -import gameDigHelper from '../../utils/gameDigHelper.js' +const gameDigHelper = require('../../utils/gameDigHelper.js') module.exports = class RustServerStatusUtility extends Command { - constructor(client) { + constructor(client: CommandoClient) { super(client, { name: 'rustserverstatus', aliases: [ @@ -43,7 +44,7 @@ module.exports = class RustServerStatusUtility extends Command { ] }); } - async run(msg: CommandoMessage, { host, port }) { + run(msg: CommandoMessage, { host, port }: any) { try { const options = { host, @@ -51,26 +52,27 @@ module.exports = class RustServerStatusUtility extends Command { } if (port) { + //@ts-ignore gets added options.port = port } - gamedig + return gamedig .query(options) - .then(data => { + .then((data: any) => { msg.replyEmbed( gameDigHelper(data) .setThumbnail('https://steamcdn-a.akamaihd.net/steam/apps/252490/header.jpg') .setColor(0xFFCC4D) ) }) - .catch(err => { + .catch((err: string) => { if (err === 'UDP Watchdog Timeout') return msg.reply('Server timed out, it\'s probably offline. ' + emoji.random()) console.error(err) return msg.reply('Woops, an unknown error has occured. ' + emoji.random()) }) } finally { - msg.channel.stopTyping() + return msg.channel.stopTyping() } } };
\ No newline at end of file diff --git a/src/commands/utility/starboundserverstatus.ts b/src/commands/utility/starboundserverstatus.ts index eaddfc8..0d8e319 100644 --- a/src/commands/utility/starboundserverstatus.ts +++ b/src/commands/utility/starboundserverstatus.ts @@ -1,11 +1,13 @@ -import { Command, CommandoMessage } from 'discord.js-commando'; -import { MessageEmbed, Message } from 'discord.js'; +import { Command, CommandoMessage, CommandoClient } from 'discord.js-commando'; +import { MessageEmbed } from 'discord.js'; +//@ts-ignore no types import emoji from 'emoji-random' +//@ts-ignore no types import gamedig from 'gamedig' -import gameDigHelper from '../../utils/gameDigHelper.js' +const gameDigHelper = require('../../utils/gameDigHelper.js') module.exports = class StarboundServerStatusUtility extends Command { - constructor(client) { + constructor(client: CommandoClient) { super(client, { name: 'starboundserverstatus', aliases: [ @@ -43,7 +45,7 @@ module.exports = class StarboundServerStatusUtility extends Command { ] }); } - async run(msg: CommandoMessage, { host, port }) { + run(msg: CommandoMessage, { host, port }: any) { try { const options = { host, @@ -51,12 +53,14 @@ module.exports = class StarboundServerStatusUtility extends Command { } if (port) { + //@ts-ignore added auto options.port = port } - gamedig + return gamedig .query(options) - .then(data => { + // this is auto'd so might not be good + .then((data: { raw: { numplayers: any; }; maxplayers: any; name: any; query: { duration: any; address: any; port: any; }; password: any; }) => { const curr = data.raw.numplayers const max = data.maxplayers @@ -82,14 +86,14 @@ module.exports = class StarboundServerStatusUtility extends Command { .setColor(0xFFCC4D) ) }) - .catch(err => { + .catch((err: string) => { if (err === 'UDP Watchdog Timeout') return msg.reply('Server timed out, it\'s probably offline. ' + emoji.random()) console.error(err) return msg.reply('Woops, an unknown error has occured. ' + emoji.random()) }) } finally { - msg.channel.stopTyping() + return msg.channel.stopTyping() } } };
\ No newline at end of file diff --git a/src/commands/utility/time.ts b/src/commands/utility/time.ts index 5bcf892..78fe391 100644 --- a/src/commands/utility/time.ts +++ b/src/commands/utility/time.ts @@ -1,8 +1,9 @@ -import { Command, CommandoMessage } from 'discord.js-commando'; +import { Command, CommandoMessage, CommandoClient } from 'discord.js-commando'; +//@ts-ignore no types import emoji from 'emoji-random' module.exports = class TimeUtility extends Command { - constructor(client) { + constructor(client: CommandoClient) { super(client, { name: 'time', group: 'utility', @@ -18,6 +19,6 @@ module.exports = class TimeUtility extends Command { }); } run(msg: CommandoMessage) { - msg.reply(`The time is currently **${new Date()}**.`) + return msg.reply(`The time is currently **${new Date()}**. ${emoji.random()}`) } };
\ No newline at end of file diff --git a/src/commands/utility/whois.ts b/src/commands/utility/whois.ts index 95c954c..d699e39 100644 --- a/src/commands/utility/whois.ts +++ b/src/commands/utility/whois.ts @@ -1,9 +1,11 @@ -import { Command, CommandoMessage } from 'discord.js-commando'; +import { Command, CommandoMessage, CommandoClient } from 'discord.js-commando'; +//@ts-ignore no types import emoji from 'emoji-random'; +//@ts-ignore no types import whois from 'whois'; module.exports = class WhoIsUtility extends Command { - constructor(client) { + constructor(client: CommandoClient) { super(client, { name: 'whois', group: 'utility', @@ -25,12 +27,13 @@ module.exports = class WhoIsUtility extends Command { ] }); } - async run(msg: CommandoMessage, { host }) { - whois.lookup(host, (err, data) => { + run(msg: CommandoMessage, { host }: any) { + //@ts-ignore doesnt matter if none is returned + return whois.lookup(host, (err: any, data: any) => { if (err) return msg.reply(`Woops, there was an error getting that information for you! Please re-check your specified host/ domain. ${emoji.random()}`); msg.reply(`Check your DMs for the whois! ${emoji.random()}`); - msg.author.send(data, { split: true }); + return msg.author.send(data, { split: true }); }); } };
\ No newline at end of file diff --git a/src/commands/voice/abee.ts b/src/commands/voice/abee.ts index 628909c..cca429f 100644 --- a/src/commands/voice/abee.ts +++ b/src/commands/voice/abee.ts @@ -1,14 +1,16 @@ import ytdl from 'ytdl-core'; -import { Command, CommandoMessage } from 'discord.js-commando'; +import { Command, CommandoMessage, CommandoClient } from 'discord.js-commando'; import { MessageEmbed } from 'discord.js'; +//@ts-ignore no types import Youtube from 'simple-youtube-api'; //const { youtubeAPI } = require('../../config.json'); import config from '../../config.json'; const youtube = new Youtube(config['yt-api-key']); +//@ts-ignore no types import emoji from 'emoji-random'; module.exports = class ABeeVoice extends Command { - constructor(client) { + constructor(client: CommandoClient) { super(client, { name: 'abee', aliases: ['a-bee'], diff --git a/src/commands/zerotwo/darling.ts b/src/commands/zerotwo/darling.ts index 505df19..2f52ed4 100644 --- a/src/commands/zerotwo/darling.ts +++ b/src/commands/zerotwo/darling.ts @@ -1,4 +1,5 @@ -import { Command, CommandoMessage } from 'discord.js-commando'; +import { Command, CommandoMessage, CommandoClient } from 'discord.js-commando'; +//@ts-ignore no @types import emoji from 'emoji-random'; import Darling from '../../models/darling.js'; import mongo from 'mongoose'; @@ -6,7 +7,7 @@ import config from '../../config.json'; mongo.connect(config['mongodburi'], { useNewUrlParser: true, useUnifiedTopology: true }) module.exports = class DarlingZeroTwo extends Command { - constructor(client) { + constructor(client: CommandoClient) { super(client, { name: 'darling', group: 'zerotwo', @@ -34,7 +35,9 @@ module.exports = class DarlingZeroTwo extends Command { guildOnly: true }); } - async run(msg: CommandoMessage, { darlingName }) { + //TODO: this + //@ts-ignore this is not asnc + async run(msg: CommandoMessage, { darlingName }: any) { // this is actually a string const darling = new Darling({ _id: mongo.Types.ObjectId(), username: msg.author.username, @@ -47,20 +50,20 @@ module.exports = class DarlingZeroTwo extends Command { Darling.findOne({ guildID: msg.guild.id }, async (error, guild) => { if (error) { - console.log(error) + return console.log(error) } else if (guild && darlingName == 'remove') { // @ts-ignore linting error shows that channelID doesnt exist when it does if (msg.author.id == guild.userID || msg.author.id == msg.guild.owner.id) { await Darling.findOneAndDelete({ guildID: msg.guild.id }) - msg.say('The current darling has been removed. ' + emoji.random()) + return msg.say('The current darling has been removed. ' + emoji.random()) } else { - msg.reply('Only my darling or the guild owner can remove the current darling. ' + emoji.random()) + return msg.reply('Only my darling or the guild owner can remove the current darling. ' + emoji.random()) } } else if (!guild && darlingName == 'remove') { - msg.reply('There is no darling set in this server. ' + emoji.random()) + return msg.reply('There is no darling set in this server. ' + emoji.random()) } else if (guild && darlingName == 'set') { // @ts-ignore linting error shows that channelID doesnt exist when it does - msg.reply(`I already have a darling! It\'s <@${guild.userID}>! To set a new darling, either the current darling or the guild owner has to do \`uwu!darling remove\`. ` + emoji.random()) + return msg.reply(`I already have a darling! It\'s <@${guild.userID}>! To set a new darling, either the current darling or the guild owner has to do \`uwu!darling remove\`. ` + emoji.random()) } else if (!guild && darlingName == 'set') { await darling.save() .then(result => console.log(result)) @@ -72,12 +75,12 @@ module.exports = class DarlingZeroTwo extends Command { 'Wow, your taste makes my heart race. It bites and lingers... The taste of danger. You are now my darling!' ] let quoteNum = quotes[Math.floor(Math.random() * quotes.length)] - msg.reply(quoteNum) + return msg.reply(quoteNum) } else if (!guild) { - msg.reply('I haven\'t found my darling yet! To set one, do `uwu!darling set`. ' + emoji.random()) + return msg.reply('I haven\'t found my darling yet! To set one, do `uwu!darling set`. ' + emoji.random()) } else if (guild) { // @ts-ignore linting error shows that channelID doesnt exist when it does - msg.reply(`My darling is <@${guild.userID}>. ` + emoji.random()) + return msg.reply(`My darling is <@${guild.userID}>. ` + emoji.random()) } }) diff --git a/src/commands/zerotwo/douse.ts b/src/commands/zerotwo/douse.ts index 5fc21af..d9cdca3 100644 --- a/src/commands/zerotwo/douse.ts +++ b/src/commands/zerotwo/douse.ts @@ -1,8 +1,8 @@ -import { Command, CommandoMessage } from 'discord.js-commando'; +import { Command, CommandoMessage, CommandoClient } from 'discord.js-commando'; import { MessageEmbed } from 'discord.js'; module.exports = class DouseZeroTwo extends Command { - constructor(client) { + constructor(client: CommandoClient) { super(client, { name: 'douse', group: 'zerotwo', @@ -23,6 +23,6 @@ module.exports = class DouseZeroTwo extends Command { let emb = new MessageEmbed() .setColor(0xFFD0DF) .setImage('https://i.pinimg.com/originals/6a/c8/26/6ac826e3d0cbd64eb4f42c12a73fcdb8.gif') - msg.say(emb) + return msg.say(emb) } };
\ No newline at end of file diff --git a/src/commands/zerotwo/zerotwo.ts b/src/commands/zerotwo/zerotwo.ts index 84a465d..ba9602a 100644 --- a/src/commands/zerotwo/zerotwo.ts +++ b/src/commands/zerotwo/zerotwo.ts @@ -1,9 +1,9 @@ -import { Command, CommandoMessage } from 'discord.js-commando'; +import { Command, CommandoMessage, CommandoClient } from 'discord.js-commando'; // @ts-ignore no types import emoji from 'emoji-random'; module.exports = class ZeroTwoZeroTwo extends Command { - constructor(client) { + constructor(client: CommandoClient) { super(client, { name: 'zerotwo', group: 'zerotwo', @@ -21,6 +21,6 @@ module.exports = class ZeroTwoZeroTwo extends Command { }); } run(msg: CommandoMessage) { - msg.reply(`Zero Two is the best waifu of all, literally no one else can compare. Unironically she is the best waifu of all time. Literally praise her. This is not a joke she is literally the best. ${emoji.random()}`) + return msg.reply(`Zero Two is the best waifu of all, literally no one else can compare. Unironically she is the best waifu of all time. Literally praise her. This is not a joke she is literally the best. ${emoji.random()}`) } };
\ No newline at end of file |