parent
37f45c6d06
commit
4935cf3d43
|
@ -1,49 +1,49 @@
|
||||||
const { GuildMember } = require("discord.js");
|
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
name: 'setnick',
|
name: 'setnick',
|
||||||
description: 'Sets your nickname',
|
description: 'Sets your nickname',
|
||||||
execute(client, message, args, Discord) {
|
execute(client, message, args) {
|
||||||
|
|
||||||
if (message.channel.permissionsFor(message.author).has("CHANGE_NICKNAME")) {
|
if (message.channel.permissionsFor(message.author).has("CHANGE_NICKNAME")) {
|
||||||
var newnick = args.slice(0).join(" ")
|
var newnick = args.slice(0).join(" ")
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const successembed = {
|
const successembed = {
|
||||||
"title": "<:AnitroxSuccess:809651936819019796> Nickname Changed",
|
"title": "<:AnitroxSuccess:809651936819019796> Nickname Changed",
|
||||||
"color": 9442302,
|
"color": 9442302,
|
||||||
"footer": {
|
"footer": {
|
||||||
"icon_url": "https://cdn.discordapp.com/embed/avatars/0.png",
|
"icon_url": "https://cdn.discordapp.com/embed/avatars/0.png",
|
||||||
"text": "Made with ❤ in Illinois | Anitrox © 2018-2021 IDeletedSystem64"
|
"text": "Made with ❤ in Illinois | Anitrox © 2018-2021 IDeletedSystem64"
|
||||||
},
|
},
|
||||||
"fields": [
|
"fields": [
|
||||||
{
|
{
|
||||||
"name": "Changed nickname successfully!",
|
"name": "Changed nickname successfully!",
|
||||||
"value": "You need to have permission ``CHANGE_NICKNAME`` to change your nick!"
|
"value": "You need to have permission ``CHANGE_NICKNAME`` to change your nick!"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "New Nickname",
|
"name": "New Nickname",
|
||||||
"value": newnick,
|
"value": newnick,
|
||||||
"inline": true
|
"inline": true
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
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.")
|
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.")
|
||||||
} catch (error) {
|
message.channel.send({ embed: successembed });
|
||||||
const failembed = {
|
} catch (error) {
|
||||||
"title": "<:AnitroxDenied:809651936642203668> Well that happened...",
|
const failembed = {
|
||||||
"color": 13632027,
|
"title": "<:AnitroxDenied:809651936642203668> Well that happened...",
|
||||||
"footer": {
|
"color": 13632027,
|
||||||
"icon_url": "https://cdn.discordapp.com/embed/avatars/0.png",
|
"footer": {
|
||||||
"text": "Made with ❤ in Illinois | Anitrox © 2018-2021 IDeletedSystem64"
|
"icon_url": "https://cdn.discordapp.com/embed/avatars/0.png",
|
||||||
},
|
"text": "Made with ❤ in Illinois | Anitrox © 2018-2021 IDeletedSystem64"
|
||||||
"fields": [
|
},
|
||||||
{
|
"fields": [
|
||||||
"name": "Failed to set nickname",
|
{
|
||||||
"value": "You need to have permission ``CHANGE_NICKNAME`` to change your nick!"
|
"name": "Failed to set nickname",
|
||||||
}
|
"value": "You need to have permission ``CHANGE_NICKNAME`` to change your nick!"
|
||||||
]
|
}
|
||||||
};
|
]
|
||||||
message.channel.send({ failembed });
|
};
|
||||||
|
message.channel.send({ embed: failembed });
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}}}
|
}}}
|
||||||
|
|
Reference in New Issue