Added eslintrc config and updated all files to it
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
const { ContextMenuCommandBuilder, ApplicationCommandType, PermissionFlagsBits } = require('discord.js');
|
||||
const { ContextMenuCommandBuilder, ApplicationCommandType, PermissionFlagsBits } = require("discord.js")
|
||||
|
||||
module.exports = {
|
||||
name: 'resetnick',
|
||||
description: 'Reset your nickname.',
|
||||
type: 'contextmenu',
|
||||
name: "resetnick",
|
||||
description: "Reset your nickname.",
|
||||
type: "contextmenu",
|
||||
|
||||
data: new ContextMenuCommandBuilder()
|
||||
.setName('Reset Nickname')
|
||||
.setName("Reset Nickname")
|
||||
.setType(ApplicationCommandType.User)
|
||||
.setDefaultMemberPermissions(PermissionFlagsBits.ManageNicknames),
|
||||
|
||||
@@ -15,22 +15,22 @@ module.exports = {
|
||||
async execute(interaction) {
|
||||
|
||||
const { targetId } = interaction
|
||||
const target = await interaction.guild.members.fetch(targetId);
|
||||
const target = await interaction.guild.members.fetch(targetId)
|
||||
|
||||
if (!target) {
|
||||
return interaction.reply({ content: 'That user does not exist.', ephemeral: true });
|
||||
return interaction.reply({ content: "That user does not exist.", ephemeral: true })
|
||||
}
|
||||
|
||||
if (target.id === interaction.user.id) {
|
||||
return interaction.reply({ content: 'You can\'t reset your own nickname.', ephemeral: true });
|
||||
return interaction.reply({ content: "You can't reset your own nickname.", ephemeral: true })
|
||||
}
|
||||
|
||||
if (!target.manageable) {
|
||||
return interaction.reply({ content: 'I cannot reset that user\'s nickname.', ephemeral: true });
|
||||
return interaction.reply({ content: "I cannot reset that user's nickname.", ephemeral: true })
|
||||
}
|
||||
|
||||
await target.setNickname(target.user.username, 'Reset by ' + interaction.user.username + "#" + interaction.user.discriminator);
|
||||
await target.setNickname(target.user.username, "Reset by " + interaction.user.username + "#" + interaction.user.discriminator)
|
||||
|
||||
return interaction.reply({ content: `Reset ${target.user.username}'s nickname.`, ephemeral: true });
|
||||
return interaction.reply({ content: `Reset ${target.user.username}'s nickname.`, ephemeral: true })
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user