Update setnick to a (mostly) working version

This commit is contained in:
Anthony M 2021-03-16 17:18:18 -05:00 committed by GitHub
parent 75fe3064ab
commit 64a1655ab9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 6 deletions

View File

@ -4,8 +4,10 @@ module.exports = {
name: 'setnick',
description: 'Sets your nickname',
execute(client, message, args, Discord) {
if (message.channel.permissionsFor(message.author).has("CHANGE_NICKNAME")) {
var newnick = args.slice(0).join(" ")
const successembed = {
"title": "<:AnitroxSuccess:809651936819019796> Nickname Changed",
"color": 9442302,
@ -18,11 +20,6 @@ module.exports = {
"name": "Changed nickname successfully!",
"value": "You need to have permission ``CHANGE_NICKNAME`` to change your nick!"
},
{
"name": "Old Nickname",
"value": "oldnick",
"inline": true
},
{
"name": "New Nickname",
"value": newnick,
@ -30,7 +27,7 @@ module.exports = {
}
]
};
GuildMember.setNickname(newnick, "Nickname change requested by a server member. If you don't want users to be able to change their nickname disable 'CHANGE_NICKNAME' via Change Nickname in Roles.")
message.member.setNickname(newnick, "Nickname change requested by the server member. If you don't want users to be able to change their nickname disable 'CHANGE_NICKNAME' via Change Nickname in Roles.")
} else {
const failembed = {
"title": "<:AnitroxDenied:809651936642203668> Well that happened...",