summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
author8cy <[email protected]>2020-07-14 07:02:27 -0700
committer8cy <[email protected]>2020-07-14 07:02:27 -0700
commit100c1b85608a5b605f52ce4e2119ca8fecaa5ee9 (patch)
treead36bc5949e9b5e32a833a95579b5a407938b2db /src
parentadd xorstr (diff)
downloaddep-core-100c1b85608a5b605f52ce4e2119ca8fecaa5ee9.tar.xz
dep-core-100c1b85608a5b605f52ce4e2119ca8fecaa5ee9.zip
add nickname command
Diffstat (limited to 'src')
-rw-r--r--src/commands/moderation/nickname.ts53
-rw-r--r--src/commands/user/nickname.ts4
-rw-r--r--src/config.json4
3 files changed, 57 insertions, 4 deletions
diff --git a/src/commands/moderation/nickname.ts b/src/commands/moderation/nickname.ts
new file mode 100644
index 0000000..910f7ca
--- /dev/null
+++ b/src/commands/moderation/nickname.ts
@@ -0,0 +1,53 @@
+import { Command, CommandoMessage, CommandoClient } from 'discord.js-commando';
+//@ts-ignore this has no types
+import emoji from 'emoji-random'
+
+module.exports = class NicknameModeration extends Command {
+ constructor(client: CommandoClient) {
+ super(client, {
+ name: 'nickname',
+ aliases: ['nick'],
+ group: 'moderation',
+ memberName: 'nickname',
+ description: 'Change someones nickname',
+ userPermissions: ['SEND_MESSAGES', 'READ_MESSAGE_HISTORY', 'CHANGE_NICKNAME', 'MANAGE_NICKNAMES'],
+ clientPermissions: ['SEND_MESSAGES', 'READ_MESSAGE_HISTORY', 'CHANGE_NICKNAME', 'MANAGE_NICKNAMES'],
+ examples: [
+ 'uwu!nickname @sin#1337 loser',
+ 'uwu!nick @sin#1337 loser'
+ ],
+ throttling: {
+ usages: 5,
+ duration: 30
+ },
+ guildOnly: true,
+ args: [
+ {
+ key: 'user',
+ prompt: 'Which users nickname would you like to change?',
+ type: 'string'
+ },
+ {
+ key: 'nick',
+ prompt: 'What would you like to change their nickname to?',
+ type: 'string'
+ }
+ ]
+ });
+ }
+ //@ts-ignore this aint async
+ run(msg: CommandoMessage, { nick, user }: any) {
+ msg.delete()
+ if (msg.mentions.users) {
+ user = msg.mentions.users.first()?.id
+ if (nick) {
+ msg.guild.members.cache.get(user)?.setNickname(nick)
+ return msg.reply(`<@${user}>'s nickname has been changed to **${nick}**! ${emoji.random()}`).then(m => m.delete({ timeout: 3000 }))
+ } else {
+ return msg.reply(`No nickname was provided! ${emoji.random()}`)
+ }
+ } else {
+ return msg.reply(`No valid member was mentioned! ${emoji.random()}`)
+ }
+ }
+}; \ No newline at end of file
diff --git a/src/commands/user/nickname.ts b/src/commands/user/nickname.ts
index 43c46cc..09cf717 100644
--- a/src/commands/user/nickname.ts
+++ b/src/commands/user/nickname.ts
@@ -1,4 +1,4 @@
-import { Command, CommandoMessage, CommandoClient } from 'discord.js-commando';
+/* import { Command, CommandoMessage, CommandoClient } from 'discord.js-commando';
//@ts-ignore no types
import emoji from 'emoji-random';
@@ -33,4 +33,4 @@ module.exports = class NickNameUser extends Command {
msg.member.setNickname(userNick)
return msg.reply(`Your nickname has been changed to ${userNick}. ` + emoji.random())
}
-}; \ No newline at end of file
+}; */ \ No newline at end of file
diff --git a/src/config.json b/src/config.json
index bdebab2..f342a0b 100644
--- a/src/config.json
+++ b/src/config.json
@@ -2,7 +2,7 @@
"secret":"Njk5NDczMjYzOTk4MjcxNDg5.XpU5oQ.btZuxVudhNllSQY6CxrXXtMJm9A",
"secret-dev":"NzEyMDg4MzY5MjA2OTE5MjY5.XsMeEw.Yy0a8m2vZLDbPi7cZ8aqCalMR68",
"yt-api-key":"AIzaSyCeG1lQAeInv4vjFv_eTL9IFAFNdQC9Nk8",
- "version":"1.10.30",
+ "version":"1.10.31",
"fortniteTrackerNetworkToken": "4cf21f95-5f1a-412a-b4a7-e5424adc314a",
"mongodburi": "mongodb://sin:[email protected]:47107/heroku_4qrjvmb9"
-} \ No newline at end of file
+}