summaryrefslogtreecommitdiff
path: root/src/commands/server
diff options
context:
space:
mode:
Diffstat (limited to 'src/commands/server')
-rw-r--r--src/commands/server/membercount.ts1
-rw-r--r--src/commands/server/server.ts4
-rw-r--r--src/commands/server/servercount.ts28
-rw-r--r--src/commands/server/welcome.ts31
4 files changed, 28 insertions, 36 deletions
diff --git a/src/commands/server/membercount.ts b/src/commands/server/membercount.ts
index f3fd2ee..7b737ee 100644
--- a/src/commands/server/membercount.ts
+++ b/src/commands/server/membercount.ts
@@ -13,6 +13,7 @@ module.exports = class MemberCountServer extends Command {
usages: 5,
duration: 30
},
+ guildOnly: true,
examples: [
'uwu!membercount',
'uwu!memberc',
diff --git a/src/commands/server/server.ts b/src/commands/server/server.ts
index 6758d24..a63362b 100644
--- a/src/commands/server/server.ts
+++ b/src/commands/server/server.ts
@@ -16,8 +16,8 @@ module.exports = class ServerServer extends Command {
memberName: 'server',
description: 'Gives you information about the current server.',
throttling: {
- usages: 2,
- duration: 60
+ usages: 5,
+ duration: 30
},
guildOnly: true,
examples: [
diff --git a/src/commands/server/servercount.ts b/src/commands/server/servercount.ts
deleted file mode 100644
index 4690caa..0000000
--- a/src/commands/server/servercount.ts
+++ /dev/null
@@ -1,28 +0,0 @@
-import { Command, CommandoMessage } from 'discord.js-commando';
-import { MessageEmbed } from 'discord.js';
-import emoji from 'emoji-random';
-
-module.exports = class ServerCountServer extends Command {
- constructor(client) {
- super(client, {
- name: 'servercount',
- aliases: ['sc', 'scount', 'serverc'],
- group: 'server',
- memberName: 'servercount',
- description: 'Tells you the amount of servers uwufy is in.',
- userPermissions: ['SEND_MESSAGES', 'READ_MESSAGE_HISTORY'],
- clientPermissions: ['SEND_MESSAGES', 'READ_MESSAGE_HISTORY']
- });
- }
- run(msg: CommandoMessage) {
- msg.channel.send('Please wait...').then(m => {
- m.edit(`** **`);
-
- let emb = new MessageEmbed()
- .setDescription(`Currently running on ${this.client.guilds.cache.size} server(s). ` + emoji.random())
- .setColor(0xFFCC4D)
-
- msg.channel.send(emb);
- });
- }
-}; \ No newline at end of file
diff --git a/src/commands/server/welcome.ts b/src/commands/server/welcome.ts
index 9b92268..08a2911 100644
--- a/src/commands/server/welcome.ts
+++ b/src/commands/server/welcome.ts
@@ -2,7 +2,7 @@ import { Command, CommandoMessage } from 'discord.js-commando';
import emoji from 'emoji-random';
import Welcome from '../../models/welcome.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 WelcomeServer extends Command {
constructor(client) {
@@ -25,7 +25,12 @@ module.exports = class WelcomeServer extends Command {
type: 'string',
default: ''
}
- ]
+ ],
+ throttling: {
+ usages: 5,
+ duration: 30
+ },
+ guildOnly: true
});
}
async run(msg: CommandoMessage, { wType }) {
@@ -47,15 +52,29 @@ module.exports = class WelcomeServer extends Command {
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())
+ msg.say('The current welcome channel has been unset! ' + emoji.random()).then(mnotif => {
+ mnotif.delete({ timeout: 2000 })
+ msg.delete({ timeout: 2000 })
+ })
} else if (!guild && wType == 'remove') {
- msg.reply('There is no current welcome channel set for this guild! ' + emoji.random())
- } else if (wType == 'set') {
+ msg.reply('There is no current welcome channel set for this guild! ' + emoji.random()).then(mnotif => {
+ mnotif.delete({ timeout: 2000 })
+ 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 => {
+ mnotif.delete({ timeout: 2000 })
+ msg.delete({ timeout: 2000 })
+ })
+ } else if (!guild && wType == 'set') {
await welcome.save()
.then(result => console.log(result))
.catch(err => console.log(err))
- msg.reply(`The welcome channel has been set to ${msg.channel}! ` + emoji.random())
+ msg.reply(`The welcome channel has been set to ${msg.channel}! ` + emoji.random()).then(mnotif => {
+ mnotif.delete({ timeout: 2000 })
+ 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())
} else if (guild) {