summaryrefslogtreecommitdiff
path: root/src/commands/zerotwo
diff options
context:
space:
mode:
Diffstat (limited to 'src/commands/zerotwo')
-rw-r--r--src/commands/zerotwo/darling.ts13
-rw-r--r--src/commands/zerotwo/douse.ts5
2 files changed, 14 insertions, 4 deletions
diff --git a/src/commands/zerotwo/darling.ts b/src/commands/zerotwo/darling.ts
index 9999362..18fb3ac 100644
--- a/src/commands/zerotwo/darling.ts
+++ b/src/commands/zerotwo/darling.ts
@@ -2,7 +2,7 @@ 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')
+mongo.connect('mongodb://sin:[email protected]:47107/heroku_4qrjvmb9', { useNewUrlParser: true, useUnifiedTopology: true })
module.exports = class DarlingZeroTwo extends Command {
constructor(client) {
@@ -25,7 +25,12 @@ module.exports = class DarlingZeroTwo extends Command {
type: 'string',
default: ''
}
- ]
+ ],
+ throttling: {
+ usages: 5,
+ duration: 30
+ },
+ guildOnly: true
});
}
async run(msg: CommandoMessage, { darlingName }) {
@@ -51,7 +56,9 @@ module.exports = class DarlingZeroTwo extends Command {
}
} else if (!guild && darlingName == 'remove') {
msg.reply('There is no darling set in this server. ' + emoji.random())
- } else if (darlingName == 'set') {
+ } else if (guild && darlingName == 'set') {
+ msg.reply(`I already have a darling! It\'s <@${guild.userID}>! ` + emoji.random())
+ } else if (!guild && darlingName == 'set') {
await darling.save()
.then(result => console.log(result))
.catch(err => console.log(err))
diff --git a/src/commands/zerotwo/douse.ts b/src/commands/zerotwo/douse.ts
index 9ca74ca..cced22d 100644
--- a/src/commands/zerotwo/douse.ts
+++ b/src/commands/zerotwo/douse.ts
@@ -13,12 +13,15 @@ module.exports = class DouseZeroTwo extends Command {
],
userPermissions: ['SEND_MESSAGES', 'READ_MESSAGE_HISTORY'],
clientPermissions: ['SEND_MESSAGES', 'READ_MESSAGE_HISTORY'],
+ throttling: {
+ usages: 5,
+ duration: 30
+ },
});
}
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)
}