diff options
| author | 8cy <[email protected]> | 2020-04-24 19:29:25 -0700 |
|---|---|---|
| committer | 8cy <[email protected]> | 2020-04-24 19:29:25 -0700 |
| commit | 95477dd346b0f2dca1b6ced6946f5cc3cfda6697 (patch) | |
| tree | bbb02c892bdc3893e8aa4ed66afc04ecc00437bb /src/commands/zerotwo | |
| parent | shift groups around, new mod cmds, v7.5.0 (diff) | |
| download | dep-core-95477dd346b0f2dca1b6ced6946f5cc3cfda6697.tar.xz dep-core-95477dd346b0f2dca1b6ced6946f5cc3cfda6697.zip | |
big changes, too lazy to count, v7.6.0
mainly just fix darling
Diffstat (limited to 'src/commands/zerotwo')
| -rw-r--r-- | src/commands/zerotwo/darling.ts | 79 | ||||
| -rw-r--r-- | src/commands/zerotwo/douse.ts | 25 |
2 files changed, 84 insertions, 20 deletions
diff --git a/src/commands/zerotwo/darling.ts b/src/commands/zerotwo/darling.ts index 3b7517e..9999362 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 emoji from 'emoji-random'; import Darling from '../../models/darling.js'; import mongo from 'mongoose'; mongo.connect('mongodb://sin:[email protected]:47107/heroku_4qrjvmb9') @@ -38,27 +39,65 @@ module.exports = class DarlingZeroTwo extends Command { }) const guildExist = await Darling.findOne({ guildID: msg.guild.id }) - if (guildExist && darlingName == 'remove') { - await Darling.findOneAndDelete({ guildID: msg.guild.id }) - msg.say('The current darling has been removed.') - } else if (!guildExist && darlingName == 'remove') { - msg.reply('There is no darling set in this server.') - } else if (darlingName || darlingName == 'set') { - await darling.save().then(result => console.log(result)).catch(err => console.log(err)) + Darling.findOne({ guildID: msg.guild.id }, async (error, guild) => { + if (error) { + console.log(error) + } else if (guild && darlingName == 'remove') { + if (msg.author.id == guild.userID) { + await Darling.findOneAndDelete({ guildID: msg.guild.id }) + msg.say('The current darling has been removed. ' + emoji.random()) + } else { + msg.reply('Only my darling can remove the current darling. ' + emoji.random()) + } + } else if (!guild && darlingName == 'remove') { + msg.reply('There is no darling set in this server. ' + emoji.random()) + } else if (darlingName == 'set') { + await darling.save() + .then(result => console.log(result)) + .catch(err => console.log(err)) - var quoteNum = Math.floor((Math.random() * 3) + 1); - switch (quoteNum) { - case 1: var quoteResult = 'I think I have taken a liking to you. Won\'t you be my darling?'; break - case 2: var quoteResult = 'I like the look in your eyes. It makes my heart race. You are now my darling!'; break - case 3: var quoteResult = 'Wow, your taste makes my heart race. It bites and lingers... The taste of danger. You are now my darling!'; break - default: var quoteResult = 'I think I have taken a liking to you. Won\'t you be my darling?'; break + var quoteNum = Math.floor((Math.random() * 3) + 1); + switch (quoteNum) { + case 1: var quoteResult = 'I think I have taken a liking to you. Won\'t you be my darling?'; break + case 2: var quoteResult = 'I like the look in your eyes. It makes my heart race. You are now my darling!'; break + case 3: var quoteResult = 'Wow, your taste makes my heart race. It bites and lingers... The taste of danger. You are now my darling!'; break + default: var quoteResult = 'I think I have taken a liking to you. Won\'t you be my darling?'; break + } + msg.reply(quoteResult) + } else if (!guild) { + msg.reply('I haven\'t found my darling yet! To set one, do `uwu!darling set`. ' + emoji.random()) + } else if (guild) { + msg.reply(`My darling is <@${guild.userID}>. ` + emoji.random()) } - msg.reply(quoteResult) - } else if (!guildExist) { - msg.reply('I haven\'t found my darling yet!') - } else if (guildExist) { - let result = await Darling.findOne({ userID: msg.author.id }) - msg.reply(`My darling is <@${result.userID}>`) - } + }) + + // if (guildExist && darlingName == 'remove') { + // await Darling.findOneAndDelete({ guildID: msg.guild.id }) + // msg.say('The current darling has been removed.') + // } else if (!guildExist && darlingName == 'remove') { + // msg.reply('There is no darling set in this server.') + // } else if (darlingName || darlingName == 'set') { + // await darling.save().then(result => console.log(result)).catch(err => console.log(err)) + + // var quoteNum = Math.floor((Math.random() * 3) + 1); + // switch (quoteNum) { + // case 1: var quoteResult = 'I think I have taken a liking to you. Won\'t you be my darling?'; break + // case 2: var quoteResult = 'I like the look in your eyes. It makes my heart race. You are now my darling!'; break + // case 3: var quoteResult = 'Wow, your taste makes my heart race. It bites and lingers... The taste of danger. You are now my darling!'; break + // default: var quoteResult = 'I think I have taken a liking to you. Won\'t you be my darling?'; break + // } + // msg.reply(quoteResult) + // } else if (!guildExist) { + // msg.reply('I haven\'t found my darling yet!') + // } else if (guildExist) { + // await Darling.findOne({ userID: msg.author.id }, (err) => { + // if (err) console.log(err) + // }).then(res => { + // msg.reply(`My darling is <@${res.userID}>`) + // }) + // //msg.reply(`My darling is <@${result.userID}>`) + // } else { + // console.error() + // } } };
\ No newline at end of file diff --git a/src/commands/zerotwo/douse.ts b/src/commands/zerotwo/douse.ts new file mode 100644 index 0000000..9ca74ca --- /dev/null +++ b/src/commands/zerotwo/douse.ts @@ -0,0 +1,25 @@ +import { Command, CommandoMessage } from 'discord.js-commando'; +import { MessageEmbed } from 'discord.js'; + +module.exports = class DouseZeroTwo extends Command { + constructor(client) { + super(client, { + name: 'douse', + group: 'fun', + memberName: 'douse', + description: 'Douses Zero Two.', + examples: [ + 'uwu!douse' + ], + userPermissions: ['SEND_MESSAGES', 'READ_MESSAGE_HISTORY'], + clientPermissions: ['SEND_MESSAGES', 'READ_MESSAGE_HISTORY'], + }); + } + run(msg: CommandoMessage) { + let emb = new MessageEmbed() + .setColor(0xFFD0DF) + .setDescription('And I oop-') + .setImage('https://i.pinimg.com/originals/6a/c8/26/6ac826e3d0cbd64eb4f42c12a73fcdb8.gif') + msg.say(emb) + } +};
\ No newline at end of file |