diff options
| author | 8cy <[email protected]> | 2020-04-23 11:48:22 -0700 |
|---|---|---|
| committer | 8cy <[email protected]> | 2020-04-23 11:48:22 -0700 |
| commit | 02b211b23bb7f95895c7e7f9dbf16983b13692af (patch) | |
| tree | 0b92429799ad61cc0f1d676e9be03389c44155a8 /src/commands | |
| parent | change invite link, v.7.3.6 (diff) | |
| download | dep-core-02b211b23bb7f95895c7e7f9dbf16983b13692af.tar.xz dep-core-02b211b23bb7f95895c7e7f9dbf16983b13692af.zip | |
DARLING in the FRANXX, v7.4.0
- add mongo db support
- add zero two darling cmd
Diffstat (limited to 'src/commands')
| -rw-r--r-- | src/commands/utility/memorystats.ts | 2 | ||||
| -rw-r--r-- | src/commands/utility/memoryusage.ts | 2 | ||||
| -rw-r--r-- | src/commands/utility/version.ts | 2 | ||||
| -rw-r--r-- | src/commands/zerotwo/darling.ts | 60 |
4 files changed, 65 insertions, 1 deletions
diff --git a/src/commands/utility/memorystats.ts b/src/commands/utility/memorystats.ts index 43dbd13..0729fc5 100644 --- a/src/commands/utility/memorystats.ts +++ b/src/commands/utility/memorystats.ts @@ -17,6 +17,8 @@ module.exports = class MemoryStatsUtility extends Command { group: 'utility', memberName: 'memorystats', description: 'Checks the full, current, approximate memory usage statistics of the bot\'s Node.js process.', + userPermissions: ['SEND_MESSAGES', 'READ_MESSAGE_HISTORY'], + clientPermissions: ['SEND_MESSAGES', 'READ_MESSAGE_HISTORY'] }); } run(msg: CommandoMessage) { diff --git a/src/commands/utility/memoryusage.ts b/src/commands/utility/memoryusage.ts index a4f52c0..3c2913a 100644 --- a/src/commands/utility/memoryusage.ts +++ b/src/commands/utility/memoryusage.ts @@ -16,6 +16,8 @@ module.exports = class MemoryUsageUtility extends Command { group: 'utility', memberName: 'memoryusage', description: 'Checks the current, approximate memory usage of the bot\'s Node.js process.', + userPermissions: ['SEND_MESSAGES', 'READ_MESSAGE_HISTORY'], + clientPermissions: ['SEND_MESSAGES', 'READ_MESSAGE_HISTORY'] }); } run(msg: CommandoMessage) { diff --git a/src/commands/utility/version.ts b/src/commands/utility/version.ts index b8d65eb..e23514e 100644 --- a/src/commands/utility/version.ts +++ b/src/commands/utility/version.ts @@ -25,7 +25,7 @@ export default class VersionUtility extends Command { m.edit(`** **`); let emb = new MessageEmbed() - .setDescription('uwufier\'s current build version is **v7.3.6**. ' + emoji.random()) + .setDescription('uwufier\'s current build version is **v7.4.0**. ' + emoji.random()) .setColor(0xFFCC4D) msg.channel.send(emb); diff --git a/src/commands/zerotwo/darling.ts b/src/commands/zerotwo/darling.ts new file mode 100644 index 0000000..2c72c1c --- /dev/null +++ b/src/commands/zerotwo/darling.ts @@ -0,0 +1,60 @@ +import { Command, CommandoMessage } from 'discord.js-commando'; +import Darling from '../../models/darling.js'; +import mongo from 'mongoose'; +mongo.connect('mongodb+srv://sin:[email protected]/test?retryWrites=true&w=majority') + +module.exports = class DarlingZeroTwo extends Command { + constructor(client) { + super(client, { + name: 'darling', + group: 'zerotwo', + memberName: 'darling', + description: 'Get\'s or sets uwufier\'s current darling.', + userPermissions: ['SEND_MESSAGES', 'READ_MESSAGE_HISTORY'], + clientPermissions: ['SEND_MESSAGES', 'READ_MESSAGE_HISTORY'], + examples: ['uwu!darling'], + args: [ + { + key: 'darlingName', + prompt: 'Who should the darling be?', + type: 'string', + default: '' + } + ] + }); + } + async run(msg: CommandoMessage, { darlingName }) { + const darling = new Darling({ + _id: mongo.Types.ObjectId(), + username: msg.author.username, + userID: msg.author.id, + guildname: msg.guild.name, + guildID: msg.guild.id, + time: msg.createdAt + }) + 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)) + + 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) { + let result = await Darling.findOne({ userID: msg.author.id }) + msg.reply(`My darling is <@${result.userID}>`) + } + } +};
\ No newline at end of file |