summaryrefslogtreecommitdiff
path: root/src/commands/zerotwo
diff options
context:
space:
mode:
Diffstat (limited to 'src/commands/zerotwo')
-rw-r--r--src/commands/zerotwo/darling.ts25
-rw-r--r--src/commands/zerotwo/douse.ts6
-rw-r--r--src/commands/zerotwo/zerotwo.ts6
3 files changed, 20 insertions, 17 deletions
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