fix permissions

This commit is contained in:
Jonny_Bro (Nikita) 2023-07-03 21:13:08 +05:00
parent ac641f9c28
commit 2ab201e1c1
16 changed files with 32 additions and 32 deletions

View file

@ -1,4 +1,4 @@
const { SlashCommandBuilder, PermissionFlagsBits, ChannelType } = require("discord.js"); const { SlashCommandBuilder, PermissionsBitField, ChannelType } = require("discord.js");
const BaseCommand = require("../../base/BaseCommand"); const BaseCommand = require("../../base/BaseCommand");
class Automod extends BaseCommand { class Automod extends BaseCommand {
@ -16,7 +16,7 @@ class Automod extends BaseCommand {
"ru": client.translate("administration/automod:DESCRIPTION", null, "ru-RU"), "ru": client.translate("administration/automod:DESCRIPTION", null, "ru-RU"),
}) })
.setDMPermission(false) .setDMPermission(false)
.setDefaultMemberPermissions(PermissionFlagsBits.ManageGuild) .setDefaultMemberPermissions(PermissionsBitField.Flags.ManageGuild)
.addBooleanOption(option => option.setName("state") .addBooleanOption(option => option.setName("state")
.setDescription(client.translate("common:STATE")) .setDescription(client.translate("common:STATE"))
.setDescriptionLocalizations({ .setDescriptionLocalizations({

View file

@ -1,4 +1,4 @@
const { SlashCommandBuilder, PermissionFlagsBits } = require("discord.js"); const { SlashCommandBuilder, PermissionsBitField } = require("discord.js");
const BaseCommand = require("../../base/BaseCommand"); const BaseCommand = require("../../base/BaseCommand");
class Autorole extends BaseCommand { class Autorole extends BaseCommand {
@ -16,7 +16,7 @@ class Autorole extends BaseCommand {
"ru": client.translate("administration/autorole:DESCRIPTION", null, "ru-RU"), "ru": client.translate("administration/autorole:DESCRIPTION", null, "ru-RU"),
}) })
.setDMPermission(false) .setDMPermission(false)
.setDefaultMemberPermissions(PermissionFlagsBits.ManageGuild) .setDefaultMemberPermissions(PermissionsBitField.Flags.ManageGuild)
.addBooleanOption(option => option.setName("state") .addBooleanOption(option => option.setName("state")
.setDescription(client.translate("common:STATE")) .setDescription(client.translate("common:STATE"))
.setDescriptionLocalizations({ .setDescriptionLocalizations({

View file

@ -1,4 +1,4 @@
const { SlashCommandBuilder, EmbedBuilder, PermissionFlagsBits } = require("discord.js"); const { SlashCommandBuilder, EmbedBuilder, PermissionsBitField } = require("discord.js");
const BaseCommand = require("../../base/BaseCommand"); const BaseCommand = require("../../base/BaseCommand");
class Config extends BaseCommand { class Config extends BaseCommand {
@ -16,7 +16,7 @@ class Config extends BaseCommand {
"ru": client.translate("administration/config:DESCRIPTION", null, "ru-RU"), "ru": client.translate("administration/config:DESCRIPTION", null, "ru-RU"),
}) })
.setDMPermission(false) .setDMPermission(false)
.setDefaultMemberPermissions(PermissionFlagsBits.ManageGuild) .setDefaultMemberPermissions(PermissionsBitField.Flags.ManageGuild)
.addSubcommand(subcommand => subcommand.setName("list") .addSubcommand(subcommand => subcommand.setName("list")
.setDescription(client.translate("administration/config:LIST")) .setDescription(client.translate("administration/config:LIST"))
.setDescriptionLocalizations({ .setDescriptionLocalizations({

View file

@ -1,4 +1,4 @@
const { SlashCommandBuilder, PermissionFlagsBits } = require("discord.js"); const { SlashCommandBuilder, PermissionsBitField } = require("discord.js");
const BaseCommand = require("../../base/BaseCommand"); const BaseCommand = require("../../base/BaseCommand");
class Goodbye extends BaseCommand { class Goodbye extends BaseCommand {
@ -16,7 +16,7 @@ class Goodbye extends BaseCommand {
"ru": client.translate("administration/goodbye:DESCRIPTION", null, "ru-RU"), "ru": client.translate("administration/goodbye:DESCRIPTION", null, "ru-RU"),
}) })
.setDMPermission(false) .setDMPermission(false)
.setDefaultMemberPermissions(PermissionFlagsBits.ManageGuild) .setDefaultMemberPermissions(PermissionsBitField.Flags.ManageGuild)
.addSubcommand(subcommand => subcommand.setName("test") .addSubcommand(subcommand => subcommand.setName("test")
.setDescription(client.translate("administration/goodbye:TEST")) .setDescription(client.translate("administration/goodbye:TEST"))
.setDescriptionLocalizations({ .setDescriptionLocalizations({

View file

@ -1,4 +1,4 @@
const { SlashCommandBuilder, PermissionFlagsBits, ActionRowBuilder, StringSelectMenuBuilder } = require("discord.js"); const { SlashCommandBuilder, PermissionsBitField, ActionRowBuilder, StringSelectMenuBuilder } = require("discord.js");
const BaseCommand = require("../../base/BaseCommand"); const BaseCommand = require("../../base/BaseCommand");
class Selectroles extends BaseCommand { class Selectroles extends BaseCommand {
@ -16,7 +16,7 @@ class Selectroles extends BaseCommand {
"ru": client.translate("administration/selectroles:DESCRIPTION", null, "ru-RU"), "ru": client.translate("administration/selectroles:DESCRIPTION", null, "ru-RU"),
}) })
.setDMPermission(false) .setDMPermission(false)
.setDefaultMemberPermissions(PermissionFlagsBits.ManageGuild) .setDefaultMemberPermissions(PermissionsBitField.Flags.ManageGuild)
.addSubcommand(subcommand => subcommand.setName("message") .addSubcommand(subcommand => subcommand.setName("message")
.setDescription(client.translate("administration/selectroles:MESSAGE")) .setDescription(client.translate("administration/selectroles:MESSAGE"))
.setDescriptionLocalizations({ .setDescriptionLocalizations({

View file

@ -1,4 +1,4 @@
const { SlashCommandBuilder, PermissionFlagsBits } = require("discord.js"); const { SlashCommandBuilder, PermissionsBitField } = require("discord.js");
const BaseCommand = require("../../base/BaseCommand"); const BaseCommand = require("../../base/BaseCommand");
class Set extends BaseCommand { class Set extends BaseCommand {
@ -16,7 +16,7 @@ class Set extends BaseCommand {
"ru": client.translate("administration/set:DESCRIPTION", null, "ru-RU"), "ru": client.translate("administration/set:DESCRIPTION", null, "ru-RU"),
}) })
.setDMPermission(false) .setDMPermission(false)
.setDefaultMemberPermissions(PermissionFlagsBits.ManageGuild) .setDefaultMemberPermissions(PermissionsBitField.Flags.ManageGuild)
.addStringOption(option => option.setName("type") .addStringOption(option => option.setName("type")
.setDescription(client.translate("owner/debug:TYPE")) .setDescription(client.translate("owner/debug:TYPE"))
.setDescriptionLocalizations({ .setDescriptionLocalizations({

View file

@ -1,4 +1,4 @@
const { SlashCommandBuilder, PermissionFlagsBits } = require("discord.js"); const { SlashCommandBuilder, PermissionsBitField } = require("discord.js");
const BaseCommand = require("../../base/BaseCommand"); const BaseCommand = require("../../base/BaseCommand");
class Setlang extends BaseCommand { class Setlang extends BaseCommand {
@ -16,7 +16,7 @@ class Setlang extends BaseCommand {
"ru": client.translate("administration/setlang:DESCRIPTION", null, "ru-RU"), "ru": client.translate("administration/setlang:DESCRIPTION", null, "ru-RU"),
}) })
.setDMPermission(false) .setDMPermission(false)
.setDefaultMemberPermissions(PermissionFlagsBits.ManageGuild) .setDefaultMemberPermissions(PermissionsBitField.Flags.ManageGuild)
.addStringOption(option => option.setName("language") .addStringOption(option => option.setName("language")
.setDescription(client.translate("common:LANGUAGE")) .setDescription(client.translate("common:LANGUAGE"))
.setDescriptionLocalizations({ .setDescriptionLocalizations({

View file

@ -1,4 +1,4 @@
const { SlashCommandBuilder, parseEmoji, PermissionFlagsBits } = require("discord.js"); const { SlashCommandBuilder, parseEmoji, PermissionsBitField } = require("discord.js");
const BaseCommand = require("../../base/BaseCommand"); const BaseCommand = require("../../base/BaseCommand");
class Stealemoji extends BaseCommand { class Stealemoji extends BaseCommand {
@ -16,7 +16,7 @@ class Stealemoji extends BaseCommand {
"ru": client.translate("administration/stealemoji:DESCRIPTION", null, "ru-RU"), "ru": client.translate("administration/stealemoji:DESCRIPTION", null, "ru-RU"),
}) })
.setDMPermission(false) .setDMPermission(false)
.setDefaultMemberPermissions(PermissionFlagsBits.ManageGuild) .setDefaultMemberPermissions(PermissionsBitField.Flags.ManageGuild)
.addStringOption(option => option.setName("emoji") .addStringOption(option => option.setName("emoji")
.setDescription(client.translate("common:EMOJI")) .setDescription(client.translate("common:EMOJI"))
.setDescriptionLocalizations({ .setDescriptionLocalizations({

View file

@ -1,4 +1,4 @@
const { SlashCommandBuilder, PermissionFlagsBits } = require("discord.js"); const { SlashCommandBuilder, PermissionsBitField } = require("discord.js");
const BaseCommand = require("../../base/BaseCommand"); const BaseCommand = require("../../base/BaseCommand");
class Welcome extends BaseCommand { class Welcome extends BaseCommand {
@ -16,7 +16,7 @@ class Welcome extends BaseCommand {
"ru": client.translate("administration/welcome:DESCRIPTION", null, "ru-RU"), "ru": client.translate("administration/welcome:DESCRIPTION", null, "ru-RU"),
}) })
.setDMPermission(false) .setDMPermission(false)
.setDefaultMemberPermissions(PermissionFlagsBits.ManageGuild) .setDefaultMemberPermissions(PermissionsBitField.Flags.ManageGuild)
.addSubcommand(subcommand => subcommand.setName("test") .addSubcommand(subcommand => subcommand.setName("test")
.setDescription(client.translate("administration/goodbye:TEST")) .setDescription(client.translate("administration/goodbye:TEST"))
.setDescriptionLocalizations({ .setDescriptionLocalizations({

View file

@ -1,4 +1,4 @@
const { SlashCommandBuilder, ActionRowBuilder, ButtonBuilder, ButtonStyle, PermissionFlagsBits } = require("discord.js"); const { SlashCommandBuilder, ActionRowBuilder, ButtonBuilder, ButtonStyle, PermissionsBitField } = require("discord.js");
const BaseCommand = require("../../base/BaseCommand"); const BaseCommand = require("../../base/BaseCommand");
class Clear extends BaseCommand { class Clear extends BaseCommand {
@ -16,7 +16,7 @@ class Clear extends BaseCommand {
"ru": client.translate("moderation/clear:DESCRIPTION", null, "ru-RU"), "ru": client.translate("moderation/clear:DESCRIPTION", null, "ru-RU"),
}) })
.setDMPermission(false) .setDMPermission(false)
.setDefaultMemberPermissions(PermissionFlagsBits.ModerateMembers && PermissionFlagsBits.ManageMessages) .setDefaultMemberPermissions(PermissionsBitField.Flags.ManageMessages)
.addStringOption(option => option.setName("option") .addStringOption(option => option.setName("option")
.setDescription(client.translate("moderation/clear:OPTION")) .setDescription(client.translate("moderation/clear:OPTION"))
.setDescriptionLocalizations({ .setDescriptionLocalizations({

View file

@ -1,4 +1,4 @@
const { SlashCommandBuilder, PermissionFlagsBits } = require("discord.js"); const { SlashCommandBuilder, PermissionsBitField } = require("discord.js");
const BaseCommand = require("../../base/BaseCommand"); const BaseCommand = require("../../base/BaseCommand");
class Clearwarns extends BaseCommand { class Clearwarns extends BaseCommand {
@ -16,7 +16,7 @@ class Clearwarns extends BaseCommand {
"ru": client.translate("moderation/clearwarns:DESCRIPTION", null, "ru-RU"), "ru": client.translate("moderation/clearwarns:DESCRIPTION", null, "ru-RU"),
}) })
.setDMPermission(false) .setDMPermission(false)
.setDefaultMemberPermissions(PermissionFlagsBits.ModerateMembers && PermissionFlagsBits.ManageMessages) .setDefaultMemberPermissions(PermissionsBitField.Flags.ManageMessages)
.addUserOption(option => option.setName("user") .addUserOption(option => option.setName("user")
.setDescription(client.translate("common:USER")) .setDescription(client.translate("common:USER"))
.setDescriptionLocalizations({ .setDescriptionLocalizations({

View file

@ -1,4 +1,4 @@
const { SlashCommandBuilder, PermissionFlagsBits } = require("discord.js"); const { SlashCommandBuilder, PermissionsBitField } = require("discord.js");
const BaseCommand = require("../../base/BaseCommand"), const BaseCommand = require("../../base/BaseCommand"),
ms = require("ms"); ms = require("ms");
@ -17,7 +17,7 @@ class Giveaway extends BaseCommand {
"ru": client.translate("moderation/giveaway:DESCRIPTION", null, "ru-RU"), "ru": client.translate("moderation/giveaway:DESCRIPTION", null, "ru-RU"),
}) })
.setDMPermission(false) .setDMPermission(false)
.setDefaultMemberPermissions(PermissionFlagsBits.ModerateMembers && PermissionFlagsBits.ManageMessages) .setDefaultMemberPermissions(PermissionsBitField.Flags.ManageMessages)
.addSubcommand(subcommand => subcommand.setName("create") .addSubcommand(subcommand => subcommand.setName("create")
.setDescription(client.translate("moderation/giveaway:CREATE")) .setDescription(client.translate("moderation/giveaway:CREATE"))
.setDescriptionLocalizations({ .setDescriptionLocalizations({

View file

@ -1,4 +1,4 @@
const { SlashCommandBuilder, EmbedBuilder, ActionRowBuilder, ButtonBuilder, ButtonStyle, PermissionFlagsBits } = require("discord.js"); const { SlashCommandBuilder, EmbedBuilder, ActionRowBuilder, ButtonBuilder, ButtonStyle, PermissionsBitField } = require("discord.js");
const BaseCommand = require("../../base/BaseCommand"); const BaseCommand = require("../../base/BaseCommand");
class Poll extends BaseCommand { class Poll extends BaseCommand {
@ -16,7 +16,7 @@ class Poll extends BaseCommand {
"ru": client.translate("moderation/poll:DESCRIPTION", null, "ru-RU"), "ru": client.translate("moderation/poll:DESCRIPTION", null, "ru-RU"),
}) })
.setDMPermission(false) .setDMPermission(false)
.setDefaultMemberPermissions(PermissionFlagsBits.ModerateMembers && PermissionFlagsBits.ManageMessages) .setDefaultMemberPermissions(PermissionsBitField.Flags.ManageMessages)
.addStringOption(option => option.setName("question") .addStringOption(option => option.setName("question")
.setDescription(client.translate("moderation/poll:QUESTION")) .setDescription(client.translate("moderation/poll:QUESTION"))
.setDescriptionLocalizations({ .setDescriptionLocalizations({

View file

@ -1,4 +1,4 @@
const { SlashCommandBuilder, PermissionFlagsBits } = require("discord.js"); const { SlashCommandBuilder, PermissionsBitField } = require("discord.js");
const BaseCommand = require("../../base/BaseCommand"); const BaseCommand = require("../../base/BaseCommand");
class Unban extends BaseCommand { class Unban extends BaseCommand {
@ -16,7 +16,7 @@ class Unban extends BaseCommand {
"ru": client.translate("moderation/unban:DESCRIPTION", null, "ru-RU"), "ru": client.translate("moderation/unban:DESCRIPTION", null, "ru-RU"),
}) })
.setDMPermission(false) .setDMPermission(false)
.setDefaultMemberPermissions(PermissionFlagsBits.ModerateMembers && PermissionFlagsBits.ManageMessages) .setDefaultMemberPermissions(PermissionsBitField.Flags.ManageMessages)
.addStringOption(option => option.setName("user_id") .addStringOption(option => option.setName("user_id")
.setDescription(client.translate("common:USER_ID")) .setDescription(client.translate("common:USER_ID"))
.setDescriptionLocalizations({ .setDescriptionLocalizations({

View file

@ -1,4 +1,4 @@
const { ContextMenuCommandBuilder, ModalBuilder, EmbedBuilder, ActionRowBuilder, TextInputBuilder, ApplicationCommandType, PermissionFlagsBits, TextInputStyle } = require("discord.js"); const { ContextMenuCommandBuilder, ModalBuilder, EmbedBuilder, ActionRowBuilder, TextInputBuilder, ApplicationCommandType, PermissionsBitField, TextInputStyle } = require("discord.js");
const BaseCommand = require("../../base/BaseCommand"); const BaseCommand = require("../../base/BaseCommand");
class Warn extends BaseCommand { class Warn extends BaseCommand {
@ -12,7 +12,7 @@ class Warn extends BaseCommand {
.setName("warn") .setName("warn")
.setType(ApplicationCommandType.User) .setType(ApplicationCommandType.User)
.setDMPermission(false) .setDMPermission(false)
.setDefaultMemberPermissions(PermissionFlagsBits.ModerateMembers && PermissionFlagsBits.ManageMessages), .setDefaultMemberPermissions(PermissionsBitField.Flags.ManageMessages),
aliases: [], aliases: [],
dirname: __dirname, dirname: __dirname,
ownerOnly: false, ownerOnly: false,

View file

@ -1,4 +1,4 @@
const { SlashCommandBuilder, PermissionFlagsBits, EmbedBuilder } = require("discord.js"); const { SlashCommandBuilder, PermissionsBitField, EmbedBuilder } = require("discord.js");
const BaseCommand = require("../../base/BaseCommand"); const BaseCommand = require("../../base/BaseCommand");
class Warns extends BaseCommand { class Warns extends BaseCommand {
@ -16,7 +16,7 @@ class Warns extends BaseCommand {
"ru": client.translate("moderation/warns:DESCRIPTION", null, "ru-RU"), "ru": client.translate("moderation/warns:DESCRIPTION", null, "ru-RU"),
}) })
.setDMPermission(false) .setDMPermission(false)
.setDefaultMemberPermissions(PermissionFlagsBits.ModerateMembers && PermissionFlagsBits.ManageMessages) .setDefaultMemberPermissions(PermissionsBitField.Flags.ManageMessages)
.addUserOption(option => option.setName("user") .addUserOption(option => option.setName("user")
.setDescription(client.translate("common:USER")) .setDescription(client.translate("common:USER"))
.setDescriptionLocalizations({ .setDescriptionLocalizations({