diff --git a/commands/Administration/addemoji.js b/commands/Administration/addemoji.js index 21deb253..fc93a197 100644 --- a/commands/Administration/addemoji.js +++ b/commands/Administration/addemoji.js @@ -1,4 +1,4 @@ -const { SlashCommandBuilder, PermissionsBitField, InteractionContextType } = require("discord.js"); +const { SlashCommandBuilder, PermissionsBitField, InteractionContextType, ApplicationIntegrationType } = require("discord.js"); const BaseCommand = require("../../base/BaseCommand"); class Addemoji extends BaseCommand { @@ -15,6 +15,7 @@ class Addemoji extends BaseCommand { uk: client.translate("administration/addemoji:DESCRIPTION", null, "uk-UA"), ru: client.translate("administration/addemoji:DESCRIPTION", null, "ru-RU"), }) + .setIntegrationTypes([ApplicationIntegrationType.GuildInstall]) .setContexts([InteractionContextType.Guild]) .setDefaultMemberPermissions(PermissionsBitField.Flags.ManageGuild) .addStringOption(option => diff --git a/commands/Administration/automod.js b/commands/Administration/automod.js index ec5a8c9a..4c5a95f2 100644 --- a/commands/Administration/automod.js +++ b/commands/Administration/automod.js @@ -1,4 +1,4 @@ -const { SlashCommandBuilder, PermissionsBitField, ChannelType, InteractionContextType } = require("discord.js"); +const { SlashCommandBuilder, PermissionsBitField, ChannelType, InteractionContextType, ApplicationIntegrationType } = require("discord.js"); const BaseCommand = require("../../base/BaseCommand"); class Automod extends BaseCommand { @@ -15,6 +15,7 @@ class Automod extends BaseCommand { uk: client.translate("administration/automod:DESCRIPTION", null, "uk-UA"), ru: client.translate("administration/automod:DESCRIPTION", null, "ru-RU"), }) + .setIntegrationTypes([ApplicationIntegrationType.GuildInstall]) .setContexts([InteractionContextType.Guild]) .setDefaultMemberPermissions(PermissionsBitField.Flags.ManageGuild) .addSubcommand(subcommand => diff --git a/commands/Administration/autorole.js b/commands/Administration/autorole.js index 7699a0e4..6f19adf8 100644 --- a/commands/Administration/autorole.js +++ b/commands/Administration/autorole.js @@ -1,4 +1,4 @@ -const { SlashCommandBuilder, PermissionsBitField, InteractionContextType } = require("discord.js"); +const { SlashCommandBuilder, PermissionsBitField, InteractionContextType, ApplicationIntegrationType } = require("discord.js"); const BaseCommand = require("../../base/BaseCommand"); class Autorole extends BaseCommand { @@ -15,6 +15,7 @@ class Autorole extends BaseCommand { uk: client.translate("administration/autorole:DESCRIPTION", null, "uk-UA"), ru: client.translate("administration/autorole:DESCRIPTION", null, "ru-RU"), }) + .setIntegrationTypes([ApplicationIntegrationType.GuildInstall]) .setContexts([InteractionContextType.Guild]) .setDefaultMemberPermissions(PermissionsBitField.Flags.ManageGuild) .addBooleanOption(option => diff --git a/commands/Administration/config.js b/commands/Administration/config.js index 50e52e89..c0aa1f57 100644 --- a/commands/Administration/config.js +++ b/commands/Administration/config.js @@ -1,4 +1,4 @@ -const { SlashCommandBuilder, PermissionsBitField, ChannelType, InteractionContextType } = require("discord.js"); +const { SlashCommandBuilder, PermissionsBitField, ChannelType, InteractionContextType, ApplicationIntegrationType } = require("discord.js"); const BaseCommand = require("../../base/BaseCommand"); class Config extends BaseCommand { @@ -15,6 +15,7 @@ class Config extends BaseCommand { uk: client.translate("administration/config:DESCRIPTION", null, "uk-UA"), ru: client.translate("administration/config:DESCRIPTION", null, "ru-RU"), }) + .setIntegrationTypes([ApplicationIntegrationType.GuildInstall]) .setContexts([InteractionContextType.Guild]) .setDefaultMemberPermissions(PermissionsBitField.Flags.ManageGuild) .addSubcommand(subcommand => diff --git a/commands/Administration/goodbye.js b/commands/Administration/goodbye.js index 5189aecb..e07dbcc2 100644 --- a/commands/Administration/goodbye.js +++ b/commands/Administration/goodbye.js @@ -1,4 +1,4 @@ -const { SlashCommandBuilder, PermissionsBitField, InteractionContextType } = require("discord.js"); +const { SlashCommandBuilder, PermissionsBitField, InteractionContextType, ApplicationIntegrationType } = require("discord.js"); const BaseCommand = require("../../base/BaseCommand"); class Goodbye extends BaseCommand { @@ -15,6 +15,7 @@ class Goodbye extends BaseCommand { uk: client.translate("administration/goodbye:DESCRIPTION", null, "uk-UA"), ru: client.translate("administration/goodbye:DESCRIPTION", null, "ru-RU"), }) + .setIntegrationTypes([ApplicationIntegrationType.GuildInstall]) .setContexts([InteractionContextType.Guild]) .setDefaultMemberPermissions(PermissionsBitField.Flags.ManageGuild) .addSubcommand(subcommand => diff --git a/commands/Administration/selectroles.js b/commands/Administration/selectroles.js index 7d4bd177..9fea2462 100644 --- a/commands/Administration/selectroles.js +++ b/commands/Administration/selectroles.js @@ -1,4 +1,4 @@ -const { SlashCommandBuilder, PermissionsBitField, ActionRowBuilder, StringSelectMenuBuilder, InteractionContextType } = require("discord.js"); +const { SlashCommandBuilder, PermissionsBitField, ActionRowBuilder, StringSelectMenuBuilder, InteractionContextType, ApplicationIntegrationType } = require("discord.js"); const BaseCommand = require("../../base/BaseCommand"); class Selectroles extends BaseCommand { @@ -15,6 +15,7 @@ class Selectroles extends BaseCommand { uk: client.translate("administration/selectroles:DESCRIPTION", null, "uk-UA"), ru: client.translate("administration/selectroles:DESCRIPTION", null, "ru-RU"), }) + .setIntegrationTypes([ApplicationIntegrationType.GuildInstall]) .setContexts([InteractionContextType.Guild]) .setDefaultMemberPermissions(PermissionsBitField.Flags.ManageGuild) .addSubcommand(subcommand => diff --git a/commands/Administration/set.js b/commands/Administration/set.js index 5ff31ddc..2cf1b011 100644 --- a/commands/Administration/set.js +++ b/commands/Administration/set.js @@ -1,4 +1,4 @@ -const { SlashCommandBuilder, PermissionsBitField, InteractionContextType } = require("discord.js"); +const { SlashCommandBuilder, PermissionsBitField, InteractionContextType, ApplicationIntegrationType } = require("discord.js"); const BaseCommand = require("../../base/BaseCommand"); class Set extends BaseCommand { @@ -15,6 +15,7 @@ class Set extends BaseCommand { uk: client.translate("administration/set:DESCRIPTION", null, "uk-UA"), ru: client.translate("administration/set:DESCRIPTION", null, "ru-RU"), }) + .setIntegrationTypes([ApplicationIntegrationType.GuildInstall]) .setContexts([InteractionContextType.Guild]) .setDefaultMemberPermissions(PermissionsBitField.Flags.ManageGuild) .addStringOption(option => diff --git a/commands/Administration/setlang.js b/commands/Administration/setlang.js index eac96619..cc15639e 100644 --- a/commands/Administration/setlang.js +++ b/commands/Administration/setlang.js @@ -1,4 +1,4 @@ -const { SlashCommandBuilder, PermissionsBitField, InteractionContextType } = require("discord.js"); +const { SlashCommandBuilder, PermissionsBitField, InteractionContextType, ApplicationIntegrationType } = require("discord.js"); const BaseCommand = require("../../base/BaseCommand"); class Setlang extends BaseCommand { @@ -15,6 +15,7 @@ class Setlang extends BaseCommand { uk: client.translate("administration/setlang:DESCRIPTION", null, "uk-UA"), ru: client.translate("administration/setlang:DESCRIPTION", null, "ru-RU"), }) + .setIntegrationTypes([ApplicationIntegrationType.GuildInstall]) .setContexts([InteractionContextType.Guild]) .setDefaultMemberPermissions(PermissionsBitField.Flags.ManageGuild) .addStringOption(option => diff --git a/commands/Administration/stealemoji.js b/commands/Administration/stealemoji.js index d625d711..0a142df8 100644 --- a/commands/Administration/stealemoji.js +++ b/commands/Administration/stealemoji.js @@ -1,4 +1,4 @@ -const { SlashCommandBuilder, parseEmoji, PermissionsBitField, InteractionContextType } = require("discord.js"); +const { SlashCommandBuilder, parseEmoji, PermissionsBitField, InteractionContextType, ApplicationIntegrationType } = require("discord.js"); const BaseCommand = require("../../base/BaseCommand"); class Stealemoji extends BaseCommand { @@ -15,6 +15,7 @@ class Stealemoji extends BaseCommand { uk: client.translate("administration/stealemoji:DESCRIPTION", null, "uk-UA"), ru: client.translate("administration/stealemoji:DESCRIPTION", null, "ru-RU"), }) + .setIntegrationTypes([ApplicationIntegrationType.GuildInstall]) .setContexts([InteractionContextType.Guild]) .setDefaultMemberPermissions(PermissionsBitField.Flags.ManageGuild) .addStringOption(option => diff --git a/commands/Administration/welcome.js b/commands/Administration/welcome.js index 7ec94f89..030f4deb 100644 --- a/commands/Administration/welcome.js +++ b/commands/Administration/welcome.js @@ -1,4 +1,4 @@ -const { SlashCommandBuilder, PermissionsBitField, InteractionContextType } = require("discord.js"); +const { SlashCommandBuilder, PermissionsBitField, InteractionContextType, ApplicationIntegrationType } = require("discord.js"); const BaseCommand = require("../../base/BaseCommand"); class Welcome extends BaseCommand { @@ -15,6 +15,7 @@ class Welcome extends BaseCommand { uk: client.translate("administration/welcome:DESCRIPTION", null, "uk-UA"), ru: client.translate("administration/welcome:DESCRIPTION", null, "ru-RU"), }) + .setIntegrationTypes([ApplicationIntegrationType.GuildInstall]) .setContexts([InteractionContextType.Guild]) .setDefaultMemberPermissions(PermissionsBitField.Flags.ManageGuild) .addSubcommand(subcommand => diff --git a/commands/Beatrun Courses/courses.js b/commands/Beatrun Courses/courses.js index 6cfdf7b4..fdaf5496 100644 --- a/commands/Beatrun Courses/courses.js +++ b/commands/Beatrun Courses/courses.js @@ -1,4 +1,4 @@ -const { SlashCommandBuilder, InteractionContextType } = require("discord.js"); +const { SlashCommandBuilder, InteractionContextType, ApplicationIntegrationType } = require("discord.js"); const BaseCommand = require("../../base/BaseCommand"), fetch = require("node-fetch"); @@ -16,6 +16,7 @@ class Courses extends BaseCommand { uk: client.translate("beatrun_courses/courses:DESCRIPTION", null, "uk-UA"), ru: client.translate("beatrun_courses/courses:DESCRIPTION", null, "ru-RU"), }) + .setIntegrationTypes([ApplicationIntegrationType.GuildInstall, ApplicationIntegrationType.UserInstall]) .setContexts([InteractionContextType.Guild, InteractionContextType.BotDM, InteractionContextType.PrivateChannel]) .addStringOption(option => option @@ -26,6 +27,15 @@ class Courses extends BaseCommand { ru: client.translate("common:CODE", null, "ru-RU"), }) .setRequired(true), + ) + .addBooleanOption(option => + option + .setName("ephemeral") + .setDescription(client.translate("misc:EPHEMERAL_RESPONSE")) + .setDescriptionLocalizations({ + uk: client.translate("misc:EPHEMERAL_RESPONSE", null, "uk-UA"), + ru: client.translate("misc:EPHEMERAL_RESPONSE", null, "ru-RU"), + }), ), dirname: __dirname, ownerOnly: false, @@ -39,7 +49,7 @@ class Courses extends BaseCommand { * @param {Object} data */ async execute(client, interaction) { - await interaction.deferReply(); + await interaction.deferReply({ ephemeral: interaction.options.getBoolean("ephemeral") || false }); const code = interaction.options.getString("code"); const response = await fetch(`https://courses.jonnybro.ru/api/info/${code}`).then(res => res.json()), diff --git a/commands/Economy/achievements.js b/commands/Economy/achievements.js index 278ffab2..7fff09ac 100644 --- a/commands/Economy/achievements.js +++ b/commands/Economy/achievements.js @@ -1,4 +1,4 @@ -const { SlashCommandBuilder, InteractionContextType } = require("discord.js"); +const { SlashCommandBuilder, InteractionContextType, ApplicationIntegrationType } = require("discord.js"); const BaseCommand = require("../../base/BaseCommand"); class Achievements extends BaseCommand { @@ -15,6 +15,7 @@ class Achievements extends BaseCommand { uk: client.translate("economy/achievements:DESCRIPTION", null, "uk-UA"), ru: client.translate("economy/achievements:DESCRIPTION", null, "ru-RU"), }) + .setIntegrationTypes([ApplicationIntegrationType.GuildInstall]) .setContexts([InteractionContextType.Guild]) .addUserOption(option => option diff --git a/commands/Economy/bank.js b/commands/Economy/bank.js index 878d41ed..083018a2 100644 --- a/commands/Economy/bank.js +++ b/commands/Economy/bank.js @@ -1,4 +1,4 @@ -const { SlashCommandBuilder, InteractionContextType } = require("discord.js"); +const { SlashCommandBuilder, InteractionContextType, ApplicationIntegrationType } = require("discord.js"); const BaseCommand = require("../../base/BaseCommand"); class Bank extends BaseCommand { @@ -15,6 +15,7 @@ class Bank extends BaseCommand { uk: client.translate("economy/bank:DESCRIPTION", null, "uk-UA"), ru: client.translate("economy/bank:DESCRIPTION", null, "ru-RU"), }) + .setIntegrationTypes([ApplicationIntegrationType.GuildInstall]) .setContexts([InteractionContextType.Guild]) .addStringOption(option => option diff --git a/commands/Economy/birthdate.js b/commands/Economy/birthdate.js index 1b830895..06783671 100644 --- a/commands/Economy/birthdate.js +++ b/commands/Economy/birthdate.js @@ -1,4 +1,4 @@ -const { SlashCommandBuilder, InteractionContextType } = require("discord.js"); +const { SlashCommandBuilder, InteractionContextType, ApplicationIntegrationType } = require("discord.js"); const BaseCommand = require("../../base/BaseCommand"); class Birthdate extends BaseCommand { @@ -15,6 +15,7 @@ class Birthdate extends BaseCommand { uk: client.translate("economy/birthdate:DESCRIPTION", null, "uk-UA"), ru: client.translate("economy/birthdate:DESCRIPTION", null, "ru-RU"), }) + .setIntegrationTypes([ApplicationIntegrationType.GuildInstall, ApplicationIntegrationType.UserInstall]) .setContexts([InteractionContextType.BotDM, InteractionContextType.Guild, InteractionContextType.PrivateChannel]) .addIntegerOption(option => option @@ -65,6 +66,15 @@ class Birthdate extends BaseCommand { uk: client.translate("economy/birthdate:CLEAR", null, "uk-UA"), ru: client.translate("economy/birthdate:CLEAR", null, "ru-RU"), }), + ) + .addBooleanOption(option => + option + .setName("ephemeral") + .setDescription(client.translate("misc:EPHEMERAL_RESPONSE")) + .setDescriptionLocalizations({ + uk: client.translate("misc:EPHEMERAL_RESPONSE", null, "uk-UA"), + ru: client.translate("misc:EPHEMERAL_RESPONSE", null, "ru-RU"), + }), ), dirname: __dirname, ownerOnly: false, @@ -77,6 +87,8 @@ class Birthdate extends BaseCommand { * @param {import("discord.js").ChatInputCommandInteraction} interaction */ async execute(client, interaction) { + await interaction.deferReply({ ephemeral: interaction.options.getBoolean("ephemeral") || false }); + const userData = interaction.data.user; if (interaction.options.getBoolean("clear")) { @@ -85,7 +97,7 @@ class Birthdate extends BaseCommand { return interaction.success("economy/birthdate:SUCCESS", { date: "none", - }); + }, { edit: true }); } const day = interaction.options.getInteger("day"), @@ -97,9 +109,9 @@ class Birthdate extends BaseCommand { const d = Math.floor(date.getTime() / 1000); - if (!(day == date.getDate() && month - 1 == date.getMonth() && year == date.getFullYear())) return interaction.error("economy/birthdate:INVALID_DATE"); - if (date.getTime() > Date.now()) return interaction.error("economy/birthdate:DATE_TOO_HIGH"); - if (date.getTime() < Date.now() - 2.523e12) return interaction.error("economy/birthdate:DATE_TOO_LOW"); + if (!(day == date.getDate() && month - 1 == date.getMonth() && year == date.getFullYear())) return interaction.error("economy/birthdate:INVALID_DATE", null, { edit: true }); + if (date.getTime() > Date.now()) return interaction.error("economy/birthdate:DATE_TOO_HIGH", null, { edit: true }); + if (date.getTime() < Date.now() - 2.523e12) return interaction.error("economy/birthdate:DATE_TOO_LOW", null, { edit: true }); userData.birthdate = d; @@ -107,7 +119,7 @@ class Birthdate extends BaseCommand { interaction.success("economy/birthdate:SUCCESS", { date: ``, - }); + }, { edit: true }); } } diff --git a/commands/Economy/divorce.js b/commands/Economy/divorce.js index 3059f27d..3b4ee72a 100644 --- a/commands/Economy/divorce.js +++ b/commands/Economy/divorce.js @@ -1,4 +1,4 @@ -const { SlashCommandBuilder, InteractionContextType } = require("discord.js"); +const { SlashCommandBuilder, InteractionContextType, ApplicationIntegrationType } = require("discord.js"); const BaseCommand = require("../../base/BaseCommand"); class Divorce extends BaseCommand { @@ -15,6 +15,7 @@ class Divorce extends BaseCommand { uk: client.translate("economy/divorce:DESCRIPTION", null, "uk-UA"), ru: client.translate("economy/divorce:DESCRIPTION", null, "ru-RU"), }) + .setIntegrationTypes([ApplicationIntegrationType.GuildInstall]) .setContexts([InteractionContextType.Guild]), dirname: __dirname, ownerOnly: false, diff --git a/commands/Economy/leaderboard.js b/commands/Economy/leaderboard.js index 45839117..c7dc056e 100644 --- a/commands/Economy/leaderboard.js +++ b/commands/Economy/leaderboard.js @@ -1,4 +1,4 @@ -const { SlashCommandBuilder, InteractionContextType } = require("discord.js"); +const { SlashCommandBuilder, InteractionContextType, ApplicationIntegrationType } = require("discord.js"); const BaseCommand = require("../../base/BaseCommand"); class Leaderboard extends BaseCommand { @@ -15,6 +15,7 @@ class Leaderboard extends BaseCommand { uk: client.translate("economy/leaderboard:DESCRIPTION", null, "uk-UA"), ru: client.translate("economy/leaderboard:DESCRIPTION", null, "ru-RU"), }) + .setIntegrationTypes([ApplicationIntegrationType.GuildInstall]) .setContexts([InteractionContextType.Guild]) .addStringOption(option => option diff --git a/commands/Economy/marry.js b/commands/Economy/marry.js index 9efbd316..bbe59872 100644 --- a/commands/Economy/marry.js +++ b/commands/Economy/marry.js @@ -1,4 +1,4 @@ -const { SlashCommandBuilder, ActionRowBuilder, ButtonBuilder, ButtonStyle, InteractionContextType } = require("discord.js"); +const { SlashCommandBuilder, ActionRowBuilder, ButtonBuilder, ButtonStyle, InteractionContextType, ApplicationIntegrationType } = require("discord.js"); const BaseCommand = require("../../base/BaseCommand"), pendings = {}; @@ -16,6 +16,7 @@ class Marry extends BaseCommand { uk: client.translate("economy/marry:DESCRIPTION", null, "uk-UA"), ru: client.translate("economy/marry:DESCRIPTION", null, "ru-RU"), }) + .setIntegrationTypes([ApplicationIntegrationType.GuildInstall]) .setContexts([InteractionContextType.Guild]) .addUserOption(option => option diff --git a/commands/Economy/money.js b/commands/Economy/money.js index 1695c77b..b6565b31 100644 --- a/commands/Economy/money.js +++ b/commands/Economy/money.js @@ -1,4 +1,4 @@ -const { SlashCommandBuilder, InteractionContextType } = require("discord.js"); +const { SlashCommandBuilder, InteractionContextType, ApplicationIntegrationType } = require("discord.js"); const BaseCommand = require("../../base/BaseCommand"); class Money extends BaseCommand { @@ -15,6 +15,7 @@ class Money extends BaseCommand { uk: client.translate("economy/money:DESCRIPTION", null, "uk-UA"), ru: client.translate("economy/money:DESCRIPTION", null, "ru-RU"), }) + .setIntegrationTypes([ApplicationIntegrationType.GuildInstall]) .setContexts([InteractionContextType.Guild]) .addUserOption(option => option @@ -39,10 +40,9 @@ class Money extends BaseCommand { await interaction.deferReply(); const member = interaction.options.getMember("user") || interaction.member; - if (member.user.bot) return interaction.error("economy/money:BOT_USER"); + if (member.user.bot) return interaction.error("economy/money:BOT_USER", null, { edit: true }); const memberData = member.id === interaction.user.id ? interaction.data.member : await client.getMemberData(member.id, interaction.guildId); - const guilds = client.guilds.cache.filter(g => g.members.cache.find(m => m.id === member.id)); let globalMoney = 0; diff --git a/commands/Economy/pay.js b/commands/Economy/pay.js index 632e8f1a..3d11cc14 100644 --- a/commands/Economy/pay.js +++ b/commands/Economy/pay.js @@ -1,4 +1,4 @@ -const { SlashCommandBuilder, InteractionContextType } = require("discord.js"); +const { SlashCommandBuilder, InteractionContextType, ApplicationIntegrationType } = require("discord.js"); const BaseCommand = require("../../base/BaseCommand"); class Pay extends BaseCommand { @@ -15,6 +15,7 @@ class Pay extends BaseCommand { uk: client.translate("economy/pay:DESCRIPTION", null, "uk-UA"), ru: client.translate("economy/pay:DESCRIPTION", null, "ru-RU"), }) + .setIntegrationTypes([ApplicationIntegrationType.GuildInstall]) .setContexts([InteractionContextType.Guild]) .addUserOption(option => option diff --git a/commands/Economy/profile.js b/commands/Economy/profile.js index 27bceaf4..dc1d94a9 100644 --- a/commands/Economy/profile.js +++ b/commands/Economy/profile.js @@ -1,4 +1,4 @@ -const { SlashCommandBuilder, InteractionContextType } = require("discord.js"); +const { SlashCommandBuilder, InteractionContextType, ApplicationIntegrationType } = require("discord.js"); const BaseCommand = require("../../base/BaseCommand"); class Profile extends BaseCommand { @@ -15,6 +15,7 @@ class Profile extends BaseCommand { uk: client.translate("economy/profile:DESCRIPTION", null, "uk-UA"), ru: client.translate("economy/profile:DESCRIPTION", null, "ru-RU"), }) + .setIntegrationTypes([ApplicationIntegrationType.GuildInstall]) .setContexts([InteractionContextType.Guild]) .addUserOption(option => option diff --git a/commands/Economy/rep.js b/commands/Economy/rep.js index 4ab20383..d56e05de 100644 --- a/commands/Economy/rep.js +++ b/commands/Economy/rep.js @@ -1,4 +1,4 @@ -const { SlashCommandBuilder, InteractionContextType } = require("discord.js"); +const { SlashCommandBuilder, InteractionContextType, ApplicationIntegrationType } = require("discord.js"); const BaseCommand = require("../../base/BaseCommand"); class Rep extends BaseCommand { @@ -15,6 +15,7 @@ class Rep extends BaseCommand { uk: client.translate("economy/rep:DESCRIPTION", null, "uk-UA"), ru: client.translate("economy/rep:DESCRIPTION", null, "ru-RU"), }) + .setIntegrationTypes([ApplicationIntegrationType.GuildInstall]) .setContexts([InteractionContextType.Guild]) .addUserOption(option => option diff --git a/commands/Economy/rob.js b/commands/Economy/rob.js index 3fcc4686..f32d94eb 100644 --- a/commands/Economy/rob.js +++ b/commands/Economy/rob.js @@ -1,4 +1,4 @@ -const { SlashCommandBuilder, InteractionContextType } = require("discord.js"); +const { SlashCommandBuilder, InteractionContextType, ApplicationIntegrationType } = require("discord.js"); const BaseCommand = require("../../base/BaseCommand"); class Rob extends BaseCommand { @@ -15,6 +15,7 @@ class Rob extends BaseCommand { uk: client.translate("economy/rob:DESCRIPTION", null, "uk-UA"), ru: client.translate("economy/rob:DESCRIPTION", null, "ru-RU"), }) + .setIntegrationTypes([ApplicationIntegrationType.GuildInstall]) .setContexts([InteractionContextType.Guild]) .addUserOption(option => option diff --git a/commands/Economy/setbio.js b/commands/Economy/setbio.js index 52357c12..25ca9f13 100644 --- a/commands/Economy/setbio.js +++ b/commands/Economy/setbio.js @@ -1,4 +1,4 @@ -const { SlashCommandBuilder, InteractionContextType } = require("discord.js"); +const { SlashCommandBuilder, InteractionContextType, ApplicationIntegrationType, escapeEscape, escapeCodeBlock, escapeInlineCode } = require("discord.js"); const BaseCommand = require("../../base/BaseCommand"); class Setbio extends BaseCommand { @@ -15,6 +15,7 @@ class Setbio extends BaseCommand { uk: client.translate("economy/setbio:DESCRIPTION", null, "uk-UA"), ru: client.translate("economy/setbio:DESCRIPTION", null, "ru-RU"), }) + .setIntegrationTypes([ApplicationIntegrationType.GuildInstall, ApplicationIntegrationType.UserInstall]) .setContexts([InteractionContextType.BotDM, InteractionContextType.Guild]) .addStringOption(option => option @@ -25,6 +26,15 @@ class Setbio extends BaseCommand { ru: client.translate("economy/profile:BIO", null, "ru-RU"), }) .setRequired(true), + ) + .addBooleanOption(option => + option + .setName("ephemeral") + .setDescription(client.translate("misc:EPHEMERAL_RESPONSE")) + .setDescriptionLocalizations({ + uk: client.translate("misc:EPHEMERAL_RESPONSE", null, "uk-UA"), + ru: client.translate("misc:EPHEMERAL_RESPONSE", null, "ru-RU"), + }), ), dirname: __dirname, ownerOnly: false, @@ -37,13 +47,13 @@ class Setbio extends BaseCommand { * @param {import("discord.js").ChatInputCommandInteraction} interaction */ async execute(client, interaction) { - await interaction.deferReply({ ephemeral: true }); + await interaction.deferReply({ ephemeral: interaction.options.getBoolean("ephemeral") || false }); const userData = interaction.data.user, newBio = interaction.options.getString("text"); - if (newBio.length > 150) return interaction.error("economy/setbio:MAX_CHARACTERS"); + if (newBio.length > 150) return interaction.error("misc:MAX_150_CHARS", null, { edit: true }); - userData.bio = newBio; + userData.bio = escapeEscape(escapeCodeBlock(escapeInlineCode(newBio))).replace("@", "@\u200b"); await userData.save(); diff --git a/commands/Economy/slots.js b/commands/Economy/slots.js index 3ac304d6..060f6c25 100644 --- a/commands/Economy/slots.js +++ b/commands/Economy/slots.js @@ -1,4 +1,4 @@ -const { SlashCommandBuilder, InteractionContextType } = require("discord.js"); +const { SlashCommandBuilder, InteractionContextType, ApplicationIntegrationType } = require("discord.js"); const BaseCommand = require("../../base/BaseCommand"); class Slots extends BaseCommand { @@ -15,6 +15,7 @@ class Slots extends BaseCommand { uk: client.translate("economy/slots:DESCRIPTION", null, "uk-UA"), ru: client.translate("economy/slots:DESCRIPTION", null, "ru-RU"), }) + .setIntegrationTypes([ApplicationIntegrationType.GuildInstall]) .setContexts([InteractionContextType.Guild]) .addIntegerOption(option => option diff --git a/commands/Economy/transactions.js b/commands/Economy/transactions.js index ec666c8d..e3d231ab 100644 --- a/commands/Economy/transactions.js +++ b/commands/Economy/transactions.js @@ -1,4 +1,4 @@ -const { SlashCommandBuilder, InteractionContextType } = require("discord.js"); +const { SlashCommandBuilder, InteractionContextType, ApplicationIntegrationType } = require("discord.js"); const BaseCommand = require("../../base/BaseCommand"); class Transactions extends BaseCommand { @@ -15,6 +15,7 @@ class Transactions extends BaseCommand { uk: client.translate("economy/transactions:DESCRIPTION", null, "uk-UA"), ru: client.translate("economy/transactions:DESCRIPTION", null, "ru-RU"), }) + .setIntegrationTypes([ApplicationIntegrationType.GuildInstall]) .setContexts([InteractionContextType.Guild]) .addBooleanOption(option => option diff --git a/commands/Economy/work.js b/commands/Economy/work.js index e83e0688..03904b1f 100644 --- a/commands/Economy/work.js +++ b/commands/Economy/work.js @@ -1,4 +1,4 @@ -const { SlashCommandBuilder, parseEmoji, InteractionContextType } = require("discord.js"); +const { SlashCommandBuilder, parseEmoji, InteractionContextType, ApplicationIntegrationType } = require("discord.js"); const BaseCommand = require("../../base/BaseCommand"); class Work extends BaseCommand { @@ -15,6 +15,7 @@ class Work extends BaseCommand { uk: client.translate("economy/work:DESCRIPTION", null, "uk-UA"), ru: client.translate("economy/work:DESCRIPTION", null, "ru-RU"), }) + .setIntegrationTypes([ApplicationIntegrationType.GuildInstall]) .setContexts([InteractionContextType.Guild]), dirname: __dirname, ownerOnly: false, diff --git a/commands/Fun/8ball.js b/commands/Fun/8ball.js index 4d1eebd5..006d3b10 100644 --- a/commands/Fun/8ball.js +++ b/commands/Fun/8ball.js @@ -1,4 +1,4 @@ -const { SlashCommandBuilder, InteractionContextType } = require("discord.js"); +const { SlashCommandBuilder, InteractionContextType, ApplicationIntegrationType } = require("discord.js"); const BaseCommand = require("../../base/BaseCommand"); class Eightball extends BaseCommand { @@ -15,6 +15,7 @@ class Eightball extends BaseCommand { uk: client.translate("fun/8ball:DESCRIPTION", null, "uk-UA"), ru: client.translate("fun/8ball:DESCRIPTION", null, "ru-RU"), }) + .setIntegrationTypes([ApplicationIntegrationType.GuildInstall, ApplicationIntegrationType.UserInstall]) .setContexts([InteractionContextType.BotDM, InteractionContextType.PrivateChannel, InteractionContextType.Guild]) .addStringOption(option => option @@ -25,6 +26,15 @@ class Eightball extends BaseCommand { ru: client.translate("fun/8ball:QUESTION", null, "ru-RU"), }) .setRequired(true), + ) + .addBooleanOption(option => + option + .setName("ephemeral") + .setDescription(client.translate("misc:EPHEMERAL_RESPONSE")) + .setDescriptionLocalizations({ + uk: client.translate("misc:EPHEMERAL_RESPONSE", null, "uk-UA"), + ru: client.translate("misc:EPHEMERAL_RESPONSE", null, "ru-RU"), + }), ), dirname: __dirname, ownerOnly: false, @@ -37,7 +47,7 @@ class Eightball extends BaseCommand { * @param {import("discord.js").ChatInputCommandInteraction} interaction */ async execute(client, interaction) { - await interaction.deferReply(); + await interaction.deferReply({ ephemeral: interaction.options.getBoolean("ephemeral") || false }); const question = interaction.options.getString("question"); const embed = client.embed({ diff --git a/commands/Fun/cat.js b/commands/Fun/cat.js index b2492504..3c5948b0 100644 --- a/commands/Fun/cat.js +++ b/commands/Fun/cat.js @@ -1,4 +1,4 @@ -const { SlashCommandBuilder, InteractionContextType } = require("discord.js"); +const { SlashCommandBuilder, InteractionContextType, ApplicationIntegrationType } = require("discord.js"); const BaseCommand = require("../../base/BaseCommand"), fetch = require("node-fetch"); @@ -16,7 +16,17 @@ class Cat extends BaseCommand { uk: client.translate("fun/cat:DESCRIPTION", null, "uk-UA"), ru: client.translate("fun/cat:DESCRIPTION", null, "ru-RU"), }) - .setContexts([InteractionContextType.BotDM, InteractionContextType.PrivateChannel, InteractionContextType.Guild]), + .setIntegrationTypes([ApplicationIntegrationType.GuildInstall, ApplicationIntegrationType.UserInstall]) + .setContexts([InteractionContextType.BotDM, InteractionContextType.PrivateChannel, InteractionContextType.Guild]) + .addBooleanOption(option => + option + .setName("ephemeral") + .setDescription(client.translate("misc:EPHEMERAL_RESPONSE")) + .setDescriptionLocalizations({ + uk: client.translate("misc:EPHEMERAL_RESPONSE", null, "uk-UA"), + ru: client.translate("misc:EPHEMERAL_RESPONSE", null, "ru-RU"), + }), + ), dirname: __dirname, ownerOnly: false, }); @@ -28,7 +38,7 @@ class Cat extends BaseCommand { * @param {import("discord.js").ChatInputCommandInteraction} interaction */ async execute(client, interaction) { - await interaction.deferReply(); + await interaction.deferReply({ ephemeral: interaction.options.getBoolean("ephemeral") || false }); const res = await fetch("https://api.thecatapi.com/v1/images/search").then(r => r.json()); const cat = res[0].url; diff --git a/commands/Fun/dog.js b/commands/Fun/dog.js index ddea2071..f6960b66 100644 --- a/commands/Fun/dog.js +++ b/commands/Fun/dog.js @@ -1,4 +1,4 @@ -const { SlashCommandBuilder, InteractionContextType } = require("discord.js"); +const { SlashCommandBuilder, InteractionContextType, ApplicationIntegrationType } = require("discord.js"); const BaseCommand = require("../../base/BaseCommand"), fetch = require("node-fetch"); @@ -16,7 +16,17 @@ class Dog extends BaseCommand { uk: client.translate("fun/dog:DESCRIPTION", null, "uk-UA"), ru: client.translate("fun/dog:DESCRIPTION", null, "ru-RU"), }) - .setContexts([InteractionContextType.BotDM, InteractionContextType.PrivateChannel, InteractionContextType.Guild]), + .setIntegrationTypes([ApplicationIntegrationType.GuildInstall, ApplicationIntegrationType.UserInstall]) + .setContexts([InteractionContextType.BotDM, InteractionContextType.PrivateChannel, InteractionContextType.Guild]) + .addBooleanOption(option => + option + .setName("ephemeral") + .setDescription(client.translate("misc:EPHEMERAL_RESPONSE")) + .setDescriptionLocalizations({ + uk: client.translate("misc:EPHEMERAL_RESPONSE", null, "uk-UA"), + ru: client.translate("misc:EPHEMERAL_RESPONSE", null, "ru-RU"), + }), + ), dirname: __dirname, ownerOnly: false, }); @@ -28,7 +38,7 @@ class Dog extends BaseCommand { * @param {import("discord.js").ChatInputCommandInteraction} interaction */ async execute(client, interaction) { - await interaction.deferReply(); + await interaction.deferReply({ ephemeral: interaction.options.getBoolean("ephemeral") || false }); const res = await fetch("https://dog.ceo/api/breeds/image/random").then(r => r.json()); const dog = res.message; diff --git a/commands/Fun/lmgtfy.js b/commands/Fun/lmgtfy.js index 4360b2b3..15dd9cca 100644 --- a/commands/Fun/lmgtfy.js +++ b/commands/Fun/lmgtfy.js @@ -1,4 +1,4 @@ -const { SlashCommandBuilder, InteractionContextType } = require("discord.js"); +const { SlashCommandBuilder, InteractionContextType, ApplicationIntegrationType } = require("discord.js"); const BaseCommand = require("../../base/BaseCommand"), fetch = require("node-fetch"); @@ -16,6 +16,7 @@ class LMGTFY extends BaseCommand { uk: client.translate("fun/lmgtfy:DESCRIPTION", null, "uk-UA"), ru: client.translate("fun/lmgtfy:DESCRIPTION", null, "ru-RU"), }) + .setIntegrationTypes([ApplicationIntegrationType.GuildInstall, ApplicationIntegrationType.UserInstall]) .setContexts([InteractionContextType.BotDM, InteractionContextType.PrivateChannel, InteractionContextType.Guild]) .addStringOption(option => option @@ -36,6 +37,15 @@ class LMGTFY extends BaseCommand { ru: client.translate("fun/lmgtfy:SHORT", null, "ru-RU"), }) .setRequired(true), + ) + .addBooleanOption(option => + option + .setName("ephemeral") + .setDescription(client.translate("misc:EPHEMERAL_RESPONSE")) + .setDescriptionLocalizations({ + uk: client.translate("misc:EPHEMERAL_RESPONSE", null, "uk-UA"), + ru: client.translate("misc:EPHEMERAL_RESPONSE", null, "ru-RU"), + }), ), dirname: __dirname, ownerOnly: false, @@ -48,7 +58,7 @@ class LMGTFY extends BaseCommand { * @param {import("discord.js").ChatInputCommandInteraction} interaction */ async execute(client, interaction) { - await interaction.deferReply({ ephemeral: true }); + await interaction.deferReply({ ephemeral: interaction.options.getBoolean("ephemeral") || false }); const query = interaction.options.getString("query").replace(/[' '_]/g, "+"), short = interaction.options.getBoolean("short"), diff --git a/commands/Fun/lovecalc.js b/commands/Fun/lovecalc.js index 77caa6e7..97fbe30c 100644 --- a/commands/Fun/lovecalc.js +++ b/commands/Fun/lovecalc.js @@ -1,4 +1,4 @@ -const { SlashCommandBuilder, InteractionContextType } = require("discord.js"); +const { SlashCommandBuilder, InteractionContextType, ApplicationIntegrationType } = require("discord.js"); const BaseCommand = require("../../base/BaseCommand"), md5 = require("md5"); @@ -16,6 +16,7 @@ class Lovecalc extends BaseCommand { uk: client.translate("fun/lovecalc:DESCRIPTION", null, "uk-UA"), ru: client.translate("fun/lovecalc:DESCRIPTION", null, "ru-RU"), }) + .setIntegrationTypes([ApplicationIntegrationType.GuildInstall]) .setContexts([InteractionContextType.Guild]) .addUserOption(option => option diff --git a/commands/Fun/number.js b/commands/Fun/number.js index c9b7c280..754c90cf 100644 --- a/commands/Fun/number.js +++ b/commands/Fun/number.js @@ -1,4 +1,4 @@ -const { SlashCommandBuilder, MessageCollector, ButtonBuilder, ActionRowBuilder, ButtonStyle, ThreadAutoArchiveDuration, InteractionContextType } = require("discord.js"); +const { SlashCommandBuilder, MessageCollector, ButtonBuilder, ActionRowBuilder, ButtonStyle, ThreadAutoArchiveDuration, InteractionContextType, ApplicationIntegrationType } = require("discord.js"); const BaseCommand = require("../../base/BaseCommand"), currentGames = {}; @@ -16,7 +16,8 @@ class Number extends BaseCommand { uk: client.translate("fun/number:DESCRIPTION", null, "uk-UA"), ru: client.translate("fun/number:DESCRIPTION", null, "ru-RU"), }) - .setContexts([InteractionContextType.Guild, InteractionContextType.PrivateChannel]), + .setIntegrationTypes([ApplicationIntegrationType.GuildInstall]) + .setContexts([InteractionContextType.Guild]), dirname: __dirname, ownerOnly: false, }); diff --git a/commands/Fun/tictactoe.js b/commands/Fun/tictactoe.js index 4bb6632a..0a874081 100644 --- a/commands/Fun/tictactoe.js +++ b/commands/Fun/tictactoe.js @@ -1,4 +1,4 @@ -const { SlashCommandBuilder, InteractionContextType } = require("discord.js"); +const { SlashCommandBuilder, InteractionContextType, ApplicationIntegrationType } = require("discord.js"); const BaseCommand = require("../../base/BaseCommand"), tictactoe = require("../../helpers/tictactoe"); @@ -16,6 +16,7 @@ class TicTacToe extends BaseCommand { uk: client.translate("fun/tictactoe:DESCRIPTION", null, "uk-UA"), ru: client.translate("fun/tictactoe:DESCRIPTION", null, "ru-RU"), }) + .setIntegrationTypes([ApplicationIntegrationType.GuildInstall, ApplicationIntegrationType.UserInstall]) .setContexts([InteractionContextType.Guild, InteractionContextType.PrivateChannel]) .addUserOption(option => option @@ -38,26 +39,25 @@ class TicTacToe extends BaseCommand { * @param {import("discord.js").ChatInputCommandInteraction} interaction */ async execute(client, interaction) { - tictactoe(interaction, { + const winner = await tictactoe(interaction, { resultBtn: true, embedColor: client.config.embed.color, embedFoot: client.config.embed.footer, - }).then(async winner => { - const memberData = await client.getMemberData(winner.id, interaction.guildId); - - memberData.money += 100; - - const info = { - user: interaction.translate("economy/transactions:TTT"), - amount: 100, - date: Date.now(), - type: "got", - }; - - memberData.transactions.push(info); - - await memberData.save(); }); + + const memberData = await client.getMemberData(winner.id, interaction.guildId); + memberData.money += 100; + + const info = { + user: interaction.translate("economy/transactions:TTT"), + amount: 100, + date: Date.now(), + type: "got", + }; + + memberData.transactions.push(info); + + await memberData.save(); } } diff --git a/commands/General/afk.js b/commands/General/afk.js index efe2e362..a7d0ee68 100644 --- a/commands/General/afk.js +++ b/commands/General/afk.js @@ -1,4 +1,4 @@ -const { SlashCommandBuilder, InteractionContextType } = require("discord.js"); +const { SlashCommandBuilder, InteractionContextType, ApplicationIntegrationType, escapeEscape, escapeCodeBlock, escapeInlineCode } = require("discord.js"); const BaseCommand = require("../../base/BaseCommand"); class Afk extends BaseCommand { @@ -15,6 +15,7 @@ class Afk extends BaseCommand { uk: client.translate("general/afk:DESCRIPTION", null, "uk-UA"), ru: client.translate("general/afk:DESCRIPTION", null, "ru-RU"), }) + .setIntegrationTypes([ApplicationIntegrationType.GuildInstall, ApplicationIntegrationType.UserInstall]) .setContexts([InteractionContextType.BotDM, InteractionContextType.PrivateChannel, InteractionContextType.Guild]) .addStringOption(option => option @@ -25,6 +26,15 @@ class Afk extends BaseCommand { ru: client.translate("common:MESSAGE", null, "ru-RU"), }) .setRequired(true), + ) + .addBooleanOption(option => + option + .setName("ephemeral") + .setDescription(client.translate("misc:EPHEMERAL_RESPONSE")) + .setDescriptionLocalizations({ + uk: client.translate("misc:EPHEMERAL_RESPONSE", null, "uk-UA"), + ru: client.translate("misc:EPHEMERAL_RESPONSE", null, "ru-RU"), + }), ), dirname: __dirname, ownerOnly: false, @@ -37,17 +47,19 @@ class Afk extends BaseCommand { * @param {import("discord.js").ChatInputCommandInteraction} interaction */ async execute(client, interaction) { - await interaction.deferReply({ ephemeral: true }); + await interaction.deferReply({ ephemeral: interaction.options.getBoolean("ephemeral") || false }); const userData = interaction.data.user, - reason = interaction.options.getString("message"); + message = interaction.options.getString("message"); - userData.afk = reason; + if (message.length > 150) return interaction.error("misc:MAX_150_CHARS", null, { edit: true }); + + userData.afk = escapeEscape(escapeCodeBlock(escapeInlineCode(message))).replace("@", "@\u200b"); await userData.save(); interaction.success("general/afk:SUCCESS", { - reason, + message, }, { edit: true }); } } diff --git a/commands/General/avatar.c.js b/commands/General/avatar.c.js index d6c34eb8..33c1231e 100644 --- a/commands/General/avatar.c.js +++ b/commands/General/avatar.c.js @@ -1,4 +1,4 @@ -const { ContextMenuCommandBuilder, ApplicationCommandType, InteractionContextType } = require("discord.js"); +const { ContextMenuCommandBuilder, ApplicationCommandType, InteractionContextType, ApplicationIntegrationType } = require("discord.js"); const BaseCommand = require("../../base/BaseCommand"); class AvatarContext extends BaseCommand { @@ -11,6 +11,7 @@ class AvatarContext extends BaseCommand { command: new ContextMenuCommandBuilder() .setName("Get Avatar") .setType(ApplicationCommandType.User) + .setIntegrationTypes([ApplicationIntegrationType.GuildInstall, ApplicationIntegrationType.UserInstall]) .setContexts([InteractionContextType.BotDM, InteractionContextType.PrivateChannel, InteractionContextType.Guild]), dirname: __dirname, ownerOnly: false, diff --git a/commands/General/avatar.js b/commands/General/avatar.js index 448ac362..b953ed98 100644 --- a/commands/General/avatar.js +++ b/commands/General/avatar.js @@ -1,4 +1,4 @@ -const { SlashCommandBuilder, InteractionContextType } = require("discord.js"); +const { SlashCommandBuilder, InteractionContextType, ApplicationIntegrationType } = require("discord.js"); const BaseCommand = require("../../base/BaseCommand"); class Avatar extends BaseCommand { @@ -15,6 +15,7 @@ class Avatar extends BaseCommand { uk: client.translate("general/avatar:DESCRIPTION", null, "uk-UA"), ru: client.translate("general/avatar:DESCRIPTION", null, "ru-RU"), }) + .setIntegrationTypes([ApplicationIntegrationType.GuildInstall, ApplicationIntegrationType.UserInstall]) .setContexts([InteractionContextType.BotDM, InteractionContextType.PrivateChannel, InteractionContextType.Guild]) .addUserOption(option => option @@ -33,6 +34,15 @@ class Avatar extends BaseCommand { uk: client.translate("general/avatar:SERVER", null, "uk-UA"), ru: client.translate("general/avatar:SERVER", null, "ru-RU"), }), + ) + .addBooleanOption(option => + option + .setName("ephemeral") + .setDescription(client.translate("misc:EPHEMERAL_RESPONSE")) + .setDescriptionLocalizations({ + uk: client.translate("misc:EPHEMERAL_RESPONSE", null, "uk-UA"), + ru: client.translate("misc:EPHEMERAL_RESPONSE", null, "ru-RU"), + }), ), dirname: __dirname, ownerOnly: false, @@ -45,11 +55,13 @@ class Avatar extends BaseCommand { * @param {import("discord.js").ChatInputCommandInteraction} interaction */ async execute(client, interaction) { + await interaction.deferReply({ ephemeral: interaction.options.getBoolean("ephemeral") || false }); + const user = interaction.options.getUser("user") || interaction.user; const avatarURL = interaction.options.getBoolean("server") ? user.displayAvatarURL({ size: 2048 }) : user.avatarURL({ size: 2048 }); const embed = client.embed({ image: avatarURL }); - interaction.reply({ + interaction.editReply({ embeds: [embed], }); } diff --git a/commands/General/boosters.js b/commands/General/boosters.js index 2e3167b3..6c5946bb 100644 --- a/commands/General/boosters.js +++ b/commands/General/boosters.js @@ -1,4 +1,4 @@ -const { SlashCommandBuilder, ActionRowBuilder, ButtonBuilder, ButtonStyle, InteractionContextType } = require("discord.js"); +const { SlashCommandBuilder, ActionRowBuilder, ButtonBuilder, ButtonStyle, InteractionContextType, ApplicationIntegrationType } = require("discord.js"); const BaseCommand = require("../../base/BaseCommand"); class Boosters extends BaseCommand { @@ -15,6 +15,7 @@ class Boosters extends BaseCommand { uk: client.translate("general/boosters:DESCRIPTION", null, "uk-UA"), ru: client.translate("general/boosters:DESCRIPTION", null, "ru-RU"), }) + .setIntegrationTypes([ApplicationIntegrationType.GuildInstall]) .setContexts([InteractionContextType.Guild]), dirname: __dirname, ownerOnly: false, diff --git a/commands/General/emoji.js b/commands/General/emoji.js index b99120a5..fd7b36b7 100644 --- a/commands/General/emoji.js +++ b/commands/General/emoji.js @@ -1,4 +1,4 @@ -const { SlashCommandBuilder, parseEmoji, InteractionContextType } = require("discord.js"); +const { SlashCommandBuilder, parseEmoji, InteractionContextType, ApplicationIntegrationType } = require("discord.js"); const BaseCommand = require("../../base/BaseCommand"); class Emoji extends BaseCommand { @@ -15,6 +15,7 @@ class Emoji extends BaseCommand { uk: client.translate("general/emoji:DESCRIPTION", null, "uk-UA"), ru: client.translate("general/emoji:DESCRIPTION", null, "ru-RU"), }) + .setIntegrationTypes([ApplicationIntegrationType.GuildInstall, ApplicationIntegrationType.UserInstall]) .setContexts([InteractionContextType.BotDM, InteractionContextType.PrivateChannel, InteractionContextType.Guild]) .addStringOption(option => option @@ -25,6 +26,15 @@ class Emoji extends BaseCommand { ru: client.translate("common:EMOJI", null, "ru-RU"), }) .setRequired(true), + ) + .addBooleanOption(option => + option + .setName("ephemeral") + .setDescription(client.translate("misc:EPHEMERAL_RESPONSE")) + .setDescriptionLocalizations({ + uk: client.translate("misc:EPHEMERAL_RESPONSE", null, "uk-UA"), + ru: client.translate("misc:EPHEMERAL_RESPONSE", null, "ru-RU"), + }), ), dirname: __dirname, ownerOnly: false, @@ -37,9 +47,10 @@ class Emoji extends BaseCommand { * @param {import("discord.js").ChatInputCommandInteraction} interaction */ async execute(client, interaction) { + await interaction.deferReply({ ephemeral: interaction.options.getBoolean("ephemeral") || false }); + const rawEmoji = interaction.options.getString("emoji"); const parsedEmoji = parseEmoji(rawEmoji); - const embed = client.embed({ author: { name: interaction.translate("general/emoji:TITLE", { @@ -66,7 +77,7 @@ class Emoji extends BaseCommand { ], }); - interaction.reply({ + interaction.editReply({ embeds: [embed], }); } diff --git a/commands/General/help.js b/commands/General/help.js index 806ac743..a1d28c7c 100644 --- a/commands/General/help.js +++ b/commands/General/help.js @@ -1,4 +1,4 @@ -const { SlashCommandBuilder, ActionRowBuilder, StringSelectMenuBuilder, PermissionsBitField, InteractionContextType } = require("discord.js"); +const { SlashCommandBuilder, ActionRowBuilder, StringSelectMenuBuilder, PermissionsBitField, InteractionContextType, ApplicationIntegrationType } = require("discord.js"); const BaseCommand = require("../../base/BaseCommand"); class Help extends BaseCommand { @@ -15,6 +15,7 @@ class Help extends BaseCommand { uk: client.translate("general/help:DESCRIPTION", null, "uk-UA"), ru: client.translate("general/help:DESCRIPTION", null, "ru-RU"), }) + .setIntegrationTypes([ApplicationIntegrationType.GuildInstall, ApplicationIntegrationType.UserInstall]) .setContexts([InteractionContextType.BotDM, InteractionContextType.PrivateChannel, InteractionContextType.Guild]) .addStringOption(option => option @@ -25,6 +26,15 @@ class Help extends BaseCommand { ru: client.translate("common:COMMAND", null, "ru-RU"), }) .setAutocomplete(true), + ) + .addBooleanOption(option => + option + .setName("ephemeral") + .setDescription(client.translate("misc:EPHEMERAL_RESPONSE")) + .setDescriptionLocalizations({ + uk: client.translate("misc:EPHEMERAL_RESPONSE", null, "uk-UA"), + ru: client.translate("misc:EPHEMERAL_RESPONSE", null, "ru-RU"), + }), ), dirname: __dirname, ownerOnly: false, @@ -80,7 +90,7 @@ class Help extends BaseCommand { * @param {Object} data */ async execute(client, interaction) { - await interaction.deferReply(); + await interaction.deferReply({ ephemeral: interaction.options.getBoolean("ephemeral") || false }); const commands = [...new Map(client.commands.map(v => [v.constructor.name, v])).values()]; const categories = [... new Set(commands.map(c => c.category))]; diff --git a/commands/General/info.js b/commands/General/info.js index 27a9114c..3de340b5 100644 --- a/commands/General/info.js +++ b/commands/General/info.js @@ -1,4 +1,4 @@ -const { SlashCommandBuilder, ChannelType, InteractionContextType } = require("discord.js"); +const { SlashCommandBuilder, ChannelType, InteractionContextType, ApplicationIntegrationType } = require("discord.js"); const BaseCommand = require("../../base/BaseCommand"); class Info extends BaseCommand { @@ -15,6 +15,7 @@ class Info extends BaseCommand { uk: client.translate("general/info:DESCRIPTION", null, "uk-UA"), ru: client.translate("general/info:DESCRIPTION", null, "ru-RU"), }) + .setIntegrationTypes([ApplicationIntegrationType.GuildInstall]) .setContexts([InteractionContextType.Guild]) .addSubcommand(subcommand => subcommand diff --git a/commands/General/minecraft.js b/commands/General/minecraft.js index 654de5df..546a19cb 100644 --- a/commands/General/minecraft.js +++ b/commands/General/minecraft.js @@ -1,4 +1,4 @@ -const { SlashCommandBuilder, InteractionContextType } = require("discord.js"); +const { SlashCommandBuilder, InteractionContextType, ApplicationIntegrationType } = require("discord.js"); const BaseCommand = require("../../base/BaseCommand"), gamedig = require("gamedig"); @@ -16,6 +16,7 @@ class Minecraft extends BaseCommand { uk: client.translate("general/minecraft:DESCRIPTION", null, "uk-UA"), ru: client.translate("general/minecraft:DESCRIPTION", null, "ru-RU"), }) + .setIntegrationTypes([ApplicationIntegrationType.GuildInstall, ApplicationIntegrationType.UserInstall]) .setContexts([InteractionContextType.BotDM, InteractionContextType.PrivateChannel, InteractionContextType.Guild]) .addStringOption(option => option @@ -26,6 +27,15 @@ class Minecraft extends BaseCommand { ru: client.translate("common:IP", null, "ru-RU"), }) .setRequired(true), + ) + .addBooleanOption(option => + option + .setName("ephemeral") + .setDescription(client.translate("misc:EPHEMERAL_RESPONSE")) + .setDescriptionLocalizations({ + uk: client.translate("misc:EPHEMERAL_RESPONSE", null, "uk-UA"), + ru: client.translate("misc:EPHEMERAL_RESPONSE", null, "ru-RU"), + }), ), dirname: __dirname, ownerOnly: false, @@ -38,7 +48,7 @@ class Minecraft extends BaseCommand { * @param {import("discord.js").ChatInputCommandInteraction} interaction */ async execute(client, interaction) { - await interaction.deferReply(); + await interaction.deferReply({ ephemeral: interaction.options.getBoolean("ephemeral") || false }); const ip = interaction.options.getString("ip"); const options = { diff --git a/commands/General/ping.js b/commands/General/ping.js index 95e422a9..841c5064 100644 --- a/commands/General/ping.js +++ b/commands/General/ping.js @@ -1,4 +1,4 @@ -const { SlashCommandBuilder, InteractionContextType } = require("discord.js"); +const { SlashCommandBuilder, InteractionContextType, ApplicationIntegrationType } = require("discord.js"); const BaseCommand = require("../../base/BaseCommand"); class Ping extends BaseCommand { @@ -15,7 +15,17 @@ class Ping extends BaseCommand { uk: client.translate("general/ping:DESCRIPTION", null, "uk-UA"), ru: client.translate("general/ping:DESCRIPTION", null, "ru-RU"), }) - .setContexts([InteractionContextType.BotDM, InteractionContextType.PrivateChannel, InteractionContextType.Guild]), + .setIntegrationTypes([ApplicationIntegrationType.GuildInstall, ApplicationIntegrationType.UserInstall]) + .setContexts([InteractionContextType.BotDM, InteractionContextType.PrivateChannel, InteractionContextType.Guild]) + .addBooleanOption(option => + option + .setName("ephemeral") + .setDescription(client.translate("misc:EPHEMERAL_RESPONSE")) + .setDescriptionLocalizations({ + uk: client.translate("misc:EPHEMERAL_RESPONSE", null, "uk-UA"), + ru: client.translate("misc:EPHEMERAL_RESPONSE", null, "ru-RU"), + }), + ), dirname: __dirname, ownerOnly: false, }); @@ -27,6 +37,8 @@ class Ping extends BaseCommand { * @param {import("discord.js").ChatInputCommandInteraction} interaction */ async execute(client, interaction) { + await interaction.deferReply({ ephemeral: interaction.options.getBoolean("ephemeral") || false }); + const embed = client.embed({ author: { name: interaction.translate("general/ping:PONG"), @@ -36,7 +48,7 @@ class Ping extends BaseCommand { }), }); - interaction.reply({ + interaction.editReply({ embeds: [embed], }); } diff --git a/commands/General/remindme.js b/commands/General/remindme.js index 0030e6bc..3a784667 100644 --- a/commands/General/remindme.js +++ b/commands/General/remindme.js @@ -1,4 +1,4 @@ -const { SlashCommandBuilder, InteractionContextType } = require("discord.js"); +const { SlashCommandBuilder, InteractionContextType, ApplicationIntegrationType } = require("discord.js"); const BaseCommand = require("../../base/BaseCommand"), ms = require("ms"); @@ -16,6 +16,7 @@ class Remindme extends BaseCommand { uk: client.translate("general/remindme:DESCRIPTION", null, "uk-UA"), ru: client.translate("general/remindme:DESCRIPTION", null, "ru-RU"), }) + .setIntegrationTypes([ApplicationIntegrationType.GuildInstall, ApplicationIntegrationType.UserInstall]) .setContexts([InteractionContextType.BotDM, InteractionContextType.PrivateChannel, InteractionContextType.Guild]) .addStringOption(option => option @@ -36,6 +37,15 @@ class Remindme extends BaseCommand { ru: client.translate("common:MESSAGE", null, "ru-RU"), }) .setRequired(true), + ) + .addBooleanOption(option => + option + .setName("ephemeral") + .setDescription(client.translate("misc:EPHEMERAL_RESPONSE")) + .setDescriptionLocalizations({ + uk: client.translate("misc:EPHEMERAL_RESPONSE", null, "uk-UA"), + ru: client.translate("misc:EPHEMERAL_RESPONSE", null, "ru-RU"), + }), ), dirname: __dirname, ownerOnly: false, @@ -48,7 +58,13 @@ class Remindme extends BaseCommand { * @param {import("discord.js").ChatInputCommandInteraction} interaction */ async execute(client, interaction) { - await interaction.deferReply({ ephemeral: true }); + await interaction.deferReply({ ephemeral: interaction.options.getBoolean("ephemeral") || false }); + + const conditions = ["s", "m", "h", "d", "w", "y"], + time = interaction.options.getString("time"), + message = interaction.options.getString("message"); + + if (!conditions.some(s => time.includes(s))) return interaction.error("general/remindme:TIME", null, { edit: true }); const userData = interaction.data.user; @@ -57,9 +73,9 @@ class Remindme extends BaseCommand { const dateNow = Date.now(); const reminder = { - message: interaction.options.getString("message"), + message: message, createdAt: Math.floor(dateNow / 1000), - sendAt: Math.floor((dateNow + ms(interaction.options.getString("time"))) / 1000), + sendAt: Math.floor((dateNow + ms(time)) / 1000), }; userData.reminds.push(reminder); diff --git a/commands/General/reminds.js b/commands/General/reminds.js index d36d2ca0..c0564893 100644 --- a/commands/General/reminds.js +++ b/commands/General/reminds.js @@ -1,4 +1,4 @@ -const { SlashCommandBuilder, ActionRowBuilder, ButtonBuilder, ButtonStyle, InteractionContextType } = require("discord.js"); +const { SlashCommandBuilder, ActionRowBuilder, ButtonBuilder, ButtonStyle, InteractionContextType, ApplicationIntegrationType } = require("discord.js"); const BaseCommand = require("../../base/BaseCommand"); class Reminds extends BaseCommand { @@ -15,7 +15,17 @@ class Reminds extends BaseCommand { uk: client.translate("general/reminds:DESCRIPTION", null, "uk-UA"), ru: client.translate("general/reminds:DESCRIPTION", null, "ru-RU"), }) - .setContexts([InteractionContextType.BotDM, InteractionContextType.PrivateChannel, InteractionContextType.Guild]), + .setIntegrationTypes([ApplicationIntegrationType.GuildInstall, ApplicationIntegrationType.UserInstall]) + .setContexts([InteractionContextType.BotDM, InteractionContextType.PrivateChannel, InteractionContextType.Guild]) + .addBooleanOption(option => + option + .setName("ephemeral") + .setDescription(client.translate("misc:EPHEMERAL_RESPONSE")) + .setDescriptionLocalizations({ + uk: client.translate("misc:EPHEMERAL_RESPONSE", null, "uk-UA"), + ru: client.translate("misc:EPHEMERAL_RESPONSE", null, "ru-RU"), + }), + ), dirname: __dirname, ownerOnly: false, }); @@ -160,7 +170,7 @@ class Reminds extends BaseCommand { * @param {import("discord.js").ChatInputCommandInteraction} interaction */ async execute(client, interaction) { - await interaction.deferReply({ ephemeral: true }); + await interaction.deferReply({ ephemeral: interaction.options.getBoolean("ephemeral") || false }); const reminds = interaction.data.user.reminds; if (reminds.length === 0) return interaction.error("general/reminds:NO_REMINDS", null, { edit: true }); diff --git a/commands/General/report.js b/commands/General/report.js index 410197b1..8d3ab71c 100644 --- a/commands/General/report.js +++ b/commands/General/report.js @@ -1,4 +1,4 @@ -const { SlashCommandBuilder, parseEmoji, InteractionContextType } = require("discord.js"); +const { SlashCommandBuilder, parseEmoji, InteractionContextType, ApplicationIntegrationType } = require("discord.js"); const BaseCommand = require("../../base/BaseCommand"); class Report extends BaseCommand { @@ -15,6 +15,7 @@ class Report extends BaseCommand { uk: client.translate("general/report:DESCRIPTION", null, "uk-UA"), ru: client.translate("general/report:DESCRIPTION", null, "ru-RU"), }) + .setIntegrationTypes([ApplicationIntegrationType.GuildInstall]) .setContexts([InteractionContextType.Guild]) .addUserOption(option => option diff --git a/commands/General/shorturl.js b/commands/General/shorturl.js index 325827b3..22a10755 100644 --- a/commands/General/shorturl.js +++ b/commands/General/shorturl.js @@ -1,4 +1,4 @@ -const { SlashCommandBuilder, InteractionContextType } = require("discord.js"); +const { SlashCommandBuilder, InteractionContextType, ApplicationIntegrationType } = require("discord.js"); const BaseCommand = require("../../base/BaseCommand"), fetch = require("node-fetch"); @@ -16,6 +16,7 @@ class Shorturl extends BaseCommand { uk: client.translate("general/shorturl:DESCRIPTION", null, "uk-UA"), ru: client.translate("general/shorturl:DESCRIPTION", null, "ru-RU"), }) + .setIntegrationTypes([ApplicationIntegrationType.GuildInstall, ApplicationIntegrationType.UserInstall]) .setContexts([InteractionContextType.BotDM, InteractionContextType.PrivateChannel, InteractionContextType.Guild]) .addStringOption(option => option @@ -26,6 +27,15 @@ class Shorturl extends BaseCommand { ru: client.translate("common:URL", null, "ru-RU"), }) .setRequired(true), + ) + .addBooleanOption(option => + option + .setName("ephemeral") + .setDescription(client.translate("misc:EPHEMERAL_RESPONSE")) + .setDescriptionLocalizations({ + uk: client.translate("misc:EPHEMERAL_RESPONSE", null, "uk-UA"), + ru: client.translate("misc:EPHEMERAL_RESPONSE", null, "ru-RU"), + }), ), dirname: __dirname, ownerOnly: false, @@ -38,7 +48,7 @@ class Shorturl extends BaseCommand { * @param {import("discord.js").ChatInputCommandInteraction} interaction */ async execute(client, interaction) { - await interaction.deferReply({ ephemeral: true }); + await interaction.deferReply({ ephemeral: interaction.options.getBoolean("ephemeral") || false }); const url = interaction.options.getString("url"); const res = await fetch("https://i.jonnybro.ru/api/shorten", { diff --git a/commands/General/stats.js b/commands/General/stats.js index 11652bec..7cc62b61 100644 --- a/commands/General/stats.js +++ b/commands/General/stats.js @@ -1,4 +1,4 @@ -const { SlashCommandBuilder, PermissionsBitField, version: discordJsVersion, InteractionContextType } = require("discord.js"); +const { SlashCommandBuilder, PermissionsBitField, version: discordJsVersion, InteractionContextType, ApplicationIntegrationType } = require("discord.js"); const BaseCommand = require("../../base/BaseCommand"); class Stats extends BaseCommand { @@ -15,7 +15,17 @@ class Stats extends BaseCommand { uk: client.translate("general/stats:DESCRIPTION", null, "uk-UA"), ru: client.translate("general/stats:DESCRIPTION", null, "ru-RU"), }) - .setContexts([InteractionContextType.BotDM, InteractionContextType.PrivateChannel, InteractionContextType.Guild]), + .setIntegrationTypes([ApplicationIntegrationType.GuildInstall, ApplicationIntegrationType.UserInstall]) + .setContexts([InteractionContextType.BotDM, InteractionContextType.PrivateChannel, InteractionContextType.Guild]) + .addBooleanOption(option => + option + .setName("ephemeral") + .setDescription(client.translate("misc:EPHEMERAL_RESPONSE")) + .setDescriptionLocalizations({ + uk: client.translate("misc:EPHEMERAL_RESPONSE", null, "uk-UA"), + ru: client.translate("misc:EPHEMERAL_RESPONSE", null, "ru-RU"), + }), + ), dirname: __dirname, ownerOnly: false, }); @@ -27,6 +37,8 @@ class Stats extends BaseCommand { * @param {import("discord.js").ChatInputCommandInteraction} interaction */ async execute(client, interaction) { + await interaction.deferReply({ ephemeral: interaction.options.getBoolean("ephemeral") || false }); + const servers = client.guilds.cache.size; let users = 0; client.guilds.cache.forEach(g => { @@ -88,7 +100,7 @@ class Stats extends BaseCommand { ], }); - interaction.reply({ + interaction.editReply({ embeds: [embed], }); } diff --git a/commands/General/suggest.js b/commands/General/suggest.js index d2fa0ccb..4804ce61 100644 --- a/commands/General/suggest.js +++ b/commands/General/suggest.js @@ -1,4 +1,4 @@ -const { SlashCommandBuilder, parseEmoji, InteractionContextType } = require("discord.js"); +const { SlashCommandBuilder, parseEmoji, InteractionContextType, ApplicationIntegrationType } = require("discord.js"); const BaseCommand = require("../../base/BaseCommand"); class Suggest extends BaseCommand { @@ -15,6 +15,7 @@ class Suggest extends BaseCommand { uk: client.translate("general/suggest:DESCRIPTION", null, "uk-UA"), ru: client.translate("general/suggest:DESCRIPTION", null, "ru-RU"), }) + .setIntegrationTypes([ApplicationIntegrationType.GuildInstall]) .setContexts([InteractionContextType.Guild]) .addStringOption(option => option diff --git a/commands/General/whois.js b/commands/General/whois.js index b1a48e54..2d223206 100644 --- a/commands/General/whois.js +++ b/commands/General/whois.js @@ -1,4 +1,4 @@ -const { SlashCommandBuilder, InteractionContextType } = require("discord.js"); +const { SlashCommandBuilder, InteractionContextType, ApplicationIntegrationType } = require("discord.js"); const BaseCommand = require("../../base/BaseCommand"), fetch = require("node-fetch"); @@ -16,6 +16,7 @@ class Whois extends BaseCommand { uk: client.translate("general/whois:DESCRIPTION", null, "uk-UA"), ru: client.translate("general/whois:DESCRIPTION", null, "ru-RU"), }) + .setIntegrationTypes([ApplicationIntegrationType.GuildInstall, ApplicationIntegrationType.UserInstall]) .setContexts([InteractionContextType.BotDM, InteractionContextType.PrivateChannel, InteractionContextType.Guild]) .addStringOption(option => option @@ -26,6 +27,15 @@ class Whois extends BaseCommand { ru: client.translate("common:IP", null, "ru-RU"), }) .setRequired(true), + ) + .addBooleanOption(option => + option + .setName("ephemeral") + .setDescription(client.translate("misc:EPHEMERAL_RESPONSE")) + .setDescriptionLocalizations({ + uk: client.translate("misc:EPHEMERAL_RESPONSE", null, "uk-UA"), + ru: client.translate("misc:EPHEMERAL_RESPONSE", null, "ru-RU"), + }), ), dirname: __dirname, ownerOnly: false, @@ -38,12 +48,12 @@ class Whois extends BaseCommand { * @param {import("discord.js").ChatInputCommandInteraction} interaction */ async execute(client, interaction) { - await interaction.deferReply(); + await interaction.deferReply({ ephemeral: interaction.options.getBoolean("ephemeral") || false }); const ip = interaction.options.getString("ip"), whois = await fetch(`http://ip-api.com/json/${ip}?fields=status,message,continent,continentCode,country,countryCode,region,regionName,city,zip,timezone,currency,isp,org,as,mobile,proxy,hosting,query`).then(response => response.json()); - if (whois.status === "fail") return interaction.editReply({ content: interaction.translate("general/whois:ERROR", { ip }) }); + if (whois.status === "fail") return interaction.error("general/whois:ERROR", { ip }, { edit: true }); const embed = client.embed({ title: interaction.translate("general/whois:INFO_ABOUT", { diff --git a/commands/IAT/checkjar.js b/commands/IAT/checkjar.js index c3ec3cdb..8618c3f4 100644 --- a/commands/IAT/checkjar.js +++ b/commands/IAT/checkjar.js @@ -1,4 +1,4 @@ -const { SlashCommandBuilder, InteractionContextType } = require("discord.js"); +const { SlashCommandBuilder, InteractionContextType, ApplicationIntegrationType } = require("discord.js"); const BaseCommand = require("../../base/BaseCommand"), fetch = require("node-fetch"), moment = require("moment"); @@ -17,6 +17,7 @@ class Checkjar extends BaseCommand { uk: client.translate("iat/checkjar:DESCRIPTION", null, "uk-UA"), ru: client.translate("iat/checkjar:DESCRIPTION", null, "ru-RU"), }) + .setIntegrationTypes([ApplicationIntegrationType.GuildInstall]) .setContexts([InteractionContextType.Guild]), dirname: __dirname, ownerOnly: false, diff --git a/commands/Moderation/clear.js b/commands/Moderation/clear.js index 74aa1020..abdb41b2 100644 --- a/commands/Moderation/clear.js +++ b/commands/Moderation/clear.js @@ -1,4 +1,4 @@ -const { SlashCommandBuilder, ActionRowBuilder, ButtonBuilder, ButtonStyle, PermissionsBitField, InteractionContextType } = require("discord.js"); +const { SlashCommandBuilder, ActionRowBuilder, ButtonBuilder, ButtonStyle, PermissionsBitField, InteractionContextType, ApplicationIntegrationType } = require("discord.js"); const BaseCommand = require("../../base/BaseCommand"); class Clear extends BaseCommand { @@ -15,6 +15,7 @@ class Clear extends BaseCommand { uk: client.translate("moderation/clear:DESCRIPTION", null, "uk-UA"), ru: client.translate("moderation/clear:DESCRIPTION", null, "ru-RU"), }) + .setIntegrationTypes([ApplicationIntegrationType.GuildInstall]) .setContexts([InteractionContextType.Guild]) .setDefaultMemberPermissions(PermissionsBitField.Flags.ManageMessages) .addStringOption(option => @@ -117,7 +118,7 @@ class Clear extends BaseCommand { } }); } else { - if (isNaN(option) || parseInt(option) < 1) return interaction.error("misc:OPTION_NAN_ALL", null, { ephemeral: true }); + if (isNaN(option) || parseInt(option) < 1) return interaction.error("misc:OPTION_NAN_ALL", null, { edit: true }); let messages = await interaction.channel.messages.fetch({ limit: option }); diff --git a/commands/Moderation/clearwarns.js b/commands/Moderation/clearwarns.js index fb3cf082..6766298c 100644 --- a/commands/Moderation/clearwarns.js +++ b/commands/Moderation/clearwarns.js @@ -1,4 +1,4 @@ -const { SlashCommandBuilder, PermissionsBitField, InteractionContextType } = require("discord.js"); +const { SlashCommandBuilder, PermissionsBitField, InteractionContextType, ApplicationIntegrationType } = require("discord.js"); const BaseCommand = require("../../base/BaseCommand"); class Clearwarns extends BaseCommand { @@ -15,6 +15,7 @@ class Clearwarns extends BaseCommand { uk: client.translate("moderation/clearwarns:DESCRIPTION", null, "uk-UA"), ru: client.translate("moderation/clearwarns:DESCRIPTION", null, "ru-RU"), }) + .setIntegrationTypes([ApplicationIntegrationType.GuildInstall]) .setContexts([InteractionContextType.Guild]) .setDefaultMemberPermissions(PermissionsBitField.Flags.ManageMessages) .addUserOption(option => diff --git a/commands/Moderation/giveaway.js b/commands/Moderation/giveaway.js index 761312da..f62318ba 100644 --- a/commands/Moderation/giveaway.js +++ b/commands/Moderation/giveaway.js @@ -1,4 +1,4 @@ -const { SlashCommandBuilder, PermissionsBitField, InteractionContextType } = require("discord.js"); +const { SlashCommandBuilder, PermissionsBitField, InteractionContextType, ApplicationIntegrationType } = require("discord.js"); const BaseCommand = require("../../base/BaseCommand"), ms = require("ms"); @@ -16,6 +16,7 @@ class Giveaway extends BaseCommand { uk: client.translate("moderation/giveaway:DESCRIPTION", null, "uk-UA"), ru: client.translate("moderation/giveaway:DESCRIPTION", null, "ru-RU"), }) + .setIntegrationTypes([ApplicationIntegrationType.GuildInstall]) .setContexts([InteractionContextType.Guild]) .setDefaultMemberPermissions(PermissionsBitField.Flags.ManageMessages) .addSubcommand(subcommand => diff --git a/commands/Moderation/poll.js b/commands/Moderation/poll.js deleted file mode 100644 index 3098a08c..00000000 --- a/commands/Moderation/poll.js +++ /dev/null @@ -1,119 +0,0 @@ -const { SlashCommandBuilder, ActionRowBuilder, ButtonBuilder, ButtonStyle, PermissionsBitField, parseEmoji, InteractionContextType } = require("discord.js"); -const BaseCommand = require("../../base/BaseCommand"); - -class Poll extends BaseCommand { - /** - * - * @param {import("../../base/Client")} client - */ - constructor(client) { - super({ - command: new SlashCommandBuilder() - .setName("poll") - .setDescription(client.translate("moderation/poll:DESCRIPTION")) - .setDescriptionLocalizations({ - uk: client.translate("moderation/poll:DESCRIPTION", null, "uk-UA"), - ru: client.translate("moderation/poll:DESCRIPTION", null, "ru-RU"), - }) - .setContexts([InteractionContextType.Guild]) - .setDefaultMemberPermissions(PermissionsBitField.Flags.ManageMessages) - .addStringOption(option => - option - .setName("question") - .setDescription(client.translate("moderation/poll:QUESTION")) - .setDescriptionLocalizations({ - uk: client.translate("moderation/poll:QUESTION", null, "uk-UA"), - ru: client.translate("moderation/poll:QUESTION", null, "ru-RU"), - }) - .setRequired(true), - ), - dirname: __dirname, - ownerOnly: false, - }); - } - - /** - * - * @param {import("../../base/Client")} client - * @param {import("discord.js").ChatInputCommandInteraction} interaction - */ - async execute(client, interaction) { - const question = interaction.options.getString("question"); - - const row = new ActionRowBuilder().addComponents( - new ButtonBuilder().setCustomId("poll_everyone").setLabel("@everyone").setStyle(ButtonStyle.Primary), - new ButtonBuilder().setCustomId("poll_here").setLabel("@here").setStyle(ButtonStyle.Primary), - new ButtonBuilder().setCustomId("poll_nothing").setLabel(interaction.translate("moderation/poll:NOTHING")).setStyle(ButtonStyle.Primary), - new ButtonBuilder().setCustomId("poll_cancel").setLabel(interaction.translate("common:CANCEL")).setStyle(ButtonStyle.Danger), - ); - - await interaction.reply({ - content: interaction.translate("moderation/poll:SELECT_MENTION"), - ephemeral: true, - components: [row], - }); - - let mention = null; - const filter = i => i.user.id === interaction.user.id; - const collector = interaction.channel.createMessageComponentCollector({ filter, idle: 15 * 1000 }); - - collector.on("collect", async i => { - if (i.isButton()) { - if (i.customId === "poll_everyone") { - mention = "||@everyone||"; - i.update({ - content: interaction.translate("moderation/poll:POLL_SENDED"), - components: [], - }); - } else if (i.customId === "poll_here") { - mention = "||@here||"; - i.update({ - content: interaction.translate("moderation/poll:POLL_SENDED"), - components: [], - }); - } else if (i.customId === "poll_nothing") { - mention = null; - i.update({ - content: interaction.translate("moderation/poll:POLL_SENDED"), - components: [], - }); - } else if (i.customId === "poll_cancel") { - return i.update({ - content: interaction.translate("misc:SELECT_CANCELED"), - components: [], - }); - } - - const cool = parseEmoji(client.customEmojis.cool).id; - const notcool = parseEmoji(client.customEmojis.notcool).id; - - const embed = client.embed({ - author: interaction.translate("moderation/poll:TITLE"), - fields: [ - { - name: "\u200B", - value: question, - }, - { - name: "\u200B", - value: interaction.translate("moderation/poll:REACT", { - success: cool.toString(), - error: notcool.toString(), - }), - }, - ], - }); - - return interaction.channel.send({ - content: mention, - embeds: [embed], - }).then(async m => { - await m.react(cool); - await m.react(notcool); - }); - } - }); - } -} - -module.exports = Poll; diff --git a/commands/Moderation/unban.js b/commands/Moderation/unban.js index b587d6bf..68bc4f55 100644 --- a/commands/Moderation/unban.js +++ b/commands/Moderation/unban.js @@ -1,4 +1,4 @@ -const { SlashCommandBuilder, PermissionsBitField, InteractionContextType } = require("discord.js"); +const { SlashCommandBuilder, PermissionsBitField, InteractionContextType, ApplicationIntegrationType } = require("discord.js"); const BaseCommand = require("../../base/BaseCommand"); class Unban extends BaseCommand { @@ -15,6 +15,7 @@ class Unban extends BaseCommand { uk: client.translate("moderation/unban:DESCRIPTION", null, "uk-UA"), ru: client.translate("moderation/unban:DESCRIPTION", null, "ru-RU"), }) + .setIntegrationTypes([ApplicationIntegrationType.GuildInstall]) .setContexts([InteractionContextType.Guild]) .setDefaultMemberPermissions(PermissionsBitField.Flags.ManageMessages) .addStringOption(option => diff --git a/commands/Moderation/untimeout.js b/commands/Moderation/untimeout.js index 7b4d97d1..0f339f99 100644 --- a/commands/Moderation/untimeout.js +++ b/commands/Moderation/untimeout.js @@ -1,4 +1,4 @@ -const { SlashCommandBuilder, PermissionsBitField, InteractionContextType } = require("discord.js"); +const { SlashCommandBuilder, PermissionsBitField, InteractionContextType, ApplicationIntegrationType } = require("discord.js"); const BaseCommand = require("../../base/BaseCommand"); class Ban extends BaseCommand { @@ -15,6 +15,7 @@ class Ban extends BaseCommand { uk: client.translate("moderation/untimeout:DESCRIPTION", null, "uk-UA"), ru: client.translate("moderation/untimeout:DESCRIPTION", null, "ru-RU"), }) + .setIntegrationTypes([ApplicationIntegrationType.GuildInstall]) .setContexts([InteractionContextType.Guild]) .setDefaultMemberPermissions(PermissionsBitField.Flags.ModerateMembers) .addUserOption(option => diff --git a/commands/Moderation/warn.c.js b/commands/Moderation/warn.c.js index 1cada311..cd35caee 100644 --- a/commands/Moderation/warn.c.js +++ b/commands/Moderation/warn.c.js @@ -1,4 +1,4 @@ -const { ContextMenuCommandBuilder, ModalBuilder, ActionRowBuilder, TextInputBuilder, ApplicationCommandType, PermissionsBitField, TextInputStyle, InteractionContextType } = require("discord.js"); +const { ContextMenuCommandBuilder, ModalBuilder, ActionRowBuilder, TextInputBuilder, ApplicationCommandType, PermissionsBitField, TextInputStyle, InteractionContextType, ApplicationIntegrationType } = require("discord.js"); const BaseCommand = require("../../base/BaseCommand"); class WarnContext extends BaseCommand { @@ -11,6 +11,7 @@ class WarnContext extends BaseCommand { command: new ContextMenuCommandBuilder() .setName("Give Warn") .setType(ApplicationCommandType.User) + .setIntegrationTypes([ApplicationIntegrationType.GuildInstall]) .setContexts([InteractionContextType.Guild]) .setDefaultMemberPermissions(PermissionsBitField.Flags.ManageMessages), dirname: __dirname, @@ -66,11 +67,6 @@ class WarnContext extends BaseCommand { if (submitted) { const reason = submitted.fields.getTextInputValue("warn_reason"); - - // const sanctions = memberData.sanctions.filter(s => s.type === "warn").length; - // const banCount = data.guildData.plugins.warnsSanctions.ban; - // const kickCount = data.guildData.plugins.warnsSanctions.kick; - const caseInfo = { moderator: interaction.member.id, date: Date.now(), @@ -97,67 +93,6 @@ class WarnContext extends BaseCommand { ], }); - /* - if (banCount) { - if (sanctions >= banCount) { - member.send({ - content: interaction.translate("moderation/ban:BANNED_DM", { - user: member.user, - moderator: interaction.user.getUsername(), - server: interaction.guild.name, - reason, - }), - }); - - caseInfo.type = "ban"; - - embed - .setAuthor({ - name: interaction.translate("moderation/warn:BAN"), - }) - .setColor(client.config.embed.color); - - interaction.guild.members.ban(member).catch(() => {}); - - interaction.followUp({ - content: interaction.translate("moderation/setwarns:AUTO_BAN", { - user: member.user.getUsername(), - count: `${banCount} ${client.functions.getNoun(banCount, interaction.translate("misc:NOUNS:WARNS:1"), interaction.translate("misc:NOUNS:WARNS:2"), interaction.translate("misc:NOUNS:WARNS:5"))}`, - }), - }); - } - } - - if (kickCount) { - if (sanctions >= kickCount) { - member.send({ - content: interaction.translate("moderation/kick:KICKED_DM", { - user: member.user, - moderator: interaction.user.getUsername(), - server: interaction.guild.name, - reason, - }), - }); - - caseInfo.type = "kick"; - - embed - .setAuthor({ - name: interaction.translate("moderation/warn:KICK"), - }) - .setColor(client.config.embed.color); - - member.kick().catch(() => {}); - - interaction.followUp({ - content: interaction.translate("moderation/setwarns:AUTO_KICK", { - user: member.user.getUsername(), - count: `${kickCount} ${client.functions.getNoun(kickCount, interaction.translate("misc:NOUNS:WARNS:1"), interaction.translate("misc:NOUNS:WARNS:2"), interaction.translate("misc:NOUNS:WARNS:5"))}`, - }), - }); - } - } */ - try { await member.send({ content: interaction.translate("moderation/warn:WARNED_DM", { diff --git a/commands/Moderation/warns.js b/commands/Moderation/warns.js index 8863f4a5..86bcf187 100644 --- a/commands/Moderation/warns.js +++ b/commands/Moderation/warns.js @@ -1,4 +1,4 @@ -const { SlashCommandBuilder, PermissionsBitField, InteractionContextType } = require("discord.js"); +const { SlashCommandBuilder, PermissionsBitField, InteractionContextType, ApplicationIntegrationType } = require("discord.js"); const BaseCommand = require("../../base/BaseCommand"); class Warns extends BaseCommand { @@ -15,6 +15,7 @@ class Warns extends BaseCommand { uk: client.translate("moderation/warns:DESCRIPTION", null, "uk-UA"), ru: client.translate("moderation/warns:DESCRIPTION", null, "ru-RU"), }) + .setIntegrationTypes([ApplicationIntegrationType.GuildInstall]) .setContexts([InteractionContextType.Guild]) .setDefaultMemberPermissions(PermissionsBitField.Flags.ManageMessages) .addUserOption(option => diff --git a/commands/Music/back.js b/commands/Music/back.js index 2db4d9cd..6c39fcda 100644 --- a/commands/Music/back.js +++ b/commands/Music/back.js @@ -1,4 +1,4 @@ -const { SlashCommandBuilder, InteractionContextType } = require("discord.js"); +const { SlashCommandBuilder, InteractionContextType, ApplicationIntegrationType } = require("discord.js"); const BaseCommand = require("../../base/BaseCommand"); class Back extends BaseCommand { @@ -15,6 +15,7 @@ class Back extends BaseCommand { uk: client.translate("music/back:DESCRIPTION", null, "uk-UA"), ru: client.translate("music/back:DESCRIPTION", null, "ru-RU"), }) + .setIntegrationTypes([ApplicationIntegrationType.GuildInstall, ApplicationIntegrationType.UserInstall]) .setContexts([InteractionContextType.PrivateChannel, InteractionContextType.Guild]), dirname: __dirname, ownerOnly: false, diff --git a/commands/Music/clips.js b/commands/Music/clips.js index a2ce12cd..a217a2bc 100644 --- a/commands/Music/clips.js +++ b/commands/Music/clips.js @@ -1,4 +1,4 @@ -const { SlashCommandBuilder, PermissionsBitField, InteractionContextType } = require("discord.js"), +const { SlashCommandBuilder, PermissionsBitField, InteractionContextType, ApplicationIntegrationType } = require("discord.js"), { QueryType } = require("discord-player"); const BaseCommand = require("../../base/BaseCommand"), fs = require("fs"); @@ -17,6 +17,7 @@ class Clips extends BaseCommand { uk: client.translate("music/clips:DESCRIPTION", null, "uk-UA"), ru: client.translate("music/clips:DESCRIPTION", null, "ru-RU"), }) + .setIntegrationTypes([ApplicationIntegrationType.GuildInstall, ApplicationIntegrationType.UserInstall]) .setContexts([InteractionContextType.PrivateChannel, InteractionContextType.Guild]) .addStringOption(option => option diff --git a/commands/Music/loop.js b/commands/Music/loop.js index f92a56c3..91fb32e3 100644 --- a/commands/Music/loop.js +++ b/commands/Music/loop.js @@ -1,4 +1,4 @@ -const { SlashCommandBuilder, InteractionContextType } = require("discord.js"), +const { SlashCommandBuilder, InteractionContextType, ApplicationIntegrationType } = require("discord.js"), { QueueRepeatMode } = require("discord-player"); const BaseCommand = require("../../base/BaseCommand"); @@ -16,6 +16,7 @@ class Loop extends BaseCommand { uk: client.translate("music/loop:DESCRIPTION", null, "uk-UA"), ru: client.translate("music/loop:DESCRIPTION", null, "ru-RU"), }) + .setIntegrationTypes([ApplicationIntegrationType.GuildInstall, ApplicationIntegrationType.UserInstall]) .setContexts([InteractionContextType.PrivateChannel, InteractionContextType.Guild]) .addStringOption(option => option diff --git a/commands/Music/nowplaying.js b/commands/Music/nowplaying.js index 3dd0f902..921b5ccc 100644 --- a/commands/Music/nowplaying.js +++ b/commands/Music/nowplaying.js @@ -1,4 +1,4 @@ -const { SlashCommandBuilder, ActionRowBuilder, ButtonBuilder, ButtonStyle, StringSelectMenuBuilder, StringSelectMenuOptionBuilder, InteractionContextType } = require("discord.js"), +const { SlashCommandBuilder, ActionRowBuilder, ButtonBuilder, ButtonStyle, StringSelectMenuBuilder, StringSelectMenuOptionBuilder, InteractionContextType, ApplicationIntegrationType } = require("discord.js"), { QueueRepeatMode } = require("discord-player"); const BaseCommand = require("../../base/BaseCommand"); @@ -16,6 +16,7 @@ class Nowplaying extends BaseCommand { uk: client.translate("music/nowplaying:DESCRIPTION", null, "uk-UA"), ru: client.translate("music/nowplaying:DESCRIPTION", null, "ru-RU"), }) + .setIntegrationTypes([ApplicationIntegrationType.GuildInstall, ApplicationIntegrationType.UserInstall]) .setContexts([InteractionContextType.PrivateChannel, InteractionContextType.Guild]), dirname: __dirname, ownerOnly: false, diff --git a/commands/Music/play.c.js b/commands/Music/play.c.js index 7b0251ac..6b2671fe 100644 --- a/commands/Music/play.c.js +++ b/commands/Music/play.c.js @@ -1,4 +1,4 @@ -const { ContextMenuCommandBuilder, ApplicationCommandType, PermissionsBitField, InteractionContextType } = require("discord.js"); +const { ContextMenuCommandBuilder, ApplicationCommandType, PermissionsBitField, InteractionContextType, ApplicationIntegrationType } = require("discord.js"); const BaseCommand = require("../../base/BaseCommand"); class PlayContext extends BaseCommand { @@ -11,6 +11,7 @@ class PlayContext extends BaseCommand { command: new ContextMenuCommandBuilder() .setName("Add to Queue") .setType(ApplicationCommandType.Message) + .setIntegrationTypes([ApplicationIntegrationType.GuildInstall, ApplicationIntegrationType.UserInstall]) .setContexts([InteractionContextType.PrivateChannel, InteractionContextType.Guild]), dirname: __dirname, ownerOnly: false, diff --git a/commands/Music/play.js b/commands/Music/play.js index 79647beb..55c08d5f 100644 --- a/commands/Music/play.js +++ b/commands/Music/play.js @@ -1,4 +1,4 @@ -const { SlashCommandBuilder, PermissionsBitField, InteractionContextType } = require("discord.js"), +const { SlashCommandBuilder, PermissionsBitField, InteractionContextType, ApplicationIntegrationType } = require("discord.js"), { QueryType } = require("discord-player"); const BaseCommand = require("../../base/BaseCommand"); @@ -16,6 +16,7 @@ class Play extends BaseCommand { uk: client.translate("music/play:DESCRIPTION", null, "uk-UA"), ru: client.translate("music/play:DESCRIPTION", null, "ru-RU"), }) + .setIntegrationTypes([ApplicationIntegrationType.GuildInstall, ApplicationIntegrationType.UserInstall]) .setContexts([InteractionContextType.PrivateChannel, InteractionContextType.Guild]) .addStringOption(option => option diff --git a/commands/Music/queue.js b/commands/Music/queue.js index 0ebb4f86..8e1d051d 100644 --- a/commands/Music/queue.js +++ b/commands/Music/queue.js @@ -1,4 +1,4 @@ -const { SlashCommandBuilder, ActionRowBuilder, StringSelectMenuBuilder, StringSelectMenuOptionBuilder, ButtonBuilder, ButtonStyle, InteractionContextType } = require("discord.js"); +const { SlashCommandBuilder, ActionRowBuilder, StringSelectMenuBuilder, StringSelectMenuOptionBuilder, ButtonBuilder, ButtonStyle, InteractionContextType, ApplicationIntegrationType } = require("discord.js"); const BaseCommand = require("../../base/BaseCommand"); class Queue extends BaseCommand { @@ -15,6 +15,7 @@ class Queue extends BaseCommand { uk: client.translate("music/queue:DESCRIPTION", null, "uk-UA"), ru: client.translate("music/queue:DESCRIPTION", null, "ru-RU"), }) + .setIntegrationTypes([ApplicationIntegrationType.GuildInstall, ApplicationIntegrationType.UserInstall]) .setContexts([InteractionContextType.PrivateChannel, InteractionContextType.Guild]), dirname: __dirname, ownerOnly: false, diff --git a/commands/Music/seek.js b/commands/Music/seek.js index ed0d353c..49d1ae58 100644 --- a/commands/Music/seek.js +++ b/commands/Music/seek.js @@ -1,4 +1,4 @@ -const { SlashCommandBuilder, InteractionContextType } = require("discord.js"); +const { SlashCommandBuilder, InteractionContextType, ApplicationIntegrationType } = require("discord.js"); const BaseCommand = require("../../base/BaseCommand"); class Seek extends BaseCommand { @@ -15,6 +15,7 @@ class Seek extends BaseCommand { uk: client.translate("music/seek:DESCRIPTION", null, "uk-UA"), ru: client.translate("music/seek:DESCRIPTION", null, "ru-RU"), }) + .setIntegrationTypes([ApplicationIntegrationType.GuildInstall, ApplicationIntegrationType.UserInstall]) .setContexts([InteractionContextType.PrivateChannel, InteractionContextType.Guild]) .addIntegerOption(option => option diff --git a/commands/Music/shuffle.js b/commands/Music/shuffle.js index bccf90f2..e2b2e9c4 100644 --- a/commands/Music/shuffle.js +++ b/commands/Music/shuffle.js @@ -1,4 +1,4 @@ -const { SlashCommandBuilder, InteractionContextType } = require("discord.js"); +const { SlashCommandBuilder, InteractionContextType, ApplicationIntegrationType } = require("discord.js"); const BaseCommand = require("../../base/BaseCommand"); class Shuffle extends BaseCommand { @@ -15,6 +15,7 @@ class Shuffle extends BaseCommand { uk: client.translate("music/shuffle:DESCRIPTION", null, "uk-UA"), ru: client.translate("music/shuffle:DESCRIPTION", null, "ru-RU"), }) + .setIntegrationTypes([ApplicationIntegrationType.GuildInstall, ApplicationIntegrationType.UserInstall]) .setContexts([InteractionContextType.PrivateChannel, InteractionContextType.Guild]), dirname: __dirname, ownerOnly: false, diff --git a/commands/Music/skip.js b/commands/Music/skip.js index 6f4b6384..bb0443f0 100644 --- a/commands/Music/skip.js +++ b/commands/Music/skip.js @@ -1,4 +1,4 @@ -const { SlashCommandBuilder, InteractionContextType } = require("discord.js"); +const { SlashCommandBuilder, InteractionContextType, ApplicationIntegrationType } = require("discord.js"); const BaseCommand = require("../../base/BaseCommand"); class Skip extends BaseCommand { @@ -15,6 +15,7 @@ class Skip extends BaseCommand { uk: client.translate("music/skip:DESCRIPTION", null, "uk-UA"), ru: client.translate("music/skip:DESCRIPTION", null, "ru-RU"), }) + .setIntegrationTypes([ApplicationIntegrationType.GuildInstall, ApplicationIntegrationType.UserInstall]) .setContexts([InteractionContextType.PrivateChannel, InteractionContextType.Guild]) .addIntegerOption(option => option diff --git a/commands/Music/stop.js b/commands/Music/stop.js index 7718f7ab..37103f25 100644 --- a/commands/Music/stop.js +++ b/commands/Music/stop.js @@ -1,4 +1,4 @@ -const { SlashCommandBuilder, InteractionContextType } = require("discord.js"); +const { SlashCommandBuilder, InteractionContextType, ApplicationIntegrationType } = require("discord.js"); const BaseCommand = require("../../base/BaseCommand"); class Stop extends BaseCommand { @@ -15,6 +15,7 @@ class Stop extends BaseCommand { uk: client.translate("music/stop:DESCRIPTION", null, "uk-UA"), ru: client.translate("music/stop:DESCRIPTION", null, "ru-RU"), }) + .setIntegrationTypes([ApplicationIntegrationType.GuildInstall, ApplicationIntegrationType.UserInstall]) .setContexts([InteractionContextType.PrivateChannel, InteractionContextType.Guild]), dirname: __dirname, ownerOnly: false, diff --git a/commands/Music/volume.js b/commands/Music/volume.js index b7498f29..1d779aaa 100644 --- a/commands/Music/volume.js +++ b/commands/Music/volume.js @@ -1,4 +1,4 @@ -const { SlashCommandBuilder, InteractionContextType } = require("discord.js"); +const { SlashCommandBuilder, InteractionContextType, ApplicationIntegrationType } = require("discord.js"); const BaseCommand = require("../../base/BaseCommand"); class Volume extends BaseCommand { @@ -15,6 +15,7 @@ class Volume extends BaseCommand { uk: client.translate("music/volume:DESCRIPTION", null, "uk-UA"), ru: client.translate("music/volume:DESCRIPTION", null, "ru-RU"), }) + .setIntegrationTypes([ApplicationIntegrationType.GuildInstall, ApplicationIntegrationType.UserInstall]) .setContexts([InteractionContextType.PrivateChannel, InteractionContextType.Guild]) .addIntegerOption(option => option diff --git a/commands/NSFW/nsfw.js b/commands/NSFW/nsfw.js index 8ab565f7..1805c2f1 100644 --- a/commands/NSFW/nsfw.js +++ b/commands/NSFW/nsfw.js @@ -1,4 +1,4 @@ -const { SlashCommandBuilder, ActionRowBuilder, StringSelectMenuBuilder, AttachmentBuilder, InteractionContextType } = require("discord.js"); +const { SlashCommandBuilder, ActionRowBuilder, StringSelectMenuBuilder, AttachmentBuilder, InteractionContextType, ApplicationIntegrationType } = require("discord.js"); const BaseCommand = require("../../base/BaseCommand"), fetch = require("node-fetch"); @@ -16,6 +16,7 @@ class NSFW extends BaseCommand { uk: client.translate("nsfw/nsfw:DESCRIPTION", null, "uk-UA"), ru: client.translate("nsfw/nsfw:DESCRIPTION", null, "ru-RU"), }) + .setIntegrationTypes([ApplicationIntegrationType.GuildInstall, ApplicationIntegrationType.UserInstall]) .setContexts([InteractionContextType.BotDM, InteractionContextType.PrivateChannel, InteractionContextType.Guild]), dirname: __dirname, ownerOnly: false, diff --git a/commands/Owner/debug.js b/commands/Owner/debug.js index 58c7079b..086b7826 100644 --- a/commands/Owner/debug.js +++ b/commands/Owner/debug.js @@ -1,4 +1,4 @@ -const { SlashCommandBuilder, InteractionContextType } = require("discord.js"); +const { SlashCommandBuilder, InteractionContextType, ApplicationIntegrationType } = require("discord.js"); const BaseCommand = require("../../base/BaseCommand"); class Debug extends BaseCommand { @@ -15,6 +15,7 @@ class Debug extends BaseCommand { uk: client.translate("owner/debug:DESCRIPTION", null, "uk-UA"), ru: client.translate("owner/debug:DESCRIPTION", null, "ru-RU"), }) + .setIntegrationTypes([ApplicationIntegrationType.GuildInstall]) .setContexts([InteractionContextType.Guild]) .addSubcommand(subcommand => subcommand diff --git a/commands/Owner/eval.js b/commands/Owner/eval.js index 865b7c19..a70d58ba 100644 --- a/commands/Owner/eval.js +++ b/commands/Owner/eval.js @@ -1,4 +1,4 @@ -const { SlashCommandBuilder, InteractionContextType } = require("discord.js"); +const { SlashCommandBuilder, InteractionContextType, ApplicationIntegrationType } = require("discord.js"); const BaseCommand = require("../../base/BaseCommand"); class Eval extends BaseCommand { @@ -15,6 +15,7 @@ class Eval extends BaseCommand { uk: client.translate("owner/eval:DESCRIPTION", null, "uk-UA"), ru: client.translate("owner/eval:DESCRIPTION", null, "ru-RU"), }) + .setIntegrationTypes([ApplicationIntegrationType.GuildInstall, ApplicationIntegrationType.UserInstall]) .setContexts([InteractionContextType.BotDM, InteractionContextType.PrivateChannel, InteractionContextType.Guild]) .addStringOption(option => option diff --git a/commands/Owner/reload.js b/commands/Owner/reload.js index fc7105ec..c5315e32 100644 --- a/commands/Owner/reload.js +++ b/commands/Owner/reload.js @@ -1,4 +1,4 @@ -const { SlashCommandBuilder, InteractionContextType } = require("discord.js"); +const { SlashCommandBuilder, InteractionContextType, ApplicationIntegrationType } = require("discord.js"); const BaseCommand = require("../../base/BaseCommand"), i18next = require("i18next"); // autoUpdateDocs = require("../../helpers/autoUpdateDocs"); @@ -17,6 +17,7 @@ class Reload extends BaseCommand { uk: client.translate("owner/reload:DESCRIPTION", null, "uk-UA"), ru: client.translate("owner/reload:DESCRIPTION", null, "ru-RU"), }) + .setIntegrationTypes([ApplicationIntegrationType.GuildInstall, ApplicationIntegrationType.UserInstall]) .setContexts([InteractionContextType.BotDM, InteractionContextType.PrivateChannel, InteractionContextType.Guild]) .addStringOption(option => option @@ -40,6 +41,8 @@ class Reload extends BaseCommand { * @param {import("discord.js").ChatInputCommandInteraction} interaction */ async execute(client, interaction) { + await interaction.deferReply({ ephemeral: true }); + const command = interaction.options.getString("command"), cmd = client.commands.get(command); if (!cmd) return interaction.error("owner/reload:NOT_FOUND", { command }, { ephemeral: true }); @@ -53,7 +56,7 @@ class Reload extends BaseCommand { interaction.success("owner/reload:SUCCESS", { command: cmd.command.name, - }, { ephemeral: true }); + }, { edit: true }); } /** diff --git a/commands/Owner/say.js b/commands/Owner/say.js index d2089e1c..be2a85d5 100644 --- a/commands/Owner/say.js +++ b/commands/Owner/say.js @@ -1,4 +1,4 @@ -const { SlashCommandBuilder, InteractionContextType } = require("discord.js"); +const { SlashCommandBuilder, InteractionContextType, ApplicationIntegrationType } = require("discord.js"); const BaseCommand = require("../../base/BaseCommand"); class Say extends BaseCommand { @@ -15,6 +15,7 @@ class Say extends BaseCommand { uk: client.translate("owner/say:DESCRIPTION", null, "uk-UA"), ru: client.translate("owner/say:DESCRIPTION", null, "ru-RU"), }) + .setIntegrationTypes([ApplicationIntegrationType.GuildInstall]) .setContexts([InteractionContextType.Guild]) .addStringOption(option => option diff --git a/commands/Owner/servers.js b/commands/Owner/servers.js index 4d586148..e759f0d9 100644 --- a/commands/Owner/servers.js +++ b/commands/Owner/servers.js @@ -1,4 +1,4 @@ -const { SlashCommandBuilder, ActionRowBuilder, ButtonBuilder, ButtonStyle, InteractionContextType } = require("discord.js"); +const { SlashCommandBuilder, ActionRowBuilder, ButtonBuilder, ButtonStyle, InteractionContextType, ApplicationIntegrationType } = require("discord.js"); const BaseCommand = require("../../base/BaseCommand"); class Servers extends BaseCommand { @@ -15,6 +15,7 @@ class Servers extends BaseCommand { uk: client.translate("owner/servers:DESCRIPTION", null, "uk-UA"), ru: client.translate("owner/servers:DESCRIPTION", null, "ru-RU"), }) + .setIntegrationTypes([ApplicationIntegrationType.GuildInstall, ApplicationIntegrationType.UserInstall]) .setContexts([InteractionContextType.BotDM, InteractionContextType.PrivateChannel, InteractionContextType.Guild]), dirname: __dirname, ownerOnly: true, diff --git a/commands/Tickets/adduser.js b/commands/Tickets/adduser.js index a5e2c95f..86c63ac9 100644 --- a/commands/Tickets/adduser.js +++ b/commands/Tickets/adduser.js @@ -1,4 +1,4 @@ -const { SlashCommandBuilder, PermissionsBitField, InteractionContextType } = require("discord.js"); +const { SlashCommandBuilder, PermissionsBitField, InteractionContextType, ApplicationIntegrationType } = require("discord.js"); const BaseCommand = require("../../base/BaseCommand"); class AddUser extends BaseCommand { @@ -15,6 +15,7 @@ class AddUser extends BaseCommand { uk: client.translate("tickets/adduser:DESCRIPTION", null, "uk-UA"), ru: client.translate("tickets/adduser:DESCRIPTION", null, "ru-RU"), }) + .setIntegrationTypes([ApplicationIntegrationType.GuildInstall]) .setContexts([InteractionContextType.Guild]) .setDefaultMemberPermissions(PermissionsBitField.Flags.ManageMessages) .addUserOption(option => diff --git a/commands/Tickets/closeticket.js b/commands/Tickets/closeticket.js index 9c2f04eb..acfb02b2 100644 --- a/commands/Tickets/closeticket.js +++ b/commands/Tickets/closeticket.js @@ -1,4 +1,4 @@ -const { SlashCommandBuilder, PermissionsBitField, ButtonBuilder, ButtonStyle, ActionRowBuilder, InteractionContextType } = require("discord.js"); +const { SlashCommandBuilder, PermissionsBitField, ButtonBuilder, ButtonStyle, ActionRowBuilder, InteractionContextType, ApplicationIntegrationType } = require("discord.js"); const BaseCommand = require("../../base/BaseCommand"); class CloseTicket extends BaseCommand { @@ -15,6 +15,7 @@ class CloseTicket extends BaseCommand { uk: client.translate("tickets/closeticket:DESCRIPTION", null, "uk-UA"), ru: client.translate("tickets/closeticket:DESCRIPTION", null, "ru-RU"), }) + .setIntegrationTypes([ApplicationIntegrationType.GuildInstall]) .setContexts([InteractionContextType.Guild]) .setDefaultMemberPermissions(PermissionsBitField.Flags.ManageMessages), dirname: __dirname, diff --git a/commands/Tickets/createticketembed.js b/commands/Tickets/createticketembed.js index 8ae6f950..c12e409f 100644 --- a/commands/Tickets/createticketembed.js +++ b/commands/Tickets/createticketembed.js @@ -1,4 +1,4 @@ -const { SlashCommandBuilder, PermissionsBitField, ButtonBuilder, ButtonStyle, ActionRowBuilder, InteractionContextType } = require("discord.js"); +const { SlashCommandBuilder, PermissionsBitField, ButtonBuilder, ButtonStyle, ActionRowBuilder, InteractionContextType, ApplicationIntegrationType } = require("discord.js"); const BaseCommand = require("../../base/BaseCommand"); class CreateTicketEmbed extends BaseCommand { @@ -15,6 +15,7 @@ class CreateTicketEmbed extends BaseCommand { uk: client.translate("tickets/createticketembed:DESCRIPTION", null, "uk-UA"), ru: client.translate("tickets/createticketembed:DESCRIPTION", null, "ru-RU"), }) + .setIntegrationTypes([ApplicationIntegrationType.GuildInstall]) .setContexts([InteractionContextType.Guild]) .setDefaultMemberPermissions(PermissionsBitField.Flags.ManageGuild), dirname: __dirname, diff --git a/commands/Tickets/removeuser.js b/commands/Tickets/removeuser.js index 20cececa..2dc0c6cd 100644 --- a/commands/Tickets/removeuser.js +++ b/commands/Tickets/removeuser.js @@ -1,4 +1,4 @@ -const { SlashCommandBuilder, PermissionsBitField, InteractionContextType } = require("discord.js"); +const { SlashCommandBuilder, PermissionsBitField, InteractionContextType, ApplicationIntegrationType } = require("discord.js"); const BaseCommand = require("../../base/BaseCommand"); class RemoveUser extends BaseCommand { @@ -15,6 +15,7 @@ class RemoveUser extends BaseCommand { uk: client.translate("tickets/removeuser:DESCRIPTION", null, "uk-UA"), ru: client.translate("tickets/removeuser:DESCRIPTION", null, "ru-RU"), }) + .setIntegrationTypes([ApplicationIntegrationType.GuildInstall]) .setContexts([InteractionContextType.Guild]) .setDefaultMemberPermissions(PermissionsBitField.Flags.ManageMessages) .addUserOption(option => diff --git a/events/CommandHandler.js b/events/CommandHandler.js index ef8921c6..07280578 100644 --- a/events/CommandHandler.js +++ b/events/CommandHandler.js @@ -1,4 +1,4 @@ -const { SlashCommandBuilder, InteractionType } = require("discord.js"); +const { InteractionType } = require("discord.js"); const BaseEvent = require("../base/BaseEvent"); class CommandHandler extends BaseEvent { diff --git a/events/MessageHandler.js b/events/MessageHandler.js index 1b4cad3f..79e050f1 100644 --- a/events/MessageHandler.js +++ b/events/MessageHandler.js @@ -108,7 +108,7 @@ class MessageCreate extends BaseEvent { message.mentions.users.forEach(async u => { const userData = await client.getUserData(u.id); - if (userData.afk) message.replyT("general/afk:IS_AFK", { user: u.getUsername(), reason: userData.afk }, { ephemeral: true }); + if (userData.afk) message.replyT("general/afk:IS_AFK", { user: u.getUsername(), message: userData.afk }, { ephemeral: true }); }); } diff --git a/helpers/tictactoe.js b/helpers/tictactoe.js index c8076587..0ead49c5 100644 --- a/helpers/tictactoe.js +++ b/helpers/tictactoe.js @@ -22,6 +22,7 @@ const { ButtonBuilder, ActionRowBuilder, ButtonStyle, ComponentType } = require( * oEmoji => (Emoji ID) String * * idleEmoji => (Emoji ID) String + * @returns {Promise} */ async function tictactoe(interaction, options = {}) { // eslint-disable-next-line no-async-promise-executor @@ -256,8 +257,8 @@ async function tictactoe(interaction, options = {}) { if (won["<:O_:863314110560993340>"] != false) if (Args.user == 0) { - const wonner = await client.users.fetch(fighters[1]).catch(console.error); - resolve(wonner); + const won = await client.users.fetch(fighters[1]).catch(console.error); + resolve(won); if (options.resultBtn === true) return m @@ -308,8 +309,8 @@ async function tictactoe(interaction, options = {}) { m.react("⭕"); }); } else if (Args.user == 1) { - const wonner = await client.users.fetch(fighters[0]).catch(console.error); - resolve(wonner); + const won = await client.users.fetch(fighters[0]).catch(console.error); + resolve(won); if (options.resultBtn === true) return m @@ -370,8 +371,8 @@ async function tictactoe(interaction, options = {}) { if (Args.c1.emoji == x_emoji && Args.c2.emoji == x_emoji && Args.c3.emoji == x_emoji) won["<:X_:863314044781723668>"] = true; if (won["<:X_:863314044781723668>"] != false) if (Args.user == 0) { - const wonner = await client.users.fetch(fighters[1]).catch(console.error); - resolve(wonner); + const won = await client.users.fetch(fighters[1]).catch(console.error); + resolve(won); if (options.resultBtn === true) return m @@ -420,8 +421,8 @@ async function tictactoe(interaction, options = {}) { m.react("❌"); }); } else if (Args.user == 1) { - const wonner = await client.users.fetch(fighters[0]).catch(console.error); - resolve(wonner); + const won = await client.users.fetch(fighters[0]).catch(console.error); + resolve(won); if (options.resultBtn === true) return m diff --git a/languages/en-US/economy/setbio.json b/languages/en-US/economy/setbio.json index cc9b01b3..ad3a49cf 100644 --- a/languages/en-US/economy/setbio.json +++ b/languages/en-US/economy/setbio.json @@ -2,6 +2,5 @@ "DESCRIPTION": "Sets your bio", "USAGE": "[text]", "EXAMPLES": "setbio text:My name is Johnny :shock:", - "MAX_CHARACTERS": "Your bio should not exceed 150 characters", "SUCCESS": "Your bio has been changed" } \ No newline at end of file diff --git a/languages/en-US/general/afk.json b/languages/en-US/general/afk.json index 35e49d61..7b67fb9e 100644 --- a/languages/en-US/general/afk.json +++ b/languages/en-US/general/afk.json @@ -2,7 +2,7 @@ "DESCRIPTION": "Sets AFK status (users who mention you will receive a message)", "USAGE": "[message]", "EXAMPLES": "afk message:I'm busy =)", - "SUCCESS": "You are now AFK with the reason: **{{reason}}**", + "SUCCESS": "You are now AFK with the reason: **{{message}}**", "DELETED": "**{{user}}**, your AFK status has been removed", - "IS_AFK": "**{{user}}** is currently AFK, reason:\n```{{reason}}```" + "IS_AFK": "**{{user}}** is currently AFK, reason:\n```{{message}}```" } \ No newline at end of file diff --git a/languages/en-US/misc.json b/languages/en-US/misc.json index ddb4753f..11607d92 100644 --- a/languages/en-US/misc.json +++ b/languages/en-US/misc.json @@ -2,11 +2,13 @@ "BOT_USER": "You can't use this command on bots.", "CANT_YOURSELF": "You can't use this command on yourself.", "CANT_DM": "I cannot DM you. Please check your privacy settings.", + "EPHEMERAL_RESPONSE": "Make bot's response ephemeral?", "FORCE_STOP": "The game has been forcibly ended, {{user}}, nobody won (the number was {{number}}).", "LEVEL_UP": "You have reached the next level! Your new level is: **{{level}}**", "GUILD_ONLY": "This command can only be used on a server.", "HELLO_SERVER": "Hello! All my commands are available through **/**. Use to get a list of commands.", "INVALID_NUMBER_RANGE": "Please specify a number between **{{min}}** and **{{max}}**.", + "MAX_150_CHARS": "No more than 150 characters!", "MORE_THAN_ZERO": "Please specify an integer greater than 0.", "NO_ARGS": "No arguments required.", "NSFW_COMMAND": "This command can only be used in an NSFW channel.", diff --git a/languages/en-US/moderation/poll.json b/languages/en-US/moderation/poll.json deleted file mode 100644 index 02db9bb1..00000000 --- a/languages/en-US/moderation/poll.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "DESCRIPTION": "Starts a poll in the current channel", - "USAGE": "[question]", - "EXAMPLES": "poll question:Is the Earth flat?", - "QUESTION": "Question text", - "NOTHING": "No mention", - "SELECT_MENTION": "Select a mention:", - "POLL_SENDED": "Poll sent", - "REACT": "React with {{success}} or {{error}}!", - "TITLE": "📊 Poll:" -} \ No newline at end of file diff --git a/languages/ru-RU/economy/setbio.json b/languages/ru-RU/economy/setbio.json index e58bbf80..c50a665d 100644 --- a/languages/ru-RU/economy/setbio.json +++ b/languages/ru-RU/economy/setbio.json @@ -2,6 +2,5 @@ "DESCRIPTION": "Установить биографию", "USAGE": "[text]", "EXAMPLES": "setbio text:Меня зовут Жоня :shock:", - "MAX_CHARACTERS": "Ваша биография не должна превышать 150 символов", "SUCCESS": "Ваша биография изменена" } \ No newline at end of file diff --git a/languages/ru-RU/general/afk.json b/languages/ru-RU/general/afk.json index 8f4b608c..459f7eca 100644 --- a/languages/ru-RU/general/afk.json +++ b/languages/ru-RU/general/afk.json @@ -2,7 +2,7 @@ "DESCRIPTION": "Установить AFK статус (пользователь который упомянет вас получит сообщение)", "USAGE": "[message]", "EXAMPLES": "afk message:Сру =)", - "SUCCESS": "Теперь вы AFK по причине: **{{reason}}**", + "SUCCESS": "Теперь вы AFK по причине: **{{message}}**", "DELETED": "**{{user}}**, ваш AFK статус удалён", - "IS_AFK": "**{{user}}** сейчас AFK, причина:\n```{{reason}}```" + "IS_AFK": "**{{user}}** сейчас AFK, причина:\n```{{message}}```" } \ No newline at end of file diff --git a/languages/ru-RU/general/remindme.json b/languages/ru-RU/general/remindme.json index 59467b72..56f8d5e4 100644 --- a/languages/ru-RU/general/remindme.json +++ b/languages/ru-RU/general/remindme.json @@ -2,7 +2,7 @@ "DESCRIPTION": "Создать напоминание", "USAGE": "[time] [message]", "EXAMPLES": "remindme time:12h message:Использовать команду work\nremindme time:5m message:Достать курицу из морозилки!", - "TIME": "Время (Например: 10s, 5m, 2h, 1d, 3w)", + "TIME": "Время (Например: 59s, 2m, 4h, 5d, 3w, 1y)", "EMBED_SAVED": "Напоминание сохранено!", "EMBED_TIME": "Сохранено на", "EMBED_TITLE": "Напоминание", diff --git a/languages/ru-RU/misc.json b/languages/ru-RU/misc.json index 5be41346..3c36affc 100644 --- a/languages/ru-RU/misc.json +++ b/languages/ru-RU/misc.json @@ -2,11 +2,13 @@ "BOT_USER": "Вы не можете использовать эту команду на боте", "CANT_YOURSELF": "Вы не можете использовать эту команду на себе", "CANT_DM": "Я не могу отправить Вам личное сообщение, проверьте настройки конфиденциальности", + "EPHEMERAL_RESPONSE": "Сделать ответ временным?", "FORCE_STOP": "Игра принудительно окончена {{user}}, никто не победил (загаданное число - {{number}})", "LEVEL_UP": "Вы достигли следующего уровня! Ваш новый уровень: **{{level}}**", "GUILD_ONLY": "Данную команду можно использовать только на сервере", "HELLO_SERVER": "Привет! Все мои команды доступны через **/** Используйте , чтобы получить список команд", "INVALID_NUMBER_RANGE": "Укажите число от **{{min}}** до **{{max}}**", + "MAX_150_CHARS": "Не больше 150 знаков!", "MORE_THAN_ZERO": "Укажите целое число больше 0", "NO_ARGS": "Агрументы не требуются", "NSFW_COMMAND": "Данную команду можно использовать только в NSFW канале", diff --git a/languages/ru-RU/moderation/poll.json b/languages/ru-RU/moderation/poll.json deleted file mode 100644 index 7841c3d4..00000000 --- a/languages/ru-RU/moderation/poll.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "DESCRIPTION": "Запустить опрос в текущем канале", - "USAGE": "[question]", - "EXAMPLES": "poll question:Земля плоская?", - "QUESTION": "Текст вопроса", - "NOTHING": "Без упоминания", - "SELECT_MENTION": "Выберите упоминание:", - "POLL_SENDED": "Опрос отправлен", - "REACT": "Отреагируйте {{success}} или {{error}}!", - "TITLE": "📊 Опрос:" -} \ No newline at end of file diff --git a/languages/uk-UA/economy/setbio.json b/languages/uk-UA/economy/setbio.json index f2b0c380..3ce3f927 100644 --- a/languages/uk-UA/economy/setbio.json +++ b/languages/uk-UA/economy/setbio.json @@ -2,6 +2,5 @@ "DESCRIPTION": "Встановити біографію", "USAGE": "[text]", "EXAMPLES": "setbio text:Мене звуть Жоня :shock:", - "MAX_CHARACTERS": "Ваша біографія не повинна перевищувати 150 символів", "SUCCESS": "Ваша біографія змінена" } \ No newline at end of file diff --git a/languages/uk-UA/general/afk.json b/languages/uk-UA/general/afk.json index 055a22e7..06390328 100644 --- a/languages/uk-UA/general/afk.json +++ b/languages/uk-UA/general/afk.json @@ -2,7 +2,7 @@ "DESCRIPTION": "Встановити статус AFK (користувач, який згадає вас отримає повідомлення)", "USAGE": "[message]", "EXAMPLES": "afk message:Пісяю =)", - "SUCCESS": "Тепер ви AFK через: **{{reason}}**", + "SUCCESS": "Тепер ви AFK через: **{{message}}**", "DELETED": "**{{user}}**, ваш статус AFK видалено", - "IS_AFK": "**{{user}}** зараз AFK, причина:\n```{{reason}}```" + "IS_AFK": "**{{user}}** зараз AFK, причина:\n```{{message}}```" } \ No newline at end of file diff --git a/languages/uk-UA/misc.json b/languages/uk-UA/misc.json index 36cea0c7..aaf08e28 100644 --- a/languages/uk-UA/misc.json +++ b/languages/uk-UA/misc.json @@ -2,11 +2,13 @@ "BOT_USER": "Ви не можете використовувати цю команду на роботі", "CANT_YOURSELF": "Ви не можете використовувати цю команду на собі", "CANT_DM": "Я не можу надіслати Вам особисте повідомлення, перевірте налаштування конфіденційності", + "EPHEMERAL_RESPONSE": "Зробити відповідь тимчасовою?", "FORCE_STOP": "Гра примусово закінчена, {{user}}, ніхто не переміг (загадане число - {{number}})", "LEVEL_UP": "Ви досягли наступного рівня! Ваш новий рівень: **{{level}}**", "GUILD_ONLY": "Цю команду можна використовувати лише на сервері", "HELLO_SERVER": "Привіт! Всі мої команди доступні через **/** Використовуйте , щоб отримати список команд", "INVALID_NUMBER_RANGE": "Вкажіть число від **{{min}}** до **{{max}}**", + "MAX_150_CHARS": "Не більше 150 знаків!", "MORE_THAN_ZERO": "Вкажіть ціле число більше 0", "NO_ARGS": "Агрументи не потрібні", "NSFW_COMMAND": "Цю команду можна використовувати тільки в NSFW каналі", diff --git a/languages/uk-UA/moderation/poll.json b/languages/uk-UA/moderation/poll.json deleted file mode 100644 index 2871c0cd..00000000 --- a/languages/uk-UA/moderation/poll.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "DESCRIPTION": "Запустити опитування в поточному каналі", - "USAGE": "[question]", - "EXAMPLES": "poll question:Земля плоска?", - "QUESTION": "Текст питання", - "NOTHING": "Без згадки", - "SELECT_MENTION": "Виберіть згадку:", - "POLL_SENDED": "Опитування надіслано", - "REACT": "Відреагуйте {{success}} або {{error}}!", - "TITLE": "📊 Опитування:" -} \ No newline at end of file diff --git a/package.json b/package.json index 1ef9944e..6b29c19a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "jaba", - "version": "4.6.5", + "version": "4.6.6", "description": "My Discord Bot", "main": "index.js", "scripts": { @@ -30,7 +30,7 @@ "node-fetch": "^2.7.0" }, "devDependencies": { - "eslint": "^9.10.0" + "eslint": "^8.57.1" }, "eslintConfig": { "extends": "eslint:recommended", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index f85f56ce..508c5a3b 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -70,8 +70,8 @@ importers: version: 2.7.0 devDependencies: eslint: - specifier: ^9.10.0 - version: 9.10.0 + specifier: ^8.57.1 + version: 8.57.1 packages: @@ -144,37 +144,30 @@ packages: resolution: {integrity: sha512-G/M/tIiMrTAxEWRfLfQJMmGNX28IxBg4PBz8XqQhqUHLFI6TL2htpIB1iQCj144V5ee/JaKyT9/WZ0MGZWfA7A==} engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0} - '@eslint/config-array@0.18.0': - resolution: {integrity: sha512-fTxvnS1sRMu3+JjXwJG0j/i4RT9u4qJ+lqS/yCGap4lH4zZGzQ7tu+xZqQmcMZq5OBZDL4QRxQzRjkWcGt8IVw==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + '@eslint/eslintrc@2.1.4': + resolution: {integrity: sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - '@eslint/eslintrc@3.1.0': - resolution: {integrity: sha512-4Bfj15dVJdoy3RfZmmo86RK1Fwzn6SstsvK9JS+BaVKqC6QQQQyXekNaC+g+LKNgkQ+2VhGAzm6hO40AhMR3zQ==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - - '@eslint/js@9.10.0': - resolution: {integrity: sha512-fuXtbiP5GWIn8Fz+LWoOMVf/Jxm+aajZYkhi6CuEm4SxymFM+eUWzbO9qXT+L0iCkL5+KGYMCSGxo686H19S1g==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - - '@eslint/object-schema@2.1.4': - resolution: {integrity: sha512-BsWiH1yFGjXXS2yvrf5LyuoSIIbPrGUWob917o+BTKuZ7qJdxX8aJLRxs1fS9n6r7vESrq1OUqb68dANcFXuQQ==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - - '@eslint/plugin-kit@0.1.0': - resolution: {integrity: sha512-autAXT203ixhqei9xt+qkYOvY8l6LAFIdT2UXc/RPNeUVfqRF1BV94GTJyVPFKT8nFM6MyVJhjLj9E8JWvf5zQ==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + '@eslint/js@8.57.1': + resolution: {integrity: sha512-d9zaMRSTIKDLhctzH12MtXvJKSSUhaHcjV+2Z+GK+EEY7XKpP5yR4x+N3TAcHTcu963nIr+TMcCb4DBCYX1z6Q==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} '@fastify/busboy@2.1.1': resolution: {integrity: sha512-vBZP4NlzfOlerQTnba4aqZoMhE/a9HY7HRqoOPaETQcSQuWEIyZMHGfVu6w9wGtGK5fED5qRs2DteVCjOH60sA==} engines: {node: '>=14'} + '@humanwhocodes/config-array@0.13.0': + resolution: {integrity: sha512-DZLEEqFWQFiyK6h5YIeynKx7JlvCYWL0cImfSRXZ9l4Sg2efkFGTuFf6vzXjK1cq6IYkU+Eg/JizXw+TD2vRNw==} + engines: {node: '>=10.10.0'} + deprecated: Use @eslint/config-array instead + '@humanwhocodes/module-importer@1.0.1': resolution: {integrity: sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==} engines: {node: '>=12.22'} - '@humanwhocodes/retry@0.3.0': - resolution: {integrity: sha512-d2CGZR2o7fS6sWB7DG/3a95bGKQyHMACZ5aW8qGkkqQpUoZV6C0X7Pc7l4ZNMZkfNBf4VWNe9E1jRsf0G146Ew==} - engines: {node: '>=18.18'} + '@humanwhocodes/object-schema@2.0.3': + resolution: {integrity: sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA==} + deprecated: Use @eslint/object-schema instead '@mongodb-js/saslprep@1.1.9': resolution: {integrity: sha512-tVkljjeEaAhCqTzajSdgbQ6gE6f3oneVwa3iXR6csiEwXXOFsiC6Uh9iAjAhXPtqa/XMDHWjjeNH/77m/Yq2dw==} @@ -299,6 +292,9 @@ packages: '@types/ws@8.5.12': resolution: {integrity: sha512-3tPRkv1EtkDpzlgyKyI8pGsGZAGPEaXeu0DOj5DI25Ja91bdAYddYHbADRYVrZMRbfW+1l5YwXVDKohDJNQxkQ==} + '@ungap/structured-clone@1.2.0': + resolution: {integrity: sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==} + '@vladfrangu/async_event_emitter@2.4.6': resolution: {integrity: sha512-RaI5qZo6D2CVS6sTHFKg1v5Ohq/+Bo2LZ5gzUEwZ/WkHhwtGTCB/sVLw8ijOkAUxasZ+WshN/Rzj4ywsABJ5ZA==} engines: {node: '>=v14.0.0', npm: '>=7.0.0'} @@ -509,6 +505,10 @@ packages: resolution: {integrity: sha512-VGNi9WE2dZIxYM8/r/iatQQ+3LT8STW4hhczJOwm+DBeHq66vsKDCk8trChNCB01sMO9crslYuEMeZl2d7r3xw==} engines: {node: '>=18'} + doctrine@3.0.0: + resolution: {integrity: sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==} + engines: {node: '>=6.0.0'} + dom-serializer@1.4.1: resolution: {integrity: sha512-VHwB3KfrcOOkelEG2ZOfxqLZdfkil8PtJi4P8N2MMXucZq2yLp75ClViUlOVwyoHEDjYU433Aq+5zWP61+RGag==} @@ -549,31 +549,22 @@ packages: resolution: {integrity: sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==} engines: {node: '>=10'} - eslint-scope@8.0.2: - resolution: {integrity: sha512-6E4xmrTw5wtxnLA5wYL3WDfhZ/1bUBGOXV0zQvVRDOtrR8D0p6W7fs3JweNYhwRYeGvd/1CKX2se0/2s7Q/nJA==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + eslint-scope@7.2.2: + resolution: {integrity: sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} eslint-visitor-keys@3.4.3: resolution: {integrity: sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - eslint-visitor-keys@4.0.0: - resolution: {integrity: sha512-OtIRv/2GyiF6o/d8K7MYKKbXrOUBIK6SfkIRM4Z0dY3w+LiQ0vy3F57m0Z71bjbyeiWFiHJ8brqnmE6H6/jEuw==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - - eslint@9.10.0: - resolution: {integrity: sha512-Y4D0IgtBZfOcOUAIQTSXBKoNGfY0REGqHJG6+Q81vNippW5YlKjHFj4soMxamKK1NXHUWuBZTLdU3Km+L/pcHw==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + eslint@8.57.1: + resolution: {integrity: sha512-ypowyDxpVSYpkXr9WPv2PAZCtNip1Mv5KTW0SCurXv/9iOpcrH9PaqUElksqEB6pChqHGDRCFTyrZlGhnLNGiA==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} hasBin: true - peerDependencies: - jiti: '*' - peerDependenciesMeta: - jiti: - optional: true - espree@10.1.0: - resolution: {integrity: sha512-M1M6CpiE6ffoigIOWYO9UDP8TMUw9kqb21tf+08IgDYjCsOvCuDt4jQcZmoYxx+w7zlKw9/N0KXfto+I8/FrXA==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + espree@9.6.1: + resolution: {integrity: sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} esquery@1.6.0: resolution: {integrity: sha512-ca9pw9fomFcKPvFLXhBKUK90ZvGibiGOvRJNbjljY7s7uq/5YO4BOzcYtJqExdx99rF6aAcnRxHmcUHcz6sQsg==} @@ -611,9 +602,9 @@ packages: resolution: {integrity: sha512-7yAQpD2UMJzLi1Dqv7qFYnPbaPx7ZfFK6PiIxQ4PfkGPyNyl2Ugx+a/umUonmKqjhM4DnfbMvdX6otXq83soQQ==} engines: {node: ^12.20 || >= 14.13} - file-entry-cache@8.0.0: - resolution: {integrity: sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==} - engines: {node: '>=16.0.0'} + file-entry-cache@6.0.1: + resolution: {integrity: sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==} + engines: {node: ^10.12.0 || >=12.0.0} file-type@16.5.4: resolution: {integrity: sha512-/yFHK0aGjFEgDJjEKP0pWCplsPFPhwyfwevf/pVxiN0tmE4L9LmwWxWukdJSHdoCli4VgQLehjJtwQBnqmsKcw==} @@ -623,9 +614,9 @@ packages: resolution: {integrity: sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==} engines: {node: '>=10'} - flat-cache@4.0.1: - resolution: {integrity: sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw==} - engines: {node: '>=16'} + flat-cache@3.2.0: + resolution: {integrity: sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw==} + engines: {node: ^10.12.0 || >=12.0.0} flatted@3.3.1: resolution: {integrity: sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw==} @@ -677,14 +668,17 @@ packages: resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==} deprecated: Glob versions prior to v9 are no longer supported - globals@14.0.0: - resolution: {integrity: sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==} - engines: {node: '>=18'} + globals@13.24.0: + resolution: {integrity: sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==} + engines: {node: '>=8'} got@12.1.0: resolution: {integrity: sha512-hBv2ty9QN2RdbJJMK3hesmSkFTjVIHyIDDbssCKnSmq62edGgImJWD10Eb1k77TiV1bxloxqcFAVK8+9pkhOig==} engines: {node: '>=14.16'} + graphemer@1.4.0: + resolution: {integrity: sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==} + has-flag@4.0.0: resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==} engines: {node: '>=8'} @@ -1241,6 +1235,10 @@ packages: resolution: {integrity: sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==} engines: {node: '>= 0.8.0'} + type-fest@0.20.2: + resolution: {integrity: sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==} + engines: {node: '>=10'} + undici-types@6.19.8: resolution: {integrity: sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==} @@ -1444,27 +1442,19 @@ snapshots: - bufferutil - utf-8-validate - '@eslint-community/eslint-utils@4.4.0(eslint@9.10.0)': + '@eslint-community/eslint-utils@4.4.0(eslint@8.57.1)': dependencies: - eslint: 9.10.0 + eslint: 8.57.1 eslint-visitor-keys: 3.4.3 '@eslint-community/regexpp@4.11.0': {} - '@eslint/config-array@0.18.0': - dependencies: - '@eslint/object-schema': 2.1.4 - debug: 4.3.7 - minimatch: 3.1.2 - transitivePeerDependencies: - - supports-color - - '@eslint/eslintrc@3.1.0': + '@eslint/eslintrc@2.1.4': dependencies: ajv: 6.12.6 debug: 4.3.7 - espree: 10.1.0 - globals: 14.0.0 + espree: 9.6.1 + globals: 13.24.0 ignore: 5.3.2 import-fresh: 3.3.0 js-yaml: 4.1.0 @@ -1473,19 +1463,21 @@ snapshots: transitivePeerDependencies: - supports-color - '@eslint/js@9.10.0': {} - - '@eslint/object-schema@2.1.4': {} - - '@eslint/plugin-kit@0.1.0': - dependencies: - levn: 0.4.1 + '@eslint/js@8.57.1': {} '@fastify/busboy@2.1.1': {} + '@humanwhocodes/config-array@0.13.0': + dependencies: + '@humanwhocodes/object-schema': 2.0.3 + debug: 4.3.7 + minimatch: 3.1.2 + transitivePeerDependencies: + - supports-color + '@humanwhocodes/module-importer@1.0.1': {} - '@humanwhocodes/retry@0.3.0': {} + '@humanwhocodes/object-schema@2.0.3': {} '@mongodb-js/saslprep@1.1.9': dependencies: @@ -1594,6 +1586,8 @@ snapshots: dependencies: '@types/node': 22.5.5 + '@ungap/structured-clone@1.2.0': {} + '@vladfrangu/async_event_emitter@2.4.6': {} '@web-scrobbler/metadata-filter@3.2.0': {} @@ -1832,6 +1826,10 @@ snapshots: - bufferutil - utf-8-validate + doctrine@3.0.0: + dependencies: + esutils: 2.0.3 + dom-serializer@1.4.1: dependencies: domelementtype: 2.3.0 @@ -1878,45 +1876,47 @@ snapshots: escape-string-regexp@4.0.0: {} - eslint-scope@8.0.2: + eslint-scope@7.2.2: dependencies: esrecurse: 4.3.0 estraverse: 5.3.0 eslint-visitor-keys@3.4.3: {} - eslint-visitor-keys@4.0.0: {} - - eslint@9.10.0: + eslint@8.57.1: dependencies: - '@eslint-community/eslint-utils': 4.4.0(eslint@9.10.0) + '@eslint-community/eslint-utils': 4.4.0(eslint@8.57.1) '@eslint-community/regexpp': 4.11.0 - '@eslint/config-array': 0.18.0 - '@eslint/eslintrc': 3.1.0 - '@eslint/js': 9.10.0 - '@eslint/plugin-kit': 0.1.0 + '@eslint/eslintrc': 2.1.4 + '@eslint/js': 8.57.1 + '@humanwhocodes/config-array': 0.13.0 '@humanwhocodes/module-importer': 1.0.1 - '@humanwhocodes/retry': 0.3.0 '@nodelib/fs.walk': 1.2.8 + '@ungap/structured-clone': 1.2.0 ajv: 6.12.6 chalk: 4.1.2 cross-spawn: 7.0.3 debug: 4.3.7 + doctrine: 3.0.0 escape-string-regexp: 4.0.0 - eslint-scope: 8.0.2 - eslint-visitor-keys: 4.0.0 - espree: 10.1.0 + eslint-scope: 7.2.2 + eslint-visitor-keys: 3.4.3 + espree: 9.6.1 esquery: 1.6.0 esutils: 2.0.3 fast-deep-equal: 3.1.3 - file-entry-cache: 8.0.0 + file-entry-cache: 6.0.1 find-up: 5.0.0 glob-parent: 6.0.2 + globals: 13.24.0 + graphemer: 1.4.0 ignore: 5.3.2 imurmurhash: 0.1.4 is-glob: 4.0.3 is-path-inside: 3.0.3 + js-yaml: 4.1.0 json-stable-stringify-without-jsonify: 1.0.1 + levn: 0.4.1 lodash.merge: 4.6.2 minimatch: 3.1.2 natural-compare: 1.4.0 @@ -1926,11 +1926,11 @@ snapshots: transitivePeerDependencies: - supports-color - espree@10.1.0: + espree@9.6.1: dependencies: acorn: 8.12.1 acorn-jsx: 5.3.2(acorn@8.12.1) - eslint-visitor-keys: 4.0.0 + eslint-visitor-keys: 3.4.3 esquery@1.6.0: dependencies: @@ -1961,9 +1961,9 @@ snapshots: node-domexception: 1.0.0 web-streams-polyfill: 3.3.3 - file-entry-cache@8.0.0: + file-entry-cache@6.0.1: dependencies: - flat-cache: 4.0.1 + flat-cache: 3.2.0 file-type@16.5.4: dependencies: @@ -1976,10 +1976,11 @@ snapshots: locate-path: 6.0.0 path-exists: 4.0.0 - flat-cache@4.0.1: + flat-cache@3.2.0: dependencies: flatted: 3.3.1 keyv: 4.5.4 + rimraf: 3.0.2 flatted@3.3.1: {} @@ -2051,7 +2052,9 @@ snapshots: once: 1.4.0 path-is-absolute: 1.0.1 - globals@14.0.0: {} + globals@13.24.0: + dependencies: + type-fest: 0.20.2 got@12.1.0: dependencies: @@ -2069,6 +2072,8 @@ snapshots: p-cancelable: 3.0.0 responselike: 2.0.1 + graphemer@1.4.0: {} + has-flag@4.0.0: {} has-unicode@2.0.1: {} @@ -2569,6 +2574,8 @@ snapshots: dependencies: prelude-ls: 1.2.1 + type-fest@0.20.2: {} + undici-types@6.19.8: {} undici@5.28.4: