summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
author8cy <[email protected]>2020-06-27 22:52:54 -0700
committer8cy <[email protected]>2020-06-27 22:52:54 -0700
commit80951013e391aab140800e4f386867e6c391553f (patch)
tree3d7101237ef1cd8d6fe2a2fab751a2dc55ae7d84 /src
parentmore config shit (diff)
downloaddep-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')
-rw-r--r--src/bot.ts9
-rw-r--r--src/commands/animals/bunny.ts9
-rw-r--r--src/commands/animals/cat.ts9
-rw-r--r--src/commands/animals/cow.ts7
-rw-r--r--src/commands/animals/dog.ts9
-rw-r--r--src/commands/animals/duck.ts9
-rw-r--r--src/commands/animals/fox.ts9
-rw-r--r--src/commands/animals/owl.ts9
-rw-r--r--src/commands/anime/uwufy.ts9
-rw-r--r--src/commands/anime/waifu.ts7
-rw-r--r--src/commands/crypto/btc.ts11
-rw-r--r--src/commands/crypto/btcchange.ts21
-rw-r--r--src/commands/crypto/securitykey.ts7
-rw-r--r--src/commands/minecraft/getbody.ts8
-rw-r--r--src/commands/minecraft/getface.ts8
-rw-r--r--src/commands/minecraft/gethead.ts8
-rw-r--r--src/commands/minecraft/getminime.ts10
-rw-r--r--src/commands/minecraft/getskin.ts8
-rw-r--r--src/commands/minecraft/minecraftserverstatus.ts8
-rw-r--r--src/commands/moderation/addrole.ts9
-rw-r--r--src/commands/moderation/ban.ts17
-rw-r--r--src/commands/moderation/clear.ts31
-rw-r--r--src/commands/moderation/kick.ts18
-rw-r--r--src/commands/moderation/removerole.ts10
-rw-r--r--src/commands/nsfw/danbooru.ts16
-rw-r--r--src/commands/nsfw/gelbooru.ts17
-rw-r--r--src/commands/nsfw/rule34.ts13
-rw-r--r--src/commands/roleplay/blush.ts9
-rw-r--r--src/commands/roleplay/celebrate.ts7
-rw-r--r--src/commands/roleplay/eat.ts7
-rw-r--r--src/commands/roleplay/fistbump.ts9
-rw-r--r--src/commands/roleplay/highfive.ts9
-rw-r--r--src/commands/roleplay/holdhands.ts9
-rw-r--r--src/commands/roleplay/hug.ts9
-rw-r--r--src/commands/roleplay/inhale.ts9
-rw-r--r--src/commands/roleplay/kill.ts9
-rw-r--r--src/commands/roleplay/kiss.ts9
-rw-r--r--src/commands/roleplay/pat.ts9
-rw-r--r--src/commands/roleplay/poke.ts9
-rw-r--r--src/commands/roleplay/punch.ts9
-rw-r--r--src/commands/roleplay/slap.ts9
-rw-r--r--src/commands/roleplay/sleep.ts7
-rw-r--r--src/commands/roleplay/wakeup.ts7
-rw-r--r--src/commands/roleplay/wave.ts9
-rw-r--r--src/commands/roleplay/wink.ts9
-rw-r--r--src/commands/server/goodbye.ts20
-rw-r--r--src/commands/server/membercount.ts7
-rw-r--r--src/commands/server/oldestmember.ts15
-rw-r--r--src/commands/server/poll.ts13
-rw-r--r--src/commands/server/quotemessage.ts20
-rw-r--r--src/commands/server/randommember.ts7
-rw-r--r--src/commands/server/roleinfo.ts9
-rw-r--r--src/commands/server/roles.ts9
-rw-r--r--src/commands/server/server.ts8
-rw-r--r--src/commands/server/welcome.ts36
-rw-r--r--src/commands/user/age.ts12
-rw-r--r--src/commands/user/id.ts12
-rw-r--r--src/commands/user/nickname.ts9
-rw-r--r--src/commands/user/nitro.ts7
-rw-r--r--src/commands/utility/average.ts13
-rw-r--r--src/commands/utility/csgoserverstatus.ts22
-rw-r--r--src/commands/utility/fortnitestats.ts14
-rw-r--r--src/commands/utility/gmodserverstatus.ts20
-rw-r--r--src/commands/utility/google.ts9
-rw-r--r--src/commands/utility/iss.ts6
-rw-r--r--src/commands/utility/romannumeral.ts12
-rw-r--r--src/commands/utility/rustserverstatus.ts20
-rw-r--r--src/commands/utility/starboundserverstatus.ts22
-rw-r--r--src/commands/utility/time.ts7
-rw-r--r--src/commands/utility/whois.ts13
-rw-r--r--src/commands/voice/abee.ts6
-rw-r--r--src/commands/zerotwo/darling.ts25
-rw-r--r--src/commands/zerotwo/douse.ts6
-rw-r--r--src/commands/zerotwo/zerotwo.ts6
-rw-r--r--src/models/Command.ts7
-rw-r--r--src/models/MusicGuild.ts5
-rw-r--r--src/models/commands/Subreddit.ts24
-rw-r--r--src/server.ts7
-rw-r--r--src/types/image.ts13
-rw-r--r--src/types/month.ts8
-rw-r--r--src/utils/Canvas.ts2
-rw-r--r--src/utils/Util.ts46
-rw-r--r--src/utils/gameDigHelper.ts5
-rw-r--r--src/utils/genCmdURL.ts2
-rw-r--r--src/utils/simpleFormat.ts2
-rw-r--r--src/utils/stripWebhookURL.ts3
-rw-r--r--src/utils/truncateText.ts2
-rw-r--r--src/utils/wait.ts2
-rw-r--r--src/utils/winPercentage.ts2
89 files changed, 574 insertions, 401 deletions
diff --git a/src/bot.ts b/src/bot.ts
index 9e89b72..5ab0578 100644
--- a/src/bot.ts
+++ b/src/bot.ts
@@ -1,13 +1,12 @@
import config from './config.json';
import { CommandoClient } from 'discord.js-commando';
-// @ts-ignore no default import
//import WS from './server';
import Welcome from './models/welcome.js';
import Goodbye from './models/goodbye.js';
import mongoose from 'mongoose';
mongoose.connect(config['mongodburi'], { useNewUrlParser: true, useUnifiedTopology: true })
import path from 'path';
-// @ts-ignore emoji-random doesnt have types
+// @ts-ignore emoji-random doesn't have types
import emoji from 'emoji-random';
import { MessageEmbed } from 'discord.js';
require('./models/MusicGuild.js')
@@ -127,9 +126,11 @@ client.on('guildMemberRemove', member => {
client.on('message', async msg => {
const msgContent = msg.content.toLowerCase();
function prefixCheck() {
- if (msgContent.startsWith('uwu!')) {
+ // shorthand ? : if else doesn't work for some reason
+ if (msgContent.startsWith('uwu!'))
return true;
- }
+ else
+ return false;
}
if (prefixCheck()) {
if (msg.channel.type == 'dm') {
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
diff --git a/src/models/Command.ts b/src/models/Command.ts
index 9a304a8..b3fdea9 100644
--- a/src/models/Command.ts
+++ b/src/models/Command.ts
@@ -1,11 +1,14 @@
-import { Command } from 'discord.js-commando';
+import { Command, CommandoClient, CommandInfo } from 'discord.js-commando';
module.exports = class UwufierCommand extends Command {
- constructor(client, info) {
+ credit: any;
+ constructor(client: CommandoClient, info: CommandInfo) {
super(client, info);
this.argsSingleQuotes = info.argsSingleQuotes || false;
this.throttling = info.throttling || { usages: 1, duration: 2 };
+ // TODO:
+ // @ts-ignore
this.credit = info.credit || [];
this.credit.push({
name: 'Sin',
diff --git a/src/models/MusicGuild.ts b/src/models/MusicGuild.ts
index f425fe2..7486cf6 100644
--- a/src/models/MusicGuild.ts
+++ b/src/models/MusicGuild.ts
@@ -1,7 +1,8 @@
-import { Structures } from 'discord.js';
+import { Structures, Client } from 'discord.js';
export = Structures.extend('Guild', Guild => {
class MusicGuild extends Guild {
- constructor(client, data) {
+ musicData: { queue: []; isPlaying: boolean; volume: number; songDispatcher: any; };
+ constructor(client: Client, data: object) {
super(client, data);
this.musicData = {
queue: [],
diff --git a/src/models/commands/Subreddit.ts b/src/models/commands/Subreddit.ts
index ff58a71..ea6a9fa 100644
--- a/src/models/commands/Subreddit.ts
+++ b/src/models/commands/Subreddit.ts
@@ -1,10 +1,15 @@
import { CommandoMessage } from 'discord.js-commando';
-import Command from '../Command.js'
+const Command = require('../Command.js')
import request from 'node-superfetch'
+//@ts-ignore no @types for this package
import emoji from 'emoji-random'
module.exports = class SubredditCommand extends Command {
- constructor(client, info) {
+ subreddit: any;
+ postType: any[] | null;
+ getIcon: boolean;
+ credit: any;
+ constructor(client: any, info: { subreddit: any; postType: any; getIcon: boolean; }) {
super(client, info);
this.subreddit = info.subreddit;
@@ -18,12 +23,15 @@ module.exports = class SubredditCommand extends Command {
});
}
- async run(msg: CommandoMessage, { subreddit }, fromPattern) {
+ async run(msg: CommandoMessage, { subreddit }: any, fromPattern: any) {
if (fromPattern) subreddit = msg.patternMatches[1];
if (!subreddit) subreddit = typeof this.subreddit === 'function' ? this.subreddit() : this.subreddit;
try {
+ //@ts-ignore no idea why this isnt in the commando libs
const post = await this.random(subreddit, msg.channel.nsfw);
if (!post) return msg.reply('Could not find any results. ' + emoji.random());
+ // TODO:
+ //@ts-ignore
return msg.say(this.generateText(post.post, post.origin, post.icon));
} catch (err) {
if (err.status === 403) return msg.reply('This subreddit is private. ' + emoji.random());
@@ -36,12 +44,16 @@ module.exports = class SubredditCommand extends Command {
throw new Error('The generateText method is required.');
}
- async random(subreddit, nsfw) {
+ async random(subreddit: any, nsfw: any) {
let icon = null;
const { body } = await request
.get(`https://www.reddit.com/r/${subreddit}/hot.json`)
+ // TODO:
+ //@ts-ignore
.query({ limit: 100 });
+ //@ts-ignore yes it does
if (!body.data.children.length) return null;
+ //@ts-ignore yes it does
const posts = body.data.children.filter(post => {
if (!post.data) return false;
if (!nsfw && post.data.over_18) return false;
@@ -56,9 +68,11 @@ module.exports = class SubredditCommand extends Command {
};
}
- async fetchIcon(subreddit) {
+ async fetchIcon(subreddit: any) {
const { body } = await request.get(`https://www.reddit.com/r/${subreddit}/about.json`);
+ //@ts-ignore yes it does
if (!body.data.icon_img && !body.data.community_icon) return 'https://i.imgur.com/DSBOK0P.png';
+ //@ts-ignore yes it does
return body.data.icon_img || body.data.community_icon;
}
}; \ No newline at end of file
diff --git a/src/server.ts b/src/server.ts
index 151d55f..11576f1 100644
--- a/src/server.ts
+++ b/src/server.ts
@@ -1,8 +1,13 @@
+//@ts-nocheck //TODO: this
+
import express from 'express';
import bodyParser from 'body-parser';
class WebSocket {
- constructor(port, client) {
+ client: any;
+ app: any;
+ server: any;
+ constructor(port: any, client: any) {
this.client = client;
this.app = express()
diff --git a/src/types/image.ts b/src/types/image.ts
index d872c44..27ed336 100644
--- a/src/types/image.ts
+++ b/src/types/image.ts
@@ -1,16 +1,18 @@
-import { ArgumentType } from 'discord.js-commando';
+import { ArgumentType, CommandoClient, CommandoMessage, Argument } from 'discord.js-commando';
const fileTypeRe = /\.(jpe?g|png|gif)$/i;
import request from 'node-superfetch';
module.exports = class ImageArgumentType extends ArgumentType {
- constructor(client) {
+ constructor(client: CommandoClient) {
super(client, 'image');
}
- async validate(value, msg, arg) {
+ //@ts-ignore
+ async validate(value: any, msg: CommandoMessage, arg: Argument) {
const attachment = msg.attachments.first();
if (attachment) {
if (!attachment.height || !attachment.width) return false;
if (attachment.size > 8e+6) return 'Please provide an image under 8 MB.';
+ //@ts-ignore type undefined is not assignable to type whatever
if (!fileTypeRe.test(attachment.name)) return 'Please only send PNG, JPG, or GIF format images.';
return true;
}
@@ -24,14 +26,15 @@ module.exports = class ImageArgumentType extends ArgumentType {
}
return this.client.registry.types.get('user')?.validate(value, msg, arg);
}
- async parse(value, msg, arg) {
+ async parse(value: any, msg: CommandoMessage, arg: Argument) {
const attachment = msg.attachments.first();
if (attachment) return attachment.url;
if (fileTypeRe.test(value.toLowerCase())) return value;
const user = await this.client.registry.types.get('user')?.parse(value, msg, arg);
return user.displayAvatarURL({ format: 'png', size: 512 });
}
- isEmpty(value, msg, arg) {
+ //@ts-ignore
+ isEmpty(value: any, msg: CommandoMessage, arg: Argument) {
if (msg.attachments.size) return false;
return this.client.registry.types.get('user')?.isEmpty(value, msg, arg);
}
diff --git a/src/types/month.ts b/src/types/month.ts
index 6e85d8f..fdb5333 100644
--- a/src/types/month.ts
+++ b/src/types/month.ts
@@ -1,19 +1,19 @@
-import { ArgumentType } from 'discord.js-commando';
+import { ArgumentType, CommandoClient } from 'discord.js-commando';
import months from '../assets/json/month.json'
module.exports = class MonthArgumentType extends ArgumentType {
- constructor(client) {
+ constructor(client: CommandoClient) {
super(client, 'month');
}
- validate(value) {
+ validate(value: string) {
const num = Number.parseInt(value, 10);
if (num > 0 && num < 13) return true;
if (months.includes(value.toLowerCase())) return true;
return false;
}
- parse(value) {
+ parse(value: string) {
const num = Number.parseInt(value, 10);
if (!Number.isNaN(num)) return num;
return months.indexOf(value.toLowerCase()) + 1;
diff --git a/src/utils/Canvas.ts b/src/utils/Canvas.ts
index 4cbcac6..23ae558 100644
--- a/src/utils/Canvas.ts
+++ b/src/utils/Canvas.ts
@@ -1,3 +1,5 @@
+// TODO: all this
+//@ts-nocheck
import { createCanvas } from 'canvas'
module.exports = class CanvasUtil {
diff --git a/src/utils/Util.ts b/src/utils/Util.ts
index 6e00d04..4ad20a3 100644
--- a/src/utils/Util.ts
+++ b/src/utils/Util.ts
@@ -3,11 +3,12 @@ const yes = ['yes', 'y', 'ye', 'yeah', 'yup', 'yea', 'ya', 'hai', 'si', 'sí', '
const no = ['no', 'n', 'nah', 'nope', 'nop', 'iie', 'いいえ', 'non', 'fuck off'];
module.exports = class Util {
- static delay(ms) {
+ static delay(ms: number) {
return new Promise(resolve => setTimeout(resolve, ms));
}
- static shuffle(array) {
+ // TODO: maybe infer this
+ static shuffle(array: any) {
const arr = array.slice(0);
for (let i = arr.length - 1; i >= 0; i--) {
const j = Math.floor(Math.random() * (i + 1));
@@ -18,22 +19,22 @@ module.exports = class Util {
return arr;
}
- static list(arr, conj = 'and') {
+ static list(arr: any[], conj = 'and') {
const len = arr.length;
if (len === 0) return '';
if (len === 1) return arr[0];
return `${arr.slice(0, -1).join(', ')}${len > 1 ? `${len > 2 ? ',' : ''} ${conj} ` : ''}${arr.slice(-1)}`;
}
- static shorten(text, maxLen = 2000) {
+ static shorten(text: string, maxLen = 2000) {
return text.length > maxLen ? `${text.substr(0, maxLen - 3)}...` : text;
}
- static randomRange(min, max) {
+ static randomRange(min: number, max: number) {
return Math.floor(Math.random() * (max - min + 1)) + min;
}
- static trimArray(arr, maxLen = 10) {
+ static trimArray(arr: string[], maxLen = 10) {
if (arr.length > maxLen) {
const len = arr.length - maxLen;
arr = arr.slice(0, maxLen);
@@ -42,9 +43,9 @@ module.exports = class Util {
return arr;
}
- static removeDuplicates(arr) {
+ static removeDuplicates(arr: string | any[]) {
if (arr.length === 0 || arr.length === 1) return arr;
- const newArr = [];
+ const newArr: any[] = [];
for (let i = 0; i < arr.length; i++) {
if (newArr.includes(arr[i])) continue;
newArr.push(arr[i]);
@@ -52,42 +53,45 @@ module.exports = class Util {
return newArr;
}
- static sortByName(arr, prop) {
+ static sortByName(arr: any[], prop: string | number) {
return arr.sort((a, b) => {
if (prop) return a[prop].toLowerCase() > b[prop].toLowerCase() ? 1 : -1;
return a.toLowerCase() > b.toLowerCase() ? 1 : -1;
});
}
- static firstUpperCase(text, split = ' ') {
+ static firstUpperCase(text: string, split = ' ') {
return text.split(split).map(word => `${word.charAt(0).toUpperCase()}${word.slice(1)}`).join(' ');
}
- static formatNumber(number, minimumFractionDigits = 0) {
+ static formatNumber(number: string, minimumFractionDigits = 0) {
return Number.parseFloat(number).toLocaleString(undefined, {
minimumFractionDigits,
maximumFractionDigits: 2
});
}
- static base64(text, mode = 'encode') {
+ //TODO: maybe infer this
+ static base64(text: any, mode = 'encode') {
if (mode === 'encode') return Buffer.from(text).toString('base64');
if (mode === 'decode') return Buffer.from(text, 'base64').toString('utf8') || null;
throw new TypeError(`${mode} is not a supported base64 mode.`);
}
- static hash(text, algorithm) {
+ //TODO: maybe infer this
+ static hash(text: any, algorithm: any) {
return crypto.createHash(algorithm).update(text).digest('hex');
}
- static streamToArray(stream) {
+ //TODO: maybe infer this
+ static streamToArray(stream: any) {
if (!stream.readable) return Promise.resolve([]);
return new Promise((resolve, reject) => {
- const array = [];
- function onData(data) {
+ const array: any = [];
+ function onData(data: any) {
array.push(data);
}
- function onEnd(error) {
+ function onEnd(error: any) {
if (error) reject(error);
else resolve(array);
cleanup();
@@ -109,7 +113,7 @@ module.exports = class Util {
});
}
- static percentColor(pct, percentColors) {
+ static percentColor(pct: number, percentColors: string | any[]) {
let i = 1;
for (i; i < percentColors.length - 1; i++) {
if (pct < percentColors[i].pct) {
@@ -130,7 +134,7 @@ module.exports = class Util {
return `#${color.r}${color.g}${color.b}`;
}
- static today(timeZone) {
+ static today(timeZone: number) {
const now = new Date();
now.setHours(0);
now.setMinutes(0);
@@ -140,13 +144,13 @@ module.exports = class Util {
return now;
}
- static tomorrow(timeZone) {
+ static tomorrow(timeZone: any) {
const today = Util.today(timeZone);
today.setDate(today.getDate() + 1);
return today;
}
- static embedURL(title, url, display) {
+ static embedURL(title: any, url: string, display: any) {
return `[${title}](${url.replace(/\)/g, '%27')}${display ? ` "${display}"` : ''})`;
}
diff --git a/src/utils/gameDigHelper.ts b/src/utils/gameDigHelper.ts
index 647777d..482c87a 100644
--- a/src/utils/gameDigHelper.ts
+++ b/src/utils/gameDigHelper.ts
@@ -1,3 +1,4 @@
+//@ts-ignore no types
import ms from "ms";
import { Util, MessageEmbed } from 'discord.js'
@@ -7,7 +8,7 @@ import { Util, MessageEmbed } from 'discord.js'
* @param {Object} res Result from GameDig
* @returns {MessageEmbed}
*/
-module.exports = res => {
+module.exports = (res: any) => {
const playerCount = res.players.length
const maxPlayers = res.maxPlayers
@@ -34,7 +35,7 @@ module.exports = res => {
])
const unconfirmedValues = new Map([
- [res.raw.secure, secure => emb.addField('Vac Secured', secure ? 'Yes' : 'No')],
+ [res.raw.secure, (secure: any) => emb.addField('Vac Secured', secure ? 'Yes' : 'No')],
[res.raw.games, game => emb.addField('Game', Util.escapeMarkdown(game))]
])
diff --git a/src/utils/genCmdURL.ts b/src/utils/genCmdURL.ts
index 4d658bc..0519de0 100644
--- a/src/utils/genCmdURL.ts
+++ b/src/utils/genCmdURL.ts
@@ -1 +1 @@
-module.exports = cmd => `/commands/${cmd.group.name.toLowerCase().replace(/\s/g, "-")}/${cmd.name}`; \ No newline at end of file
+module.exports = (cmd: { group: { name: string; }; name: any; }) => `/commands/${cmd.group.name.toLowerCase().replace(/\s/g, "-")}/${cmd.name}`; \ No newline at end of file
diff --git a/src/utils/simpleFormat.ts b/src/utils/simpleFormat.ts
index 0985546..4564778 100644
--- a/src/utils/simpleFormat.ts
+++ b/src/utils/simpleFormat.ts
@@ -3,7 +3,7 @@
* @param {number|string} value Value to format
* @returns {number} A number in fixed-point notation up to 2 decimal points
*/
-module.exports = value => {
+module.exports = (value: string) => {
const result = parseFloat(parseFloat(value).toFixed(2));
return result;
}; \ No newline at end of file
diff --git a/src/utils/stripWebhookURL.ts b/src/utils/stripWebhookURL.ts
index fa8c240..73a227c 100644
--- a/src/utils/stripWebhookURL.ts
+++ b/src/utils/stripWebhookURL.ts
@@ -3,9 +3,10 @@
* @param {string} url URL for the webhook from the Discord client
* @returns {Object} Object with the webhook ID and token
*/
-module.exports = url => {
+module.exports = (url: string) => {
const regex = /https:\/\/discordapp\.com\/api\/webhooks\/(\d{1,})\/([\w-_]{1,})/;
const matches = regex.exec(url);
+ //@ts-ignore dont care if null
return { id: matches[1], token: matches[2] };
}; \ No newline at end of file
diff --git a/src/utils/truncateText.ts b/src/utils/truncateText.ts
index bd2f311..f2fa7d0 100644
--- a/src/utils/truncateText.ts
+++ b/src/utils/truncateText.ts
@@ -3,4 +3,4 @@
* @param {number} [number=2048] Number to truncate to
* @returns {string} Truncated string or original if string was short enough to begin with
*/
-module.exports = (string, number = 2048) => (string.length > number ? `${string.substring(0, number - 3)}...` : string); \ No newline at end of file
+module.exports = (string: any, number = 2048) => (string.length > number ? `${string.substring(0, number - 3)}...` : string); \ No newline at end of file
diff --git a/src/utils/wait.ts b/src/utils/wait.ts
index bac3b72..4af65f1 100644
--- a/src/utils/wait.ts
+++ b/src/utils/wait.ts
@@ -3,4 +3,4 @@
* @param {number} delay Delay in milliseconds to wait for
* @returns {Promise<resolve>}
*/
-module.exports = delay => new Promise(resolve => setTimeout(resolve, delay)); \ No newline at end of file
+module.exports = (delay: number) => new Promise(resolve => setTimeout(resolve, delay)); \ No newline at end of file
diff --git a/src/utils/winPercentage.ts b/src/utils/winPercentage.ts
index 022f079..627dab8 100644
--- a/src/utils/winPercentage.ts
+++ b/src/utils/winPercentage.ts
@@ -5,7 +5,7 @@ import config from '../config.json'
* @param {User} user User to calculate win percentage for
* @returns {number} User balance
*/
-module.exports = (multiplier, user) => {
+module.exports = (multiplier: any, user: any) => {
// Load the default setting
//let { houseEdgePercentage } = config;