This commit is contained in:
Jonny_Bro (Nikita) 2024-09-14 19:52:56 +05:00
parent b4dd085ea7
commit d97c4bf4f2
Signed by: jonny_bro
GPG key ID: 3F1ECC04147E9BD8
93 changed files with 544 additions and 894 deletions

View file

@ -48,7 +48,7 @@ class JaBaClient extends Client {
await this.player.extractors.register(YoutubeiExtractor, { await this.player.extractors.register(YoutubeiExtractor, {
authentication: this.config.youtubeCookie, authentication: this.config.youtubeCookie,
streamOptions: { streamOptions: {
useClient: "WEB", useClient: "YTMUSIC_ANDROID",
}, },
}); });
@ -267,7 +267,7 @@ class JaBaClient extends Client {
* @param {string} name - The name of the command file (without the .js extension). * @param {string} name - The name of the command file (without the .js extension).
* @returns {void} This method does not return a value. * @returns {void} This method does not return a value.
*/ */
async unloadCommand(dir, name) { unloadCommand(dir, name) {
delete require.cache[require.resolve(`${dir}${path.sep}${name}.js`)]; delete require.cache[require.resolve(`${dir}${path.sep}${name}.js`)];
return; return;

View file

@ -1,73 +0,0 @@
const { SlashCommandBuilder, PermissionsBitField } = require("discord.js");
const BaseCommand = require("../../base/BaseCommand");
class Ban extends BaseCommand {
/**
*
* @param {import("../../base/Client")} client
*/
constructor(client) {
super({
command: new SlashCommandBuilder()
.setName("ban")
.setDescription(client.translate("moderation/ban:DESCRIPTION"))
.setDescriptionLocalizations({
uk: client.translate("moderation/ban:DESCRIPTION", null, "uk-UA"),
ru: client.translate("moderation/ban:DESCRIPTION", null, "ru-RU"),
})
.setDMPermission(false)
.setDefaultMemberPermissions(PermissionsBitField.Flags.BanMembers)
.addUserOption(option =>
option
.setName("user")
.setDescription(client.translate("common:USER"))
.setDescriptionLocalizations({
uk: client.translate("common:USER", null, "uk-UA"),
ru: client.translate("common:USER", null, "ru-RU"),
})
.setRequired(true),
)
.addStringOption(option =>
option
.setName("reason")
.setDescription(client.translate("common:REASON"))
.setDescriptionLocalizations({
uk: client.translate("common:REASON", null, "uk-UA"),
ru: client.translate("common:REASON", null, "ru-RU"),
})
.setRequired(true),
),
dirname: __dirname,
ownerOnly: false,
});
}
/**
*
* @param {import("../../base/Client")} client
* @param {import("discord.js").ChatInputCommandInteraction} interaction
*/
async execute(client, interaction) {
await interaction.deferReply();
const member = interaction.options.getMember("user"),
reason = interaction.options.getString("reason"),
memberPosition = member.roles.highest.position,
moderationPosition = interaction.member.roles.highest.position;
if (member.user.bot) return interaction.error("misc:BOT_USER", null, { ephemeral: true, edit: true });
if (member.id === interaction.member.id) return interaction.error("misc:CANT_YOURSELF", null, { ephemeral: true, edit: true });
if (interaction.guild.ownerId !== interaction.member.id && !(moderationPosition > memberPosition) && member.bannable) return interaction.error("moderation/ban:SUPERIOR", null, { ephemeral: true, edit: true });
await member.ban({
reason,
});
interaction.success("moderation/ban:SUCCESS", {
user: member.user.toString(),
reason,
}, { edit: true });
}
}
module.exports = Ban;

View file

@ -1,49 +0,0 @@
const { SlashCommandBuilder } = require("discord.js"),
Mee6Api = require("../../helpers/mee6-api");
const BaseCommand = require("../../base/BaseCommand");
class ImportMee6 extends BaseCommand {
/**
*
* @param {import("../base/Client")} client
*/
constructor(client) {
super({
command: new SlashCommandBuilder()
.setName("importmee6")
.setDescription(client.translate("economy/importmee6:DESCRIPTION"))
.setDescriptionLocalizations({
uk: client.translate("economy/importmee6:DESCRIPTION", null, "uk-UA"),
ru: client.translate("economy/importmee6:DESCRIPTION", null, "ru-RU"),
})
.setDMPermission(false),
dirname: __dirname,
ownerOnly: false,
});
}
/**
*
* @param {import("../../base/Client")} client
* @param {import("discord.js").ChatInputCommandInteraction} interaction
*/
async execute(client, interaction) {
await interaction.deferReply();
const level = (await Mee6Api.getUserXp(interaction.guildId, interaction.member)).level;
interaction.data.member.level = level;
interaction.data.member.exp = 0;
await interaction.data.member.save();
interaction.editReply({
content: interaction.translate("owner/debug:SUCCESS_LEVEL", {
user: interaction.member.toString(),
amount: level,
}),
});
}
}
module.exports = ImportMee6;

View file

@ -1,73 +0,0 @@
const { SlashCommandBuilder, PermissionsBitField } = require("discord.js");
const BaseCommand = require("../../base/BaseCommand");
class Kick extends BaseCommand {
/**
*
* @param {import("../../base/Client")} client
*/
constructor(client) {
super({
command: new SlashCommandBuilder()
.setName("kick")
.setDescription(client.translate("moderation/kick:DESCRIPTION"))
.setDescriptionLocalizations({
uk: client.translate("moderation/kick:DESCRIPTION", null, "uk-UA"),
ru: client.translate("moderation/kick:DESCRIPTION", null, "ru-RU"),
})
.setDMPermission(false)
.setDefaultMemberPermissions(PermissionsBitField.Flags.KickMembers)
.addUserOption(option =>
option
.setName("user")
.setDescription(client.translate("common:USER"))
.setDescriptionLocalizations({
uk: client.translate("common:USER", null, "uk-UA"),
ru: client.translate("common:USER", null, "ru-RU"),
})
.setRequired(true),
)
.addStringOption(option =>
option
.setName("reason")
.setDescription(client.translate("common:REASON"))
.setDescriptionLocalizations({
uk: client.translate("common:REASON", null, "uk-UA"),
ru: client.translate("common:REASON", null, "ru-RU"),
})
.setRequired(true),
),
dirname: __dirname,
ownerOnly: false,
});
}
/**
*
* @param {import("../../base/Client")} client
* @param {import("discord.js").ChatInputCommandInteraction} interaction
*/
async execute(client, interaction) {
await interaction.deferReply();
const member = interaction.options.getMember("user"),
reason = interaction.options.getString("reason"),
memberPosition = member.roles.highest.position,
moderationPosition = interaction.member.roles.highest.position;
if (member.user.bot) return interaction.error("misc:BOT_USER", null, { ephemeral: true, edit: true });
if (member.id === interaction.member.id) return interaction.error("misc:CANT_YOURSELF", null, { ephemeral: true, edit: true });
if (interaction.guild.ownerId !== interaction.member.id && !(moderationPosition > memberPosition) && member.kickable) return interaction.error("moderation/kick:SUPERIOR", null, { ephemeral: true, edit: true });
await member.kick({
reason,
});
interaction.success("moderation/kick:SUCCESS", {
user: member.user.toString(),
reason,
}, { edit: true });
}
}
module.exports = Kick;

View file

@ -1,79 +0,0 @@
const { SlashCommandBuilder, ActionRowBuilder, StringSelectMenuBuilder } = require("discord.js");
const BaseCommand = require("../../base/BaseCommand"),
fetch = require("node-fetch");
class Memes extends BaseCommand {
/**
*
* @param {import("../base/Client")} client
*/
constructor(client) {
super({
command: new SlashCommandBuilder()
.setName("memes")
.setDescription(client.translate("fun/memes:DESCRIPTION"))
.setDescriptionLocalizations({
uk: client.translate("fun/memes:DESCRIPTION", null, "uk-UA"),
ru: client.translate("fun/memes:DESCRIPTION", null, "ru-RU"),
})
.setDMPermission(false),
dirname: __dirname,
ownerOnly: false,
});
}
/**
*
* @param {import("../../base/Client")} client
*/
async onLoad(client) {
client.on("interactionCreate", async interaction => {
if (!interaction.isStringSelectMenu()) return;
if (interaction.customId === "memes_select") {
interaction.deferUpdate();
interaction.guild.data = await client.getGuildData(interaction.guildId);
const tag = interaction.values[0];
const res = await fetch(`https://meme-api.com/gimme/${tag}`).then(response => response.json());
const embed = client.embed({
title: res.title,
description: `${interaction.translate("fun/memes:SUBREDDIT")}: **${res.subreddit}**\n${interaction.translate("common:AUTHOR")}: **${res.author}**\n${interaction.translate("fun/memes:UPS")}: **${res.ups}**`,
image: res.url,
});
await interaction.editReply({
embeds: [embed],
});
}
});
}
/**
*
* @param {import("../../base/Client")} client
* @param {import("discord.js").ChatInputCommandInteraction} interaction
*/
async execute(client, interaction) {
await interaction.deferReply({ ephemeral: true });
const tags = ["funny", "memes", "dankmemes", "me_irl", "wholesomememes"].map(tag =>
JSON.parse(
JSON.stringify({
label: tag,
value: tag,
}),
),
);
const row = new ActionRowBuilder().addComponents(new StringSelectMenuBuilder().setCustomId("memes_select").setPlaceholder(interaction.translate("common:NOTHING_SELECTED")).addOptions(tags));
await interaction.editReply({
components: [row],
});
}
}
module.exports = Memes;

View file

@ -1,63 +0,0 @@
const { SlashCommandBuilder, PermissionsBitField } = require("discord.js");
const BaseCommand = require("../../base/BaseCommand");
class Staff extends BaseCommand {
/**
*
* @param {import("../base/Client")} client
*/
constructor(client) {
super({
command: new SlashCommandBuilder()
.setName("staff")
.setDescription(client.translate("general/staff:DESCRIPTION"))
.setDescriptionLocalizations({
uk: client.translate("general/staff:DESCRIPTION", null, "uk-UA"),
ru: client.translate("general/staff:DESCRIPTION", null, "ru-RU"),
})
.setDMPermission(false),
dirname: __dirname,
ownerOnly: false,
});
}
/**
*
* @param {import("../../base/Client")} client
* @param {import("discord.js").ChatInputCommandInteraction} interaction
*/
async execute(client, interaction) {
await interaction.guild.members.fetch();
const administrators = interaction.guild.members.cache.filter(m => m.permissions.has(PermissionsBitField.Flags.Administrator) && !m.user.bot);
const moderators = interaction.guild.members.cache.filter(m => !administrators.has(m.id) && m.permissions.has(PermissionsBitField.Flags.ManageMessages) && !m.user.bot);
const embed = client.embed({
author: {
name: interaction.translate("general/staff:TITLE", {
guild: interaction.guild.name,
}),
iconURL: interaction.guild.iconURL(),
},
fields: [
{
name: interaction.translate("general/staff:ADMINS"),
value:
administrators.size > 0
? administrators.map(a => `${a.presence ? client.customEmojis.status[a.presence.status] : client.customEmojis.status.offline} | <@${a.user.id}>`).join("\n")
: interaction.translate("general/staff:NO_ADMINS"),
},
{
name: interaction.translate("general/staff:MODS"),
value: moderators.size > 0 ? moderators.map(m => `${m.presence ? client.customEmojis.status[m.presence.status] : client.customEmojis.status.offline} | <@${m.user.id}>`).join("\n") : interaction.translate("general/staff:NO_MODS"),
},
],
});
interaction.reply({
embeds: [embed],
});
}
}
module.exports = Staff;

View file

@ -1,4 +1,4 @@
const { SlashCommandBuilder, PermissionsBitField } = require("discord.js"); const { SlashCommandBuilder, PermissionsBitField, InteractionContextType } = require("discord.js");
const BaseCommand = require("../../base/BaseCommand"); const BaseCommand = require("../../base/BaseCommand");
class Addemoji extends BaseCommand { class Addemoji extends BaseCommand {
@ -15,7 +15,7 @@ class Addemoji extends BaseCommand {
uk: client.translate("administration/addemoji:DESCRIPTION", null, "uk-UA"), uk: client.translate("administration/addemoji:DESCRIPTION", null, "uk-UA"),
ru: client.translate("administration/addemoji:DESCRIPTION", null, "ru-RU"), ru: client.translate("administration/addemoji:DESCRIPTION", null, "ru-RU"),
}) })
.setDMPermission(false) .setContexts([InteractionContextType.Guild])
.setDefaultMemberPermissions(PermissionsBitField.Flags.ManageGuild) .setDefaultMemberPermissions(PermissionsBitField.Flags.ManageGuild)
.addStringOption(option => .addStringOption(option =>
option option

View file

@ -1,4 +1,4 @@
const { SlashCommandBuilder, PermissionsBitField, ChannelType } = require("discord.js"); const { SlashCommandBuilder, PermissionsBitField, ChannelType, InteractionContextType } = require("discord.js");
const BaseCommand = require("../../base/BaseCommand"); const BaseCommand = require("../../base/BaseCommand");
class Automod extends BaseCommand { class Automod extends BaseCommand {
@ -15,7 +15,7 @@ class Automod extends BaseCommand {
uk: client.translate("administration/automod:DESCRIPTION", null, "uk-UA"), uk: client.translate("administration/automod:DESCRIPTION", null, "uk-UA"),
ru: client.translate("administration/automod:DESCRIPTION", null, "ru-RU"), ru: client.translate("administration/automod:DESCRIPTION", null, "ru-RU"),
}) })
.setDMPermission(false) .setContexts([InteractionContextType.Guild])
.setDefaultMemberPermissions(PermissionsBitField.Flags.ManageGuild) .setDefaultMemberPermissions(PermissionsBitField.Flags.ManageGuild)
.addSubcommand(subcommand => .addSubcommand(subcommand =>
subcommand subcommand

View file

@ -1,4 +1,4 @@
const { SlashCommandBuilder, PermissionsBitField } = require("discord.js"); const { SlashCommandBuilder, PermissionsBitField, InteractionContextType } = require("discord.js");
const BaseCommand = require("../../base/BaseCommand"); const BaseCommand = require("../../base/BaseCommand");
class Autorole extends BaseCommand { class Autorole extends BaseCommand {
@ -15,7 +15,7 @@ class Autorole extends BaseCommand {
uk: client.translate("administration/autorole:DESCRIPTION", null, "uk-UA"), uk: client.translate("administration/autorole:DESCRIPTION", null, "uk-UA"),
ru: client.translate("administration/autorole:DESCRIPTION", null, "ru-RU"), ru: client.translate("administration/autorole:DESCRIPTION", null, "ru-RU"),
}) })
.setDMPermission(false) .setContexts([InteractionContextType.Guild])
.setDefaultMemberPermissions(PermissionsBitField.Flags.ManageGuild) .setDefaultMemberPermissions(PermissionsBitField.Flags.ManageGuild)
.addBooleanOption(option => .addBooleanOption(option =>
option option

View file

@ -1,4 +1,4 @@
const { SlashCommandBuilder, PermissionsBitField, ChannelType } = require("discord.js"); const { SlashCommandBuilder, PermissionsBitField, ChannelType, InteractionContextType } = require("discord.js");
const BaseCommand = require("../../base/BaseCommand"); const BaseCommand = require("../../base/BaseCommand");
class Config extends BaseCommand { class Config extends BaseCommand {
@ -15,7 +15,7 @@ class Config extends BaseCommand {
uk: client.translate("administration/config:DESCRIPTION", null, "uk-UA"), uk: client.translate("administration/config:DESCRIPTION", null, "uk-UA"),
ru: client.translate("administration/config:DESCRIPTION", null, "ru-RU"), ru: client.translate("administration/config:DESCRIPTION", null, "ru-RU"),
}) })
.setDMPermission(false) .setContexts([InteractionContextType.Guild])
.setDefaultMemberPermissions(PermissionsBitField.Flags.ManageGuild) .setDefaultMemberPermissions(PermissionsBitField.Flags.ManageGuild)
.addSubcommand(subcommand => .addSubcommand(subcommand =>
subcommand subcommand

View file

@ -1,4 +1,4 @@
const { SlashCommandBuilder, PermissionsBitField } = require("discord.js"); const { SlashCommandBuilder, PermissionsBitField, InteractionContextType } = require("discord.js");
const BaseCommand = require("../../base/BaseCommand"); const BaseCommand = require("../../base/BaseCommand");
class Goodbye extends BaseCommand { class Goodbye extends BaseCommand {
@ -15,7 +15,7 @@ class Goodbye extends BaseCommand {
uk: client.translate("administration/goodbye:DESCRIPTION", null, "uk-UA"), uk: client.translate("administration/goodbye:DESCRIPTION", null, "uk-UA"),
ru: client.translate("administration/goodbye:DESCRIPTION", null, "ru-RU"), ru: client.translate("administration/goodbye:DESCRIPTION", null, "ru-RU"),
}) })
.setDMPermission(false) .setContexts([InteractionContextType.Guild])
.setDefaultMemberPermissions(PermissionsBitField.Flags.ManageGuild) .setDefaultMemberPermissions(PermissionsBitField.Flags.ManageGuild)
.addSubcommand(subcommand => .addSubcommand(subcommand =>
subcommand subcommand
@ -26,42 +26,43 @@ class Goodbye extends BaseCommand {
ru: client.translate("administration/goodbye:TEST", null, "ru-RU"), ru: client.translate("administration/goodbye:TEST", null, "ru-RU"),
}), }),
) )
.addSubcommand(subcommand => .addSubcommand(
subcommand subcommand =>
.setName("config") subcommand
.setDescription(client.translate("administration/goodbye:CONFIG")) .setName("config")
.setDescriptionLocalizations({ .setDescription(client.translate("administration/goodbye:CONFIG"))
uk: client.translate("administration/goodbye:CONFIG", null, "uk-UA"), .setDescriptionLocalizations({
ru: client.translate("administration/goodbye:CONFIG", null, "ru-RU"), uk: client.translate("administration/goodbye:CONFIG", null, "uk-UA"),
}) ru: client.translate("administration/goodbye:CONFIG", null, "ru-RU"),
.addBooleanOption(option => })
option .addBooleanOption(option =>
.setName("state") option
.setDescription(client.translate("common:STATE")) .setName("state")
.setDescriptionLocalizations({ .setDescription(client.translate("common:STATE"))
uk: client.translate("common:STATE", null, "uk-UA"), .setDescriptionLocalizations({
ru: client.translate("common:STATE", null, "ru-RU"), uk: client.translate("common:STATE", null, "uk-UA"),
}) ru: client.translate("common:STATE", null, "ru-RU"),
.setRequired(true), })
) .setRequired(true),
.addChannelOption(option => )
option .addChannelOption(option =>
.setName("channel") option
.setDescription(client.translate("common:CHANNEL")) .setName("channel")
.setDescriptionLocalizations({ .setDescription(client.translate("common:CHANNEL"))
uk: client.translate("common:CHANNEL", null, "uk-UA"), .setDescriptionLocalizations({
ru: client.translate("common:CHANNEL", null, "ru-RU"), uk: client.translate("common:CHANNEL", null, "uk-UA"),
}), ru: client.translate("common:CHANNEL", null, "ru-RU"),
) }),
.addStringOption(option => )
option .addStringOption(option =>
.setName("message") option
.setDescription(client.translate("administration/goodbye:MESSAGE")) .setName("message")
.setDescriptionLocalizations({ .setDescription(client.translate("administration/goodbye:MESSAGE"))
uk: client.translate("administration/goodbye:MESSAGE", null, "uk-UA"), .setDescriptionLocalizations({
ru: client.translate("administration/goodbye:MESSAGE", null, "ru-RU"), uk: client.translate("administration/goodbye:MESSAGE", null, "uk-UA"),
}), ru: client.translate("administration/goodbye:MESSAGE", null, "ru-RU"),
), }),
),
// .addBooleanOption(option => // .addBooleanOption(option =>
// option // option
// .setName("image") // .setName("image")

View file

@ -1,4 +1,4 @@
const { SlashCommandBuilder, PermissionsBitField, ActionRowBuilder, StringSelectMenuBuilder } = require("discord.js"); const { SlashCommandBuilder, PermissionsBitField, ActionRowBuilder, StringSelectMenuBuilder, InteractionContextType } = require("discord.js");
const BaseCommand = require("../../base/BaseCommand"); const BaseCommand = require("../../base/BaseCommand");
class Selectroles extends BaseCommand { class Selectroles extends BaseCommand {
@ -15,7 +15,7 @@ class Selectroles extends BaseCommand {
uk: client.translate("administration/selectroles:DESCRIPTION", null, "uk-UA"), uk: client.translate("administration/selectroles:DESCRIPTION", null, "uk-UA"),
ru: client.translate("administration/selectroles:DESCRIPTION", null, "ru-RU"), ru: client.translate("administration/selectroles:DESCRIPTION", null, "ru-RU"),
}) })
.setDMPermission(false) .setContexts([InteractionContextType.Guild])
.setDefaultMemberPermissions(PermissionsBitField.Flags.ManageGuild) .setDefaultMemberPermissions(PermissionsBitField.Flags.ManageGuild)
.addSubcommand(subcommand => .addSubcommand(subcommand =>
subcommand subcommand

View file

@ -1,4 +1,4 @@
const { SlashCommandBuilder, PermissionsBitField } = require("discord.js"); const { SlashCommandBuilder, PermissionsBitField, InteractionContextType } = require("discord.js");
const BaseCommand = require("../../base/BaseCommand"); const BaseCommand = require("../../base/BaseCommand");
class Set extends BaseCommand { class Set extends BaseCommand {
@ -15,7 +15,7 @@ class Set extends BaseCommand {
uk: client.translate("administration/set:DESCRIPTION", null, "uk-UA"), uk: client.translate("administration/set:DESCRIPTION", null, "uk-UA"),
ru: client.translate("administration/set:DESCRIPTION", null, "ru-RU"), ru: client.translate("administration/set:DESCRIPTION", null, "ru-RU"),
}) })
.setDMPermission(false) .setContexts([InteractionContextType.Guild])
.setDefaultMemberPermissions(PermissionsBitField.Flags.ManageGuild) .setDefaultMemberPermissions(PermissionsBitField.Flags.ManageGuild)
.addStringOption(option => .addStringOption(option =>
option option

View file

@ -1,4 +1,4 @@
const { SlashCommandBuilder, PermissionsBitField } = require("discord.js"); const { SlashCommandBuilder, PermissionsBitField, InteractionContextType } = require("discord.js");
const BaseCommand = require("../../base/BaseCommand"); const BaseCommand = require("../../base/BaseCommand");
class Setlang extends BaseCommand { class Setlang extends BaseCommand {
@ -15,7 +15,7 @@ class Setlang extends BaseCommand {
uk: client.translate("administration/setlang:DESCRIPTION", null, "uk-UA"), uk: client.translate("administration/setlang:DESCRIPTION", null, "uk-UA"),
ru: client.translate("administration/setlang:DESCRIPTION", null, "ru-RU"), ru: client.translate("administration/setlang:DESCRIPTION", null, "ru-RU"),
}) })
.setDMPermission(false) .setContexts([InteractionContextType.Guild])
.setDefaultMemberPermissions(PermissionsBitField.Flags.ManageGuild) .setDefaultMemberPermissions(PermissionsBitField.Flags.ManageGuild)
.addStringOption(option => .addStringOption(option =>
option option

View file

@ -1,4 +1,4 @@
const { SlashCommandBuilder, parseEmoji, PermissionsBitField } = require("discord.js"); const { SlashCommandBuilder, parseEmoji, PermissionsBitField, InteractionContextType } = require("discord.js");
const BaseCommand = require("../../base/BaseCommand"); const BaseCommand = require("../../base/BaseCommand");
class Stealemoji extends BaseCommand { class Stealemoji extends BaseCommand {
@ -15,7 +15,7 @@ class Stealemoji extends BaseCommand {
uk: client.translate("administration/stealemoji:DESCRIPTION", null, "uk-UA"), uk: client.translate("administration/stealemoji:DESCRIPTION", null, "uk-UA"),
ru: client.translate("administration/stealemoji:DESCRIPTION", null, "ru-RU"), ru: client.translate("administration/stealemoji:DESCRIPTION", null, "ru-RU"),
}) })
.setDMPermission(false) .setContexts([InteractionContextType.Guild])
.setDefaultMemberPermissions(PermissionsBitField.Flags.ManageGuild) .setDefaultMemberPermissions(PermissionsBitField.Flags.ManageGuild)
.addStringOption(option => .addStringOption(option =>
option option

View file

@ -1,4 +1,4 @@
const { SlashCommandBuilder, PermissionsBitField } = require("discord.js"); const { SlashCommandBuilder, PermissionsBitField, InteractionContextType } = require("discord.js");
const BaseCommand = require("../../base/BaseCommand"); const BaseCommand = require("../../base/BaseCommand");
class Welcome extends BaseCommand { class Welcome extends BaseCommand {
@ -15,7 +15,7 @@ class Welcome extends BaseCommand {
uk: client.translate("administration/welcome:DESCRIPTION", null, "uk-UA"), uk: client.translate("administration/welcome:DESCRIPTION", null, "uk-UA"),
ru: client.translate("administration/welcome:DESCRIPTION", null, "ru-RU"), ru: client.translate("administration/welcome:DESCRIPTION", null, "ru-RU"),
}) })
.setDMPermission(false) .setContexts([InteractionContextType.Guild])
.setDefaultMemberPermissions(PermissionsBitField.Flags.ManageGuild) .setDefaultMemberPermissions(PermissionsBitField.Flags.ManageGuild)
.addSubcommand(subcommand => .addSubcommand(subcommand =>
subcommand subcommand
@ -26,42 +26,43 @@ class Welcome extends BaseCommand {
ru: client.translate("administration/goodbye:TEST", null, "ru-RU"), ru: client.translate("administration/goodbye:TEST", null, "ru-RU"),
}), }),
) )
.addSubcommand(subcommand => .addSubcommand(
subcommand subcommand =>
.setName("config") subcommand
.setDescription(client.translate("administration/goodbye:CONFIG")) .setName("config")
.setDescriptionLocalizations({ .setDescription(client.translate("administration/goodbye:CONFIG"))
uk: client.translate("administration/goodbye:CONFIG", null, "uk-UA"), .setDescriptionLocalizations({
ru: client.translate("administration/goodbye:CONFIG", null, "ru-RU"), uk: client.translate("administration/goodbye:CONFIG", null, "uk-UA"),
}) ru: client.translate("administration/goodbye:CONFIG", null, "ru-RU"),
.addBooleanOption(option => })
option .addBooleanOption(option =>
.setName("state") option
.setDescription(client.translate("common:STATE")) .setName("state")
.setDescriptionLocalizations({ .setDescription(client.translate("common:STATE"))
uk: client.translate("common:STATE", null, "uk-UA"), .setDescriptionLocalizations({
ru: client.translate("common:STATE", null, "ru-RU"), uk: client.translate("common:STATE", null, "uk-UA"),
}) ru: client.translate("common:STATE", null, "ru-RU"),
.setRequired(true), })
) .setRequired(true),
.addChannelOption(option => )
option .addChannelOption(option =>
.setName("channel") option
.setDescription(client.translate("common:CHANNEL")) .setName("channel")
.setDescriptionLocalizations({ .setDescription(client.translate("common:CHANNEL"))
uk: client.translate("common:CHANNEL", null, "uk-UA"), .setDescriptionLocalizations({
ru: client.translate("common:CHANNEL", null, "ru-RU"), uk: client.translate("common:CHANNEL", null, "uk-UA"),
}), ru: client.translate("common:CHANNEL", null, "ru-RU"),
) }),
.addStringOption(option => )
option .addStringOption(option =>
.setName("message") option
.setDescription(client.translate("administration/goodbye:MESSAGE")) .setName("message")
.setDescriptionLocalizations({ .setDescription(client.translate("administration/goodbye:MESSAGE"))
uk: client.translate("administration/goodbye:MESSAGE", null, "uk-UA"), .setDescriptionLocalizations({
ru: client.translate("administration/goodbye:MESSAGE", null, "ru-RU"), uk: client.translate("administration/goodbye:MESSAGE", null, "uk-UA"),
}), ru: client.translate("administration/goodbye:MESSAGE", null, "ru-RU"),
), }),
),
// .addBooleanOption(option => // .addBooleanOption(option =>
// option // option
// .setName("image") // .setName("image")

View file

@ -1,4 +1,4 @@
const { SlashCommandBuilder } = require("discord.js"); const { SlashCommandBuilder, InteractionContextType } = require("discord.js");
const BaseCommand = require("../../base/BaseCommand"), const BaseCommand = require("../../base/BaseCommand"),
fetch = require("node-fetch"); fetch = require("node-fetch");
@ -11,12 +11,12 @@ class Courses extends BaseCommand {
super({ super({
command: new SlashCommandBuilder() command: new SlashCommandBuilder()
.setName("courses") .setName("courses")
.setDescription(client.translate("beatrun.ru/courses:DESCRIPTION")) .setDescription(client.translate("beatrun_courses/courses:DESCRIPTION"))
.setDescriptionLocalizations({ .setDescriptionLocalizations({
uk: client.translate("beatrun.ru/courses:DESCRIPTION", null, "uk-UA"), uk: client.translate("beatrun_courses/courses:DESCRIPTION", null, "uk-UA"),
ru: client.translate("beatrun.ru/courses:DESCRIPTION", null, "ru-RU"), ru: client.translate("beatrun_courses/courses:DESCRIPTION", null, "ru-RU"),
}) })
.setDMPermission(false) .setContexts([InteractionContextType.Guild, InteractionContextType.BotDM, InteractionContextType.PrivateChannel])
.addStringOption(option => .addStringOption(option =>
option option
.setName("code") .setName("code")
@ -42,26 +42,25 @@ class Courses extends BaseCommand {
await interaction.deferReply(); await interaction.deferReply();
const code = interaction.options.getString("code"); const code = interaction.options.getString("code");
const response = await fetch(`https://courses.jonnybro.ru/api/info/${code}`).then(res => res.json()),
{ data } = response;
const response = await fetch(`https://courses.jonnybro.ru/api/info/${code}`).then(res => res.json()); if (response.res === 401) return interaction.error("beatrun_courses/courses:NOT_FOUND", null, { ephemeral: true, edit: true });
const course = response.data;
if (response.res === 401) return interaction.error("beatrun.ru/courses:NOT_FOUND", null, { ephemeral: true, edit: true });
const embed = client.embed({ const embed = client.embed({
title: course.name, title: data.name,
description: `[${interaction.translate("beatrun.ru/courses:DOWNLOAD")}](https://courses.jonnybro.ru/${course.path})`, description: `[${interaction.translate("beatrun_courses/courses:DOWNLOAD")}](https://courses.jonnybro.ru/${data.path})`,
thumbnail: course.mapimg, thumbnail: data.mapimg,
url: `https://courses.jonnybro.ru/?search=${code}`, url: `https://courses.jonnybro.ru/?search=${code}`,
fields: [ fields: [
{ {
name: interaction.translate("beatrun.ru/courses:MAP"), name: interaction.translate("beatrun_courses/courses:MAP"),
value: `[${course.map}](https://steamcommunity.com/sharedfiles/filedetails/?id=${course.mapid})`, value: `[${data.map}](https://steamcommunity.com/sharedfiles/filedetails/?id=${data.mapid})`,
inline: true, inline: true,
}, },
{ {
name: interaction.translate("beatrun.ru/courses:UPLOADER"), name: interaction.translate("beatrun_courses/courses:UPLOADER"),
value: `[${course.uploader.name || course.uploader.userid}](https://steamcommunity.com/profiles/${course.uploader.userid})`, value: `[${data.uploader.name || data.uploader.userid}](https://steamcommunity.com/profiles/${data.uploader.userid})`,
inline: true, inline: true,
}, },
{ {
@ -70,13 +69,13 @@ class Courses extends BaseCommand {
inline: true, inline: true,
}, },
{ {
name: interaction.translate("beatrun.ru/courses:DATE"), name: interaction.translate("beatrun_courses/courses:DATE"),
value: `<t:${Math.floor(course.time / 1000)}:D>`, value: `<t:${Math.floor(data.time / 1000)}:D>`,
inline: true, inline: true,
}, },
{ {
name: interaction.translate("beatrun.ru/courses:PLAYS"), name: interaction.translate("beatrun_courses/courses:PLAYS"),
value: `${course.plays || 0}`, value: `${data.plays || 0}`,
inline: true, inline: true,
}, },
], ],

View file

@ -1,4 +1,4 @@
const { SlashCommandBuilder } = require("discord.js"); const { SlashCommandBuilder, InteractionContextType } = require("discord.js");
const BaseCommand = require("../../base/BaseCommand"); const BaseCommand = require("../../base/BaseCommand");
class Achievements extends BaseCommand { class Achievements extends BaseCommand {
@ -15,7 +15,7 @@ class Achievements extends BaseCommand {
uk: client.translate("economy/achievements:DESCRIPTION", null, "uk-UA"), uk: client.translate("economy/achievements:DESCRIPTION", null, "uk-UA"),
ru: client.translate("economy/achievements:DESCRIPTION", null, "ru-RU"), ru: client.translate("economy/achievements:DESCRIPTION", null, "ru-RU"),
}) })
.setDMPermission(false) .setContexts([InteractionContextType.Guild])
.addUserOption(option => .addUserOption(option =>
option option
.setName("user") .setName("user")

View file

@ -1,4 +1,4 @@
const { SlashCommandBuilder } = require("discord.js"); const { SlashCommandBuilder, InteractionContextType } = require("discord.js");
const BaseCommand = require("../../base/BaseCommand"); const BaseCommand = require("../../base/BaseCommand");
class Bank extends BaseCommand { class Bank extends BaseCommand {
@ -15,7 +15,7 @@ class Bank extends BaseCommand {
uk: client.translate("economy/bank:DESCRIPTION", null, "uk-UA"), uk: client.translate("economy/bank:DESCRIPTION", null, "uk-UA"),
ru: client.translate("economy/bank:DESCRIPTION", null, "ru-RU"), ru: client.translate("economy/bank:DESCRIPTION", null, "ru-RU"),
}) })
.setDMPermission(false) .setContexts([InteractionContextType.Guild])
.addStringOption(option => .addStringOption(option =>
option option
.setName("option") .setName("option")

View file

@ -1,4 +1,4 @@
const { SlashCommandBuilder } = require("discord.js"); const { SlashCommandBuilder, InteractionContextType } = require("discord.js");
const BaseCommand = require("../../base/BaseCommand"); const BaseCommand = require("../../base/BaseCommand");
class Birthdate extends BaseCommand { class Birthdate extends BaseCommand {
@ -15,7 +15,7 @@ class Birthdate extends BaseCommand {
uk: client.translate("economy/birthdate:DESCRIPTION", null, "uk-UA"), uk: client.translate("economy/birthdate:DESCRIPTION", null, "uk-UA"),
ru: client.translate("economy/birthdate:DESCRIPTION", null, "ru-RU"), ru: client.translate("economy/birthdate:DESCRIPTION", null, "ru-RU"),
}) })
.setDMPermission(true) .setContexts([InteractionContextType.BotDM, InteractionContextType.Guild, InteractionContextType.PrivateChannel])
.addIntegerOption(option => .addIntegerOption(option =>
option option
.setName("day") .setName("day")

View file

@ -1,4 +1,4 @@
const { SlashCommandBuilder } = require("discord.js"); const { SlashCommandBuilder, InteractionContextType } = require("discord.js");
const BaseCommand = require("../../base/BaseCommand"); const BaseCommand = require("../../base/BaseCommand");
class Divorce extends BaseCommand { class Divorce extends BaseCommand {
@ -15,7 +15,7 @@ class Divorce extends BaseCommand {
uk: client.translate("economy/divorce:DESCRIPTION", null, "uk-UA"), uk: client.translate("economy/divorce:DESCRIPTION", null, "uk-UA"),
ru: client.translate("economy/divorce:DESCRIPTION", null, "ru-RU"), ru: client.translate("economy/divorce:DESCRIPTION", null, "ru-RU"),
}) })
.setDMPermission(false), .setContexts([InteractionContextType.Guild]),
dirname: __dirname, dirname: __dirname,
ownerOnly: false, ownerOnly: false,
}); });

View file

@ -1,4 +1,4 @@
const { SlashCommandBuilder } = require("discord.js"); const { SlashCommandBuilder, InteractionContextType } = require("discord.js");
const BaseCommand = require("../../base/BaseCommand"); const BaseCommand = require("../../base/BaseCommand");
class Leaderboard extends BaseCommand { class Leaderboard extends BaseCommand {
@ -15,7 +15,7 @@ class Leaderboard extends BaseCommand {
uk: client.translate("economy/leaderboard:DESCRIPTION", null, "uk-UA"), uk: client.translate("economy/leaderboard:DESCRIPTION", null, "uk-UA"),
ru: client.translate("economy/leaderboard:DESCRIPTION", null, "ru-RU"), ru: client.translate("economy/leaderboard:DESCRIPTION", null, "ru-RU"),
}) })
.setDMPermission(false) .setContexts([InteractionContextType.Guild])
.addStringOption(option => .addStringOption(option =>
option option
.setName("type") .setName("type")

View file

@ -1,4 +1,4 @@
const { SlashCommandBuilder, ActionRowBuilder, ButtonBuilder, ButtonStyle } = require("discord.js"); const { SlashCommandBuilder, ActionRowBuilder, ButtonBuilder, ButtonStyle, InteractionContextType } = require("discord.js");
const BaseCommand = require("../../base/BaseCommand"), const BaseCommand = require("../../base/BaseCommand"),
pendings = {}; pendings = {};
@ -16,7 +16,7 @@ class Marry extends BaseCommand {
uk: client.translate("economy/marry:DESCRIPTION", null, "uk-UA"), uk: client.translate("economy/marry:DESCRIPTION", null, "uk-UA"),
ru: client.translate("economy/marry:DESCRIPTION", null, "ru-RU"), ru: client.translate("economy/marry:DESCRIPTION", null, "ru-RU"),
}) })
.setDMPermission(false) .setContexts([InteractionContextType.Guild])
.addUserOption(option => .addUserOption(option =>
option option
.setName("user") .setName("user")

View file

@ -1,4 +1,4 @@
const { SlashCommandBuilder } = require("discord.js"); const { SlashCommandBuilder, InteractionContextType } = require("discord.js");
const BaseCommand = require("../../base/BaseCommand"); const BaseCommand = require("../../base/BaseCommand");
class Money extends BaseCommand { class Money extends BaseCommand {
@ -15,7 +15,7 @@ class Money extends BaseCommand {
uk: client.translate("economy/money:DESCRIPTION", null, "uk-UA"), uk: client.translate("economy/money:DESCRIPTION", null, "uk-UA"),
ru: client.translate("economy/money:DESCRIPTION", null, "ru-RU"), ru: client.translate("economy/money:DESCRIPTION", null, "ru-RU"),
}) })
.setDMPermission(false) .setContexts([InteractionContextType.Guild])
.addUserOption(option => .addUserOption(option =>
option option
.setName("user") .setName("user")

View file

@ -1,4 +1,4 @@
const { SlashCommandBuilder } = require("discord.js"); const { SlashCommandBuilder, InteractionContextType } = require("discord.js");
const BaseCommand = require("../../base/BaseCommand"); const BaseCommand = require("../../base/BaseCommand");
class Pay extends BaseCommand { class Pay extends BaseCommand {
@ -15,7 +15,7 @@ class Pay extends BaseCommand {
uk: client.translate("economy/pay:DESCRIPTION", null, "uk-UA"), uk: client.translate("economy/pay:DESCRIPTION", null, "uk-UA"),
ru: client.translate("economy/pay:DESCRIPTION", null, "ru-RU"), ru: client.translate("economy/pay:DESCRIPTION", null, "ru-RU"),
}) })
.setDMPermission(false) .setContexts([InteractionContextType.Guild])
.addUserOption(option => .addUserOption(option =>
option option
.setName("user") .setName("user")

View file

@ -1,4 +1,4 @@
const { SlashCommandBuilder } = require("discord.js"); const { SlashCommandBuilder, InteractionContextType } = require("discord.js");
const BaseCommand = require("../../base/BaseCommand"); const BaseCommand = require("../../base/BaseCommand");
class Profile extends BaseCommand { class Profile extends BaseCommand {
@ -15,7 +15,7 @@ class Profile extends BaseCommand {
uk: client.translate("economy/profile:DESCRIPTION", null, "uk-UA"), uk: client.translate("economy/profile:DESCRIPTION", null, "uk-UA"),
ru: client.translate("economy/profile:DESCRIPTION", null, "ru-RU"), ru: client.translate("economy/profile:DESCRIPTION", null, "ru-RU"),
}) })
.setDMPermission(false) .setContexts([InteractionContextType.Guild])
.addUserOption(option => .addUserOption(option =>
option option
.setName("user") .setName("user")

View file

@ -1,4 +1,4 @@
const { SlashCommandBuilder } = require("discord.js"); const { SlashCommandBuilder, InteractionContextType } = require("discord.js");
const BaseCommand = require("../../base/BaseCommand"); const BaseCommand = require("../../base/BaseCommand");
class Rep extends BaseCommand { class Rep extends BaseCommand {
@ -15,7 +15,7 @@ class Rep extends BaseCommand {
uk: client.translate("economy/rep:DESCRIPTION", null, "uk-UA"), uk: client.translate("economy/rep:DESCRIPTION", null, "uk-UA"),
ru: client.translate("economy/rep:DESCRIPTION", null, "ru-RU"), ru: client.translate("economy/rep:DESCRIPTION", null, "ru-RU"),
}) })
.setDMPermission(false) .setContexts([InteractionContextType.Guild])
.addUserOption(option => .addUserOption(option =>
option option
.setName("user") .setName("user")

View file

@ -1,4 +1,4 @@
const { SlashCommandBuilder } = require("discord.js"); const { SlashCommandBuilder, InteractionContextType } = require("discord.js");
const BaseCommand = require("../../base/BaseCommand"); const BaseCommand = require("../../base/BaseCommand");
class Rob extends BaseCommand { class Rob extends BaseCommand {
@ -15,7 +15,7 @@ class Rob extends BaseCommand {
uk: client.translate("economy/rob:DESCRIPTION", null, "uk-UA"), uk: client.translate("economy/rob:DESCRIPTION", null, "uk-UA"),
ru: client.translate("economy/rob:DESCRIPTION", null, "ru-RU"), ru: client.translate("economy/rob:DESCRIPTION", null, "ru-RU"),
}) })
.setDMPermission(false) .setContexts([InteractionContextType.Guild])
.addUserOption(option => .addUserOption(option =>
option option
.setName("user") .setName("user")

View file

@ -1,4 +1,4 @@
const { SlashCommandBuilder } = require("discord.js"); const { SlashCommandBuilder, InteractionContextType } = require("discord.js");
const BaseCommand = require("../../base/BaseCommand"); const BaseCommand = require("../../base/BaseCommand");
class Setbio extends BaseCommand { class Setbio extends BaseCommand {
@ -15,7 +15,7 @@ class Setbio extends BaseCommand {
uk: client.translate("economy/setbio:DESCRIPTION", null, "uk-UA"), uk: client.translate("economy/setbio:DESCRIPTION", null, "uk-UA"),
ru: client.translate("economy/setbio:DESCRIPTION", null, "ru-RU"), ru: client.translate("economy/setbio:DESCRIPTION", null, "ru-RU"),
}) })
.setDMPermission(true) .setContexts([InteractionContextType.BotDM, InteractionContextType.Guild])
.addStringOption(option => .addStringOption(option =>
option option
.setName("text") .setName("text")
@ -37,6 +37,8 @@ class Setbio extends BaseCommand {
* @param {import("discord.js").ChatInputCommandInteraction} interaction * @param {import("discord.js").ChatInputCommandInteraction} interaction
*/ */
async execute(client, interaction) { async execute(client, interaction) {
await interaction.deferReply({ ephemeral: true });
const userData = interaction.data.user, const userData = interaction.data.user,
newBio = interaction.options.getString("text"); newBio = interaction.options.getString("text");
if (newBio.length > 150) return interaction.error("economy/setbio:MAX_CHARACTERS"); if (newBio.length > 150) return interaction.error("economy/setbio:MAX_CHARACTERS");
@ -45,7 +47,7 @@ class Setbio extends BaseCommand {
await userData.save(); await userData.save();
interaction.success("economy/setbio:SUCCESS"); interaction.success("economy/setbio:SUCCESS", null, { edit: true });
} }
} }

View file

@ -1,4 +1,4 @@
const { SlashCommandBuilder } = require("discord.js"); const { SlashCommandBuilder, InteractionContextType } = require("discord.js");
const BaseCommand = require("../../base/BaseCommand"); const BaseCommand = require("../../base/BaseCommand");
class Slots extends BaseCommand { class Slots extends BaseCommand {
@ -15,7 +15,7 @@ class Slots extends BaseCommand {
uk: client.translate("economy/slots:DESCRIPTION", null, "uk-UA"), uk: client.translate("economy/slots:DESCRIPTION", null, "uk-UA"),
ru: client.translate("economy/slots:DESCRIPTION", null, "ru-RU"), ru: client.translate("economy/slots:DESCRIPTION", null, "ru-RU"),
}) })
.setDMPermission(false) .setContexts([InteractionContextType.Guild])
.addIntegerOption(option => .addIntegerOption(option =>
option option
.setName("amount") .setName("amount")

View file

@ -1,4 +1,4 @@
const { SlashCommandBuilder } = require("discord.js"); const { SlashCommandBuilder, InteractionContextType } = require("discord.js");
const BaseCommand = require("../../base/BaseCommand"); const BaseCommand = require("../../base/BaseCommand");
class Transactions extends BaseCommand { class Transactions extends BaseCommand {
@ -15,7 +15,7 @@ class Transactions extends BaseCommand {
uk: client.translate("economy/transactions:DESCRIPTION", null, "uk-UA"), uk: client.translate("economy/transactions:DESCRIPTION", null, "uk-UA"),
ru: client.translate("economy/transactions:DESCRIPTION", null, "ru-RU"), ru: client.translate("economy/transactions:DESCRIPTION", null, "ru-RU"),
}) })
.setDMPermission(false) .setContexts([InteractionContextType.Guild])
.addBooleanOption(option => .addBooleanOption(option =>
option option
.setName("clear") .setName("clear")

View file

@ -1,4 +1,4 @@
const { SlashCommandBuilder, parseEmoji } = require("discord.js"); const { SlashCommandBuilder, parseEmoji, InteractionContextType } = require("discord.js");
const BaseCommand = require("../../base/BaseCommand"); const BaseCommand = require("../../base/BaseCommand");
class Work extends BaseCommand { class Work extends BaseCommand {
@ -15,7 +15,7 @@ class Work extends BaseCommand {
uk: client.translate("economy/work:DESCRIPTION", null, "uk-UA"), uk: client.translate("economy/work:DESCRIPTION", null, "uk-UA"),
ru: client.translate("economy/work:DESCRIPTION", null, "ru-RU"), ru: client.translate("economy/work:DESCRIPTION", null, "ru-RU"),
}) })
.setDMPermission(false), .setContexts([InteractionContextType.Guild]),
dirname: __dirname, dirname: __dirname,
ownerOnly: false, ownerOnly: false,
}); });

View file

@ -1,4 +1,4 @@
const { SlashCommandBuilder } = require("discord.js"); const { SlashCommandBuilder, InteractionContextType } = require("discord.js");
const BaseCommand = require("../../base/BaseCommand"); const BaseCommand = require("../../base/BaseCommand");
class Eightball extends BaseCommand { class Eightball extends BaseCommand {
@ -15,7 +15,7 @@ class Eightball extends BaseCommand {
uk: client.translate("fun/8ball:DESCRIPTION", null, "uk-UA"), uk: client.translate("fun/8ball:DESCRIPTION", null, "uk-UA"),
ru: client.translate("fun/8ball:DESCRIPTION", null, "ru-RU"), ru: client.translate("fun/8ball:DESCRIPTION", null, "ru-RU"),
}) })
.setDMPermission(true) .setContexts([InteractionContextType.BotDM, InteractionContextType.PrivateChannel, InteractionContextType.Guild])
.addStringOption(option => .addStringOption(option =>
option option
.setName("question") .setName("question")

View file

@ -1,4 +1,4 @@
const { SlashCommandBuilder } = require("discord.js"); const { SlashCommandBuilder, InteractionContextType } = require("discord.js");
const BaseCommand = require("../../base/BaseCommand"), const BaseCommand = require("../../base/BaseCommand"),
fetch = require("node-fetch"); fetch = require("node-fetch");
@ -16,7 +16,7 @@ class Cat extends BaseCommand {
uk: client.translate("fun/cat:DESCRIPTION", null, "uk-UA"), uk: client.translate("fun/cat:DESCRIPTION", null, "uk-UA"),
ru: client.translate("fun/cat:DESCRIPTION", null, "ru-RU"), ru: client.translate("fun/cat:DESCRIPTION", null, "ru-RU"),
}) })
.setDMPermission(true), .setContexts([InteractionContextType.BotDM, InteractionContextType.PrivateChannel, InteractionContextType.Guild]),
dirname: __dirname, dirname: __dirname,
ownerOnly: false, ownerOnly: false,
}); });

View file

@ -1,4 +1,4 @@
const { SlashCommandBuilder } = require("discord.js"); const { SlashCommandBuilder, InteractionContextType } = require("discord.js");
const BaseCommand = require("../../base/BaseCommand"), const BaseCommand = require("../../base/BaseCommand"),
fetch = require("node-fetch"); fetch = require("node-fetch");
@ -16,7 +16,7 @@ class Dog extends BaseCommand {
uk: client.translate("fun/dog:DESCRIPTION", null, "uk-UA"), uk: client.translate("fun/dog:DESCRIPTION", null, "uk-UA"),
ru: client.translate("fun/dog:DESCRIPTION", null, "ru-RU"), ru: client.translate("fun/dog:DESCRIPTION", null, "ru-RU"),
}) })
.setDMPermission(true), .setContexts([InteractionContextType.BotDM, InteractionContextType.PrivateChannel, InteractionContextType.Guild]),
dirname: __dirname, dirname: __dirname,
ownerOnly: false, ownerOnly: false,
}); });

View file

@ -1,4 +1,4 @@
const { SlashCommandBuilder } = require("discord.js"); const { SlashCommandBuilder, InteractionContextType } = require("discord.js");
const BaseCommand = require("../../base/BaseCommand"), const BaseCommand = require("../../base/BaseCommand"),
fetch = require("node-fetch"); fetch = require("node-fetch");
@ -16,7 +16,7 @@ class LMGTFY extends BaseCommand {
uk: client.translate("fun/lmgtfy:DESCRIPTION", null, "uk-UA"), uk: client.translate("fun/lmgtfy:DESCRIPTION", null, "uk-UA"),
ru: client.translate("fun/lmgtfy:DESCRIPTION", null, "ru-RU"), ru: client.translate("fun/lmgtfy:DESCRIPTION", null, "ru-RU"),
}) })
.setDMPermission(true) .setContexts([InteractionContextType.BotDM, InteractionContextType.PrivateChannel, InteractionContextType.Guild])
.addStringOption(option => .addStringOption(option =>
option option
.setName("query") .setName("query")

View file

@ -1,4 +1,4 @@
const { SlashCommandBuilder } = require("discord.js"); const { SlashCommandBuilder, InteractionContextType } = require("discord.js");
const BaseCommand = require("../../base/BaseCommand"), const BaseCommand = require("../../base/BaseCommand"),
md5 = require("md5"); md5 = require("md5");
@ -16,7 +16,7 @@ class Lovecalc extends BaseCommand {
uk: client.translate("fun/lovecalc:DESCRIPTION", null, "uk-UA"), uk: client.translate("fun/lovecalc:DESCRIPTION", null, "uk-UA"),
ru: client.translate("fun/lovecalc:DESCRIPTION", null, "ru-RU"), ru: client.translate("fun/lovecalc:DESCRIPTION", null, "ru-RU"),
}) })
.setDMPermission(false) .setContexts([InteractionContextType.Guild])
.addUserOption(option => .addUserOption(option =>
option option
.setName("first_member") .setName("first_member")

View file

@ -1,4 +1,4 @@
const { SlashCommandBuilder, MessageCollector, ButtonBuilder, ActionRowBuilder, ButtonStyle, ThreadAutoArchiveDuration } = require("discord.js"); const { SlashCommandBuilder, MessageCollector, ButtonBuilder, ActionRowBuilder, ButtonStyle, ThreadAutoArchiveDuration, InteractionContextType } = require("discord.js");
const BaseCommand = require("../../base/BaseCommand"), const BaseCommand = require("../../base/BaseCommand"),
currentGames = {}; currentGames = {};
@ -16,7 +16,7 @@ class Number extends BaseCommand {
uk: client.translate("fun/number:DESCRIPTION", null, "uk-UA"), uk: client.translate("fun/number:DESCRIPTION", null, "uk-UA"),
ru: client.translate("fun/number:DESCRIPTION", null, "ru-RU"), ru: client.translate("fun/number:DESCRIPTION", null, "ru-RU"),
}) })
.setDMPermission(false), .setContexts([InteractionContextType.Guild, InteractionContextType.PrivateChannel]),
dirname: __dirname, dirname: __dirname,
ownerOnly: false, ownerOnly: false,
}); });

View file

@ -1,4 +1,4 @@
const { SlashCommandBuilder } = require("discord.js"); const { SlashCommandBuilder, InteractionContextType } = require("discord.js");
const BaseCommand = require("../../base/BaseCommand"), const BaseCommand = require("../../base/BaseCommand"),
tictactoe = require("../../helpers/tictactoe"); tictactoe = require("../../helpers/tictactoe");
@ -16,7 +16,7 @@ class TicTacToe extends BaseCommand {
uk: client.translate("fun/tictactoe:DESCRIPTION", null, "uk-UA"), uk: client.translate("fun/tictactoe:DESCRIPTION", null, "uk-UA"),
ru: client.translate("fun/tictactoe:DESCRIPTION", null, "ru-RU"), ru: client.translate("fun/tictactoe:DESCRIPTION", null, "ru-RU"),
}) })
.setDMPermission(false) .setContexts([InteractionContextType.Guild, InteractionContextType.PrivateChannel])
.addUserOption(option => .addUserOption(option =>
option option
.setName("user") .setName("user")

View file

@ -1,4 +1,4 @@
const { SlashCommandBuilder } = require("discord.js"); const { SlashCommandBuilder, InteractionContextType } = require("discord.js");
const BaseCommand = require("../../base/BaseCommand"); const BaseCommand = require("../../base/BaseCommand");
class Afk extends BaseCommand { class Afk extends BaseCommand {
@ -15,7 +15,7 @@ class Afk extends BaseCommand {
uk: client.translate("general/afk:DESCRIPTION", null, "uk-UA"), uk: client.translate("general/afk:DESCRIPTION", null, "uk-UA"),
ru: client.translate("general/afk:DESCRIPTION", null, "ru-RU"), ru: client.translate("general/afk:DESCRIPTION", null, "ru-RU"),
}) })
.setDMPermission(true) .setContexts([InteractionContextType.BotDM, InteractionContextType.PrivateChannel, InteractionContextType.Guild])
.addStringOption(option => .addStringOption(option =>
option option
.setName("message") .setName("message")

View file

@ -1,4 +1,4 @@
const { ContextMenuCommandBuilder, ApplicationCommandType } = require("discord.js"); const { ContextMenuCommandBuilder, ApplicationCommandType, InteractionContextType } = require("discord.js");
const BaseCommand = require("../../base/BaseCommand"); const BaseCommand = require("../../base/BaseCommand");
class AvatarContext extends BaseCommand { class AvatarContext extends BaseCommand {
@ -11,7 +11,7 @@ class AvatarContext extends BaseCommand {
command: new ContextMenuCommandBuilder() command: new ContextMenuCommandBuilder()
.setName("Get Avatar") .setName("Get Avatar")
.setType(ApplicationCommandType.User) .setType(ApplicationCommandType.User)
.setDMPermission(false), .setContexts([InteractionContextType.BotDM, InteractionContextType.PrivateChannel, InteractionContextType.Guild]),
dirname: __dirname, dirname: __dirname,
ownerOnly: false, ownerOnly: false,
}); });

View file

@ -1,4 +1,4 @@
const { SlashCommandBuilder } = require("discord.js"); const { SlashCommandBuilder, InteractionContextType } = require("discord.js");
const BaseCommand = require("../../base/BaseCommand"); const BaseCommand = require("../../base/BaseCommand");
class Avatar extends BaseCommand { class Avatar extends BaseCommand {
@ -15,7 +15,7 @@ class Avatar extends BaseCommand {
uk: client.translate("general/avatar:DESCRIPTION", null, "uk-UA"), uk: client.translate("general/avatar:DESCRIPTION", null, "uk-UA"),
ru: client.translate("general/avatar:DESCRIPTION", null, "ru-RU"), ru: client.translate("general/avatar:DESCRIPTION", null, "ru-RU"),
}) })
.setDMPermission(true) .setContexts([InteractionContextType.BotDM, InteractionContextType.PrivateChannel, InteractionContextType.Guild])
.addUserOption(option => .addUserOption(option =>
option option
.setName("user") .setName("user")
@ -45,8 +45,8 @@ class Avatar extends BaseCommand {
* @param {import("discord.js").ChatInputCommandInteraction} interaction * @param {import("discord.js").ChatInputCommandInteraction} interaction
*/ */
async execute(client, interaction) { async execute(client, interaction) {
const member = interaction.options.getMember("user") || interaction.member; const user = interaction.options.getUser("user") || interaction.user;
const avatarURL = interaction.options.getBoolean("server") ? member.displayAvatarURL({ size: 2048 }) : member.user.displayAvatarURL({ size: 2048 }); const avatarURL = interaction.options.getBoolean("server") ? user.displayAvatarURL({ size: 2048 }) : user.avatarURL({ size: 2048 });
const embed = client.embed({ image: avatarURL }); const embed = client.embed({ image: avatarURL });
interaction.reply({ interaction.reply({

View file

@ -1,4 +1,4 @@
const { SlashCommandBuilder, ActionRowBuilder, ButtonBuilder, ButtonStyle } = require("discord.js"); const { SlashCommandBuilder, ActionRowBuilder, ButtonBuilder, ButtonStyle, InteractionContextType } = require("discord.js");
const BaseCommand = require("../../base/BaseCommand"); const BaseCommand = require("../../base/BaseCommand");
class Boosters extends BaseCommand { class Boosters extends BaseCommand {
@ -15,7 +15,7 @@ class Boosters extends BaseCommand {
uk: client.translate("general/boosters:DESCRIPTION", null, "uk-UA"), uk: client.translate("general/boosters:DESCRIPTION", null, "uk-UA"),
ru: client.translate("general/boosters:DESCRIPTION", null, "ru-RU"), ru: client.translate("general/boosters:DESCRIPTION", null, "ru-RU"),
}) })
.setDMPermission(false), .setContexts([InteractionContextType.Guild]),
dirname: __dirname, dirname: __dirname,
ownerOnly: false, ownerOnly: false,
}); });

View file

@ -1,4 +1,4 @@
const { SlashCommandBuilder, parseEmoji } = require("discord.js"); const { SlashCommandBuilder, parseEmoji, InteractionContextType } = require("discord.js");
const BaseCommand = require("../../base/BaseCommand"); const BaseCommand = require("../../base/BaseCommand");
class Emoji extends BaseCommand { class Emoji extends BaseCommand {
@ -15,7 +15,7 @@ class Emoji extends BaseCommand {
uk: client.translate("general/emoji:DESCRIPTION", null, "uk-UA"), uk: client.translate("general/emoji:DESCRIPTION", null, "uk-UA"),
ru: client.translate("general/emoji:DESCRIPTION", null, "ru-RU"), ru: client.translate("general/emoji:DESCRIPTION", null, "ru-RU"),
}) })
.setDMPermission(true) .setContexts([InteractionContextType.BotDM, InteractionContextType.PrivateChannel, InteractionContextType.Guild])
.addStringOption(option => .addStringOption(option =>
option option
.setName("emoji") .setName("emoji")

View file

@ -1,4 +1,4 @@
const { SlashCommandBuilder, ActionRowBuilder, StringSelectMenuBuilder, PermissionsBitField } = require("discord.js"); const { SlashCommandBuilder, ActionRowBuilder, StringSelectMenuBuilder, PermissionsBitField, InteractionContextType } = require("discord.js");
const BaseCommand = require("../../base/BaseCommand"); const BaseCommand = require("../../base/BaseCommand");
class Help extends BaseCommand { class Help extends BaseCommand {
@ -15,7 +15,7 @@ class Help extends BaseCommand {
uk: client.translate("general/help:DESCRIPTION", null, "uk-UA"), uk: client.translate("general/help:DESCRIPTION", null, "uk-UA"),
ru: client.translate("general/help:DESCRIPTION", null, "ru-RU"), ru: client.translate("general/help:DESCRIPTION", null, "ru-RU"),
}) })
.setDMPermission(true) .setContexts([InteractionContextType.BotDM, InteractionContextType.PrivateChannel, InteractionContextType.Guild])
.addStringOption(option => .addStringOption(option =>
option option
.setName("command") .setName("command")

View file

@ -1,4 +1,4 @@
const { SlashCommandBuilder, ChannelType } = require("discord.js"); const { SlashCommandBuilder, ChannelType, InteractionContextType } = require("discord.js");
const BaseCommand = require("../../base/BaseCommand"); const BaseCommand = require("../../base/BaseCommand");
class Info extends BaseCommand { class Info extends BaseCommand {
@ -15,7 +15,7 @@ class Info extends BaseCommand {
uk: client.translate("general/info:DESCRIPTION", null, "uk-UA"), uk: client.translate("general/info:DESCRIPTION", null, "uk-UA"),
ru: client.translate("general/info:DESCRIPTION", null, "ru-RU"), ru: client.translate("general/info:DESCRIPTION", null, "ru-RU"),
}) })
.setDMPermission(false) .setContexts([InteractionContextType.Guild])
.addSubcommand(subcommand => .addSubcommand(subcommand =>
subcommand subcommand
.setName("user") .setName("user")

View file

@ -1,4 +1,4 @@
const { SlashCommandBuilder } = require("discord.js"); const { SlashCommandBuilder, InteractionContextType } = require("discord.js");
const BaseCommand = require("../../base/BaseCommand"), const BaseCommand = require("../../base/BaseCommand"),
gamedig = require("gamedig"); gamedig = require("gamedig");
@ -16,7 +16,7 @@ class Minecraft extends BaseCommand {
uk: client.translate("general/minecraft:DESCRIPTION", null, "uk-UA"), uk: client.translate("general/minecraft:DESCRIPTION", null, "uk-UA"),
ru: client.translate("general/minecraft:DESCRIPTION", null, "ru-RU"), ru: client.translate("general/minecraft:DESCRIPTION", null, "ru-RU"),
}) })
.setDMPermission(true) .setContexts([InteractionContextType.BotDM, InteractionContextType.PrivateChannel, InteractionContextType.Guild])
.addStringOption(option => .addStringOption(option =>
option option
.setName("ip") .setName("ip")

View file

@ -1,4 +1,4 @@
const { SlashCommandBuilder } = require("discord.js"); const { SlashCommandBuilder, InteractionContextType } = require("discord.js");
const BaseCommand = require("../../base/BaseCommand"); const BaseCommand = require("../../base/BaseCommand");
class Ping extends BaseCommand { class Ping extends BaseCommand {
@ -15,7 +15,7 @@ class Ping extends BaseCommand {
uk: client.translate("general/ping:DESCRIPTION", null, "uk-UA"), uk: client.translate("general/ping:DESCRIPTION", null, "uk-UA"),
ru: client.translate("general/ping:DESCRIPTION", null, "ru-RU"), ru: client.translate("general/ping:DESCRIPTION", null, "ru-RU"),
}) })
.setDMPermission(true), .setContexts([InteractionContextType.BotDM, InteractionContextType.PrivateChannel, InteractionContextType.Guild]),
dirname: __dirname, dirname: __dirname,
ownerOnly: false, ownerOnly: false,
}); });

View file

@ -1,4 +1,4 @@
const { SlashCommandBuilder } = require("discord.js"); const { SlashCommandBuilder, InteractionContextType } = require("discord.js");
const BaseCommand = require("../../base/BaseCommand"), const BaseCommand = require("../../base/BaseCommand"),
ms = require("ms"); ms = require("ms");
@ -16,7 +16,7 @@ class Remindme extends BaseCommand {
uk: client.translate("general/remindme:DESCRIPTION", null, "uk-UA"), uk: client.translate("general/remindme:DESCRIPTION", null, "uk-UA"),
ru: client.translate("general/remindme:DESCRIPTION", null, "ru-RU"), ru: client.translate("general/remindme:DESCRIPTION", null, "ru-RU"),
}) })
.setDMPermission(true) .setContexts([InteractionContextType.BotDM, InteractionContextType.PrivateChannel, InteractionContextType.Guild])
.addStringOption(option => .addStringOption(option =>
option option
.setName("time") .setName("time")

View file

@ -1,4 +1,4 @@
const { SlashCommandBuilder, ActionRowBuilder, ButtonBuilder, ButtonStyle } = require("discord.js"); const { SlashCommandBuilder, ActionRowBuilder, ButtonBuilder, ButtonStyle, InteractionContextType } = require("discord.js");
const BaseCommand = require("../../base/BaseCommand"); const BaseCommand = require("../../base/BaseCommand");
class Reminds extends BaseCommand { class Reminds extends BaseCommand {
@ -15,7 +15,7 @@ class Reminds extends BaseCommand {
uk: client.translate("general/reminds:DESCRIPTION", null, "uk-UA"), uk: client.translate("general/reminds:DESCRIPTION", null, "uk-UA"),
ru: client.translate("general/reminds:DESCRIPTION", null, "ru-RU"), ru: client.translate("general/reminds:DESCRIPTION", null, "ru-RU"),
}) })
.setDMPermission(true), .setContexts([InteractionContextType.BotDM, InteractionContextType.PrivateChannel, InteractionContextType.Guild]),
dirname: __dirname, dirname: __dirname,
ownerOnly: false, ownerOnly: false,
}); });

View file

@ -1,4 +1,4 @@
const { SlashCommandBuilder, parseEmoji } = require("discord.js"); const { SlashCommandBuilder, parseEmoji, InteractionContextType } = require("discord.js");
const BaseCommand = require("../../base/BaseCommand"); const BaseCommand = require("../../base/BaseCommand");
class Report extends BaseCommand { class Report extends BaseCommand {
@ -15,7 +15,7 @@ class Report extends BaseCommand {
uk: client.translate("general/report:DESCRIPTION", null, "uk-UA"), uk: client.translate("general/report:DESCRIPTION", null, "uk-UA"),
ru: client.translate("general/report:DESCRIPTION", null, "ru-RU"), ru: client.translate("general/report:DESCRIPTION", null, "ru-RU"),
}) })
.setDMPermission(false) .setContexts([InteractionContextType.Guild])
.addUserOption(option => .addUserOption(option =>
option option
.setName("user") .setName("user")

View file

@ -1,4 +1,4 @@
const { SlashCommandBuilder } = require("discord.js"); const { SlashCommandBuilder, InteractionContextType } = require("discord.js");
const BaseCommand = require("../../base/BaseCommand"), const BaseCommand = require("../../base/BaseCommand"),
fetch = require("node-fetch"); fetch = require("node-fetch");
@ -16,7 +16,7 @@ class Shorturl extends BaseCommand {
uk: client.translate("general/shorturl:DESCRIPTION", null, "uk-UA"), uk: client.translate("general/shorturl:DESCRIPTION", null, "uk-UA"),
ru: client.translate("general/shorturl:DESCRIPTION", null, "ru-RU"), ru: client.translate("general/shorturl:DESCRIPTION", null, "ru-RU"),
}) })
.setDMPermission(true) .setContexts([InteractionContextType.BotDM, InteractionContextType.PrivateChannel, InteractionContextType.Guild])
.addStringOption(option => .addStringOption(option =>
option option
.setName("url") .setName("url")

View file

@ -1,4 +1,4 @@
const { SlashCommandBuilder, PermissionsBitField, version: djsVersion } = require("discord.js"); const { SlashCommandBuilder, PermissionsBitField, version: discordJsVersion, InteractionContextType } = require("discord.js");
const BaseCommand = require("../../base/BaseCommand"); const BaseCommand = require("../../base/BaseCommand");
class Stats extends BaseCommand { class Stats extends BaseCommand {
@ -15,7 +15,7 @@ class Stats extends BaseCommand {
uk: client.translate("general/stats:DESCRIPTION", null, "uk-UA"), uk: client.translate("general/stats:DESCRIPTION", null, "uk-UA"),
ru: client.translate("general/stats:DESCRIPTION", null, "ru-RU"), ru: client.translate("general/stats:DESCRIPTION", null, "ru-RU"),
}) })
.setDMPermission(true), .setContexts([InteractionContextType.BotDM, InteractionContextType.PrivateChannel, InteractionContextType.Guild]),
dirname: __dirname, dirname: __dirname,
ownerOnly: false, ownerOnly: false,
}); });
@ -47,7 +47,7 @@ class Stats extends BaseCommand {
}, },
{ {
name: client.customEmojis.version + " " + interaction.translate("general/stats:VERSIONS_TITLE"), name: client.customEmojis.version + " " + interaction.translate("general/stats:VERSIONS_TITLE"),
value: `\`Discord.js: v${djsVersion}\`\n\`Nodejs: v${process.versions.node}\``, value: `\`Discord.js: v${discordJsVersion}\`\n\`Nodejs: v${process.versions.node}\``,
inline: true, inline: true,
}, },
{ {

View file

@ -1,4 +1,4 @@
const { SlashCommandBuilder, parseEmoji } = require("discord.js"); const { SlashCommandBuilder, parseEmoji, InteractionContextType } = require("discord.js");
const BaseCommand = require("../../base/BaseCommand"); const BaseCommand = require("../../base/BaseCommand");
class Suggest extends BaseCommand { class Suggest extends BaseCommand {
@ -15,7 +15,7 @@ class Suggest extends BaseCommand {
uk: client.translate("general/suggest:DESCRIPTION", null, "uk-UA"), uk: client.translate("general/suggest:DESCRIPTION", null, "uk-UA"),
ru: client.translate("general/suggest:DESCRIPTION", null, "ru-RU"), ru: client.translate("general/suggest:DESCRIPTION", null, "ru-RU"),
}) })
.setDMPermission(false) .setContexts([InteractionContextType.Guild])
.addStringOption(option => .addStringOption(option =>
option option
.setName("message") .setName("message")

View file

@ -1,4 +1,4 @@
const { SlashCommandBuilder } = require("discord.js"); const { SlashCommandBuilder, InteractionContextType } = require("discord.js");
const BaseCommand = require("../../base/BaseCommand"), const BaseCommand = require("../../base/BaseCommand"),
fetch = require("node-fetch"); fetch = require("node-fetch");
@ -16,7 +16,7 @@ class Whois extends BaseCommand {
uk: client.translate("general/whois:DESCRIPTION", null, "uk-UA"), uk: client.translate("general/whois:DESCRIPTION", null, "uk-UA"),
ru: client.translate("general/whois:DESCRIPTION", null, "ru-RU"), ru: client.translate("general/whois:DESCRIPTION", null, "ru-RU"),
}) })
.setDMPermission(true) .setContexts([InteractionContextType.BotDM, InteractionContextType.PrivateChannel, InteractionContextType.Guild])
.addStringOption(option => .addStringOption(option =>
option option
.setName("ip") .setName("ip")

View file

@ -1,4 +1,4 @@
const { SlashCommandBuilder } = require("discord.js"); const { SlashCommandBuilder, InteractionContextType } = require("discord.js");
const BaseCommand = require("../../base/BaseCommand"), const BaseCommand = require("../../base/BaseCommand"),
fetch = require("node-fetch"), fetch = require("node-fetch"),
moment = require("moment"); moment = require("moment");
@ -17,7 +17,7 @@ class Checkjar extends BaseCommand {
uk: client.translate("iat/checkjar:DESCRIPTION", null, "uk-UA"), uk: client.translate("iat/checkjar:DESCRIPTION", null, "uk-UA"),
ru: client.translate("iat/checkjar:DESCRIPTION", null, "ru-RU"), ru: client.translate("iat/checkjar:DESCRIPTION", null, "ru-RU"),
}) })
.setDMPermission(false), .setContexts([InteractionContextType.Guild]),
dirname: __dirname, dirname: __dirname,
ownerOnly: false, ownerOnly: false,
}); });

View file

@ -1,4 +1,4 @@
const { SlashCommandBuilder, ActionRowBuilder, ButtonBuilder, ButtonStyle, PermissionsBitField } = require("discord.js"); const { SlashCommandBuilder, ActionRowBuilder, ButtonBuilder, ButtonStyle, PermissionsBitField, InteractionContextType } = require("discord.js");
const BaseCommand = require("../../base/BaseCommand"); const BaseCommand = require("../../base/BaseCommand");
class Clear extends BaseCommand { class Clear extends BaseCommand {
@ -15,7 +15,7 @@ class Clear extends BaseCommand {
uk: client.translate("moderation/clear:DESCRIPTION", null, "uk-UA"), uk: client.translate("moderation/clear:DESCRIPTION", null, "uk-UA"),
ru: client.translate("moderation/clear:DESCRIPTION", null, "ru-RU"), ru: client.translate("moderation/clear:DESCRIPTION", null, "ru-RU"),
}) })
.setDMPermission(false) .setContexts([InteractionContextType.Guild])
.setDefaultMemberPermissions(PermissionsBitField.Flags.ManageMessages) .setDefaultMemberPermissions(PermissionsBitField.Flags.ManageMessages)
.addStringOption(option => .addStringOption(option =>
option option

View file

@ -1,4 +1,4 @@
const { SlashCommandBuilder, PermissionsBitField } = require("discord.js"); const { SlashCommandBuilder, PermissionsBitField, InteractionContextType } = require("discord.js");
const BaseCommand = require("../../base/BaseCommand"); const BaseCommand = require("../../base/BaseCommand");
class Clearwarns extends BaseCommand { class Clearwarns extends BaseCommand {
@ -15,7 +15,7 @@ class Clearwarns extends BaseCommand {
uk: client.translate("moderation/clearwarns:DESCRIPTION", null, "uk-UA"), uk: client.translate("moderation/clearwarns:DESCRIPTION", null, "uk-UA"),
ru: client.translate("moderation/clearwarns:DESCRIPTION", null, "ru-RU"), ru: client.translate("moderation/clearwarns:DESCRIPTION", null, "ru-RU"),
}) })
.setDMPermission(false) .setContexts([InteractionContextType.Guild])
.setDefaultMemberPermissions(PermissionsBitField.Flags.ManageMessages) .setDefaultMemberPermissions(PermissionsBitField.Flags.ManageMessages)
.addUserOption(option => .addUserOption(option =>
option option

View file

@ -1,4 +1,4 @@
const { SlashCommandBuilder, PermissionsBitField } = require("discord.js"); const { SlashCommandBuilder, PermissionsBitField, InteractionContextType } = require("discord.js");
const BaseCommand = require("../../base/BaseCommand"), const BaseCommand = require("../../base/BaseCommand"),
ms = require("ms"); ms = require("ms");
@ -16,7 +16,7 @@ class Giveaway extends BaseCommand {
uk: client.translate("moderation/giveaway:DESCRIPTION", null, "uk-UA"), uk: client.translate("moderation/giveaway:DESCRIPTION", null, "uk-UA"),
ru: client.translate("moderation/giveaway:DESCRIPTION", null, "ru-RU"), ru: client.translate("moderation/giveaway:DESCRIPTION", null, "ru-RU"),
}) })
.setDMPermission(false) .setContexts([InteractionContextType.Guild])
.setDefaultMemberPermissions(PermissionsBitField.Flags.ManageMessages) .setDefaultMemberPermissions(PermissionsBitField.Flags.ManageMessages)
.addSubcommand(subcommand => .addSubcommand(subcommand =>
subcommand subcommand

View file

@ -1,4 +1,4 @@
const { SlashCommandBuilder, ActionRowBuilder, ButtonBuilder, ButtonStyle, PermissionsBitField, parseEmoji } = require("discord.js"); const { SlashCommandBuilder, ActionRowBuilder, ButtonBuilder, ButtonStyle, PermissionsBitField, parseEmoji, InteractionContextType } = require("discord.js");
const BaseCommand = require("../../base/BaseCommand"); const BaseCommand = require("../../base/BaseCommand");
class Poll extends BaseCommand { class Poll extends BaseCommand {
@ -15,7 +15,7 @@ class Poll extends BaseCommand {
uk: client.translate("moderation/poll:DESCRIPTION", null, "uk-UA"), uk: client.translate("moderation/poll:DESCRIPTION", null, "uk-UA"),
ru: client.translate("moderation/poll:DESCRIPTION", null, "ru-RU"), ru: client.translate("moderation/poll:DESCRIPTION", null, "ru-RU"),
}) })
.setDMPermission(false) .setContexts([InteractionContextType.Guild])
.setDefaultMemberPermissions(PermissionsBitField.Flags.ManageMessages) .setDefaultMemberPermissions(PermissionsBitField.Flags.ManageMessages)
.addStringOption(option => .addStringOption(option =>
option option

View file

@ -1,4 +1,4 @@
const { SlashCommandBuilder, PermissionsBitField } = require("discord.js"); const { SlashCommandBuilder, PermissionsBitField, InteractionContextType } = require("discord.js");
const BaseCommand = require("../../base/BaseCommand"); const BaseCommand = require("../../base/BaseCommand");
class Unban extends BaseCommand { class Unban extends BaseCommand {
@ -15,7 +15,7 @@ class Unban extends BaseCommand {
uk: client.translate("moderation/unban:DESCRIPTION", null, "uk-UA"), uk: client.translate("moderation/unban:DESCRIPTION", null, "uk-UA"),
ru: client.translate("moderation/unban:DESCRIPTION", null, "ru-RU"), ru: client.translate("moderation/unban:DESCRIPTION", null, "ru-RU"),
}) })
.setDMPermission(false) .setContexts([InteractionContextType.Guild])
.setDefaultMemberPermissions(PermissionsBitField.Flags.ManageMessages) .setDefaultMemberPermissions(PermissionsBitField.Flags.ManageMessages)
.addStringOption(option => .addStringOption(option =>
option option

View file

@ -1,4 +1,4 @@
const { SlashCommandBuilder, PermissionsBitField } = require("discord.js"); const { SlashCommandBuilder, PermissionsBitField, InteractionContextType } = require("discord.js");
const BaseCommand = require("../../base/BaseCommand"); const BaseCommand = require("../../base/BaseCommand");
class Ban extends BaseCommand { class Ban extends BaseCommand {
@ -15,7 +15,7 @@ class Ban extends BaseCommand {
uk: client.translate("moderation/untimeout:DESCRIPTION", null, "uk-UA"), uk: client.translate("moderation/untimeout:DESCRIPTION", null, "uk-UA"),
ru: client.translate("moderation/untimeout:DESCRIPTION", null, "ru-RU"), ru: client.translate("moderation/untimeout:DESCRIPTION", null, "ru-RU"),
}) })
.setDMPermission(false) .setContexts([InteractionContextType.Guild])
.setDefaultMemberPermissions(PermissionsBitField.Flags.ModerateMembers) .setDefaultMemberPermissions(PermissionsBitField.Flags.ModerateMembers)
.addUserOption(option => .addUserOption(option =>
option option

View file

@ -1,4 +1,4 @@
const { ContextMenuCommandBuilder, ModalBuilder, ActionRowBuilder, TextInputBuilder, ApplicationCommandType, PermissionsBitField, TextInputStyle } = require("discord.js"); const { ContextMenuCommandBuilder, ModalBuilder, ActionRowBuilder, TextInputBuilder, ApplicationCommandType, PermissionsBitField, TextInputStyle, InteractionContextType } = require("discord.js");
const BaseCommand = require("../../base/BaseCommand"); const BaseCommand = require("../../base/BaseCommand");
class WarnContext extends BaseCommand { class WarnContext extends BaseCommand {
@ -11,7 +11,7 @@ class WarnContext extends BaseCommand {
command: new ContextMenuCommandBuilder() command: new ContextMenuCommandBuilder()
.setName("Give Warn") .setName("Give Warn")
.setType(ApplicationCommandType.User) .setType(ApplicationCommandType.User)
.setDMPermission(false) .setContexts([InteractionContextType.Guild])
.setDefaultMemberPermissions(PermissionsBitField.Flags.ManageMessages), .setDefaultMemberPermissions(PermissionsBitField.Flags.ManageMessages),
dirname: __dirname, dirname: __dirname,
ownerOnly: false, ownerOnly: false,

View file

@ -1,4 +1,4 @@
const { SlashCommandBuilder, PermissionsBitField } = require("discord.js"); const { SlashCommandBuilder, PermissionsBitField, InteractionContextType } = require("discord.js");
const BaseCommand = require("../../base/BaseCommand"); const BaseCommand = require("../../base/BaseCommand");
class Warns extends BaseCommand { class Warns extends BaseCommand {
@ -15,7 +15,7 @@ class Warns extends BaseCommand {
uk: client.translate("moderation/warns:DESCRIPTION", null, "uk-UA"), uk: client.translate("moderation/warns:DESCRIPTION", null, "uk-UA"),
ru: client.translate("moderation/warns:DESCRIPTION", null, "ru-RU"), ru: client.translate("moderation/warns:DESCRIPTION", null, "ru-RU"),
}) })
.setDMPermission(false) .setContexts([InteractionContextType.Guild])
.setDefaultMemberPermissions(PermissionsBitField.Flags.ManageMessages) .setDefaultMemberPermissions(PermissionsBitField.Flags.ManageMessages)
.addUserOption(option => .addUserOption(option =>
option option

View file

@ -1,4 +1,4 @@
const { SlashCommandBuilder } = require("discord.js"); const { SlashCommandBuilder, InteractionContextType } = require("discord.js");
const BaseCommand = require("../../base/BaseCommand"); const BaseCommand = require("../../base/BaseCommand");
class Back extends BaseCommand { class Back extends BaseCommand {
@ -15,7 +15,7 @@ class Back extends BaseCommand {
uk: client.translate("music/back:DESCRIPTION", null, "uk-UA"), uk: client.translate("music/back:DESCRIPTION", null, "uk-UA"),
ru: client.translate("music/back:DESCRIPTION", null, "ru-RU"), ru: client.translate("music/back:DESCRIPTION", null, "ru-RU"),
}) })
.setDMPermission(false), .setContexts([InteractionContextType.PrivateChannel, InteractionContextType.Guild]),
dirname: __dirname, dirname: __dirname,
ownerOnly: false, ownerOnly: false,
}); });

View file

@ -1,4 +1,4 @@
const { SlashCommandBuilder, PermissionsBitField } = require("discord.js"), const { SlashCommandBuilder, PermissionsBitField, InteractionContextType } = require("discord.js"),
{ QueryType } = require("discord-player"); { QueryType } = require("discord-player");
const BaseCommand = require("../../base/BaseCommand"), const BaseCommand = require("../../base/BaseCommand"),
fs = require("fs"); fs = require("fs");
@ -17,7 +17,7 @@ class Clips extends BaseCommand {
uk: client.translate("music/clips:DESCRIPTION", null, "uk-UA"), uk: client.translate("music/clips:DESCRIPTION", null, "uk-UA"),
ru: client.translate("music/clips:DESCRIPTION", null, "ru-RU"), ru: client.translate("music/clips:DESCRIPTION", null, "ru-RU"),
}) })
.setDMPermission(false) .setContexts([InteractionContextType.PrivateChannel, InteractionContextType.Guild])
.addStringOption(option => .addStringOption(option =>
option option
.setName("query") .setName("query")

View file

@ -1,4 +1,4 @@
const { SlashCommandBuilder } = require("discord.js"), const { SlashCommandBuilder, InteractionContextType } = require("discord.js"),
{ QueueRepeatMode } = require("discord-player"); { QueueRepeatMode } = require("discord-player");
const BaseCommand = require("../../base/BaseCommand"); const BaseCommand = require("../../base/BaseCommand");
@ -16,7 +16,7 @@ class Loop extends BaseCommand {
uk: client.translate("music/loop:DESCRIPTION", null, "uk-UA"), uk: client.translate("music/loop:DESCRIPTION", null, "uk-UA"),
ru: client.translate("music/loop:DESCRIPTION", null, "ru-RU"), ru: client.translate("music/loop:DESCRIPTION", null, "ru-RU"),
}) })
.setDMPermission(false) .setContexts([InteractionContextType.PrivateChannel, InteractionContextType.Guild])
.addStringOption(option => .addStringOption(option =>
option option
.setName("option") .setName("option")

View file

@ -1,4 +1,4 @@
const { SlashCommandBuilder, ActionRowBuilder, ButtonBuilder, ButtonStyle, StringSelectMenuBuilder, StringSelectMenuOptionBuilder } = require("discord.js"), const { SlashCommandBuilder, ActionRowBuilder, ButtonBuilder, ButtonStyle, StringSelectMenuBuilder, StringSelectMenuOptionBuilder, InteractionContextType } = require("discord.js"),
{ QueueRepeatMode } = require("discord-player"); { QueueRepeatMode } = require("discord-player");
const BaseCommand = require("../../base/BaseCommand"); const BaseCommand = require("../../base/BaseCommand");
@ -16,7 +16,7 @@ class Nowplaying extends BaseCommand {
uk: client.translate("music/nowplaying:DESCRIPTION", null, "uk-UA"), uk: client.translate("music/nowplaying:DESCRIPTION", null, "uk-UA"),
ru: client.translate("music/nowplaying:DESCRIPTION", null, "ru-RU"), ru: client.translate("music/nowplaying:DESCRIPTION", null, "ru-RU"),
}) })
.setDMPermission(false), .setContexts([InteractionContextType.PrivateChannel, InteractionContextType.Guild]),
dirname: __dirname, dirname: __dirname,
ownerOnly: false, ownerOnly: false,
}); });

View file

@ -1,4 +1,4 @@
const { ContextMenuCommandBuilder, ApplicationCommandType, PermissionsBitField } = require("discord.js"); const { ContextMenuCommandBuilder, ApplicationCommandType, PermissionsBitField, InteractionContextType } = require("discord.js");
const BaseCommand = require("../../base/BaseCommand"); const BaseCommand = require("../../base/BaseCommand");
class PlayContext extends BaseCommand { class PlayContext extends BaseCommand {
@ -11,7 +11,7 @@ class PlayContext extends BaseCommand {
command: new ContextMenuCommandBuilder() command: new ContextMenuCommandBuilder()
.setName("Add to Queue") .setName("Add to Queue")
.setType(ApplicationCommandType.Message) .setType(ApplicationCommandType.Message)
.setDMPermission(false), .setContexts([InteractionContextType.PrivateChannel, InteractionContextType.Guild]),
dirname: __dirname, dirname: __dirname,
ownerOnly: false, ownerOnly: false,
}); });

View file

@ -1,4 +1,4 @@
const { SlashCommandBuilder, PermissionsBitField } = require("discord.js"), const { SlashCommandBuilder, PermissionsBitField, InteractionContextType } = require("discord.js"),
{ QueryType } = require("discord-player"); { QueryType } = require("discord-player");
const BaseCommand = require("../../base/BaseCommand"); const BaseCommand = require("../../base/BaseCommand");
@ -16,7 +16,7 @@ class Play extends BaseCommand {
uk: client.translate("music/play:DESCRIPTION", null, "uk-UA"), uk: client.translate("music/play:DESCRIPTION", null, "uk-UA"),
ru: client.translate("music/play:DESCRIPTION", null, "ru-RU"), ru: client.translate("music/play:DESCRIPTION", null, "ru-RU"),
}) })
.setDMPermission(false) .setContexts([InteractionContextType.PrivateChannel, InteractionContextType.Guild])
.addStringOption(option => .addStringOption(option =>
option option
.setName("query") .setName("query")

View file

@ -1,4 +1,4 @@
const { SlashCommandBuilder, ActionRowBuilder, StringSelectMenuBuilder, StringSelectMenuOptionBuilder, ButtonBuilder, ButtonStyle } = require("discord.js"); const { SlashCommandBuilder, ActionRowBuilder, StringSelectMenuBuilder, StringSelectMenuOptionBuilder, ButtonBuilder, ButtonStyle, InteractionContextType } = require("discord.js");
const BaseCommand = require("../../base/BaseCommand"); const BaseCommand = require("../../base/BaseCommand");
class Queue extends BaseCommand { class Queue extends BaseCommand {
@ -15,7 +15,7 @@ class Queue extends BaseCommand {
uk: client.translate("music/queue:DESCRIPTION", null, "uk-UA"), uk: client.translate("music/queue:DESCRIPTION", null, "uk-UA"),
ru: client.translate("music/queue:DESCRIPTION", null, "ru-RU"), ru: client.translate("music/queue:DESCRIPTION", null, "ru-RU"),
}) })
.setDMPermission(false), .setContexts([InteractionContextType.PrivateChannel, InteractionContextType.Guild]),
dirname: __dirname, dirname: __dirname,
ownerOnly: false, ownerOnly: false,
}); });

View file

@ -1,4 +1,4 @@
const { SlashCommandBuilder } = require("discord.js"); const { SlashCommandBuilder, InteractionContextType } = require("discord.js");
const BaseCommand = require("../../base/BaseCommand"); const BaseCommand = require("../../base/BaseCommand");
class Seek extends BaseCommand { class Seek extends BaseCommand {
@ -15,6 +15,7 @@ class Seek extends BaseCommand {
uk: client.translate("music/seek:DESCRIPTION", null, "uk-UA"), uk: client.translate("music/seek:DESCRIPTION", null, "uk-UA"),
ru: client.translate("music/seek:DESCRIPTION", null, "ru-RU"), ru: client.translate("music/seek:DESCRIPTION", null, "ru-RU"),
}) })
.setContexts([InteractionContextType.PrivateChannel, InteractionContextType.Guild])
.addIntegerOption(option => .addIntegerOption(option =>
option option
.setName("time") .setName("time")

View file

@ -1,4 +1,4 @@
const { SlashCommandBuilder } = require("discord.js"); const { SlashCommandBuilder, InteractionContextType } = require("discord.js");
const BaseCommand = require("../../base/BaseCommand"); const BaseCommand = require("../../base/BaseCommand");
class Shuffle extends BaseCommand { class Shuffle extends BaseCommand {
@ -15,7 +15,7 @@ class Shuffle extends BaseCommand {
uk: client.translate("music/shuffle:DESCRIPTION", null, "uk-UA"), uk: client.translate("music/shuffle:DESCRIPTION", null, "uk-UA"),
ru: client.translate("music/shuffle:DESCRIPTION", null, "ru-RU"), ru: client.translate("music/shuffle:DESCRIPTION", null, "ru-RU"),
}) })
.setDMPermission(false), .setContexts([InteractionContextType.PrivateChannel, InteractionContextType.Guild]),
dirname: __dirname, dirname: __dirname,
ownerOnly: false, ownerOnly: false,
}); });

View file

@ -1,4 +1,4 @@
const { SlashCommandBuilder } = require("discord.js"); const { SlashCommandBuilder, InteractionContextType } = require("discord.js");
const BaseCommand = require("../../base/BaseCommand"); const BaseCommand = require("../../base/BaseCommand");
class Skip extends BaseCommand { class Skip extends BaseCommand {
@ -15,7 +15,7 @@ class Skip extends BaseCommand {
uk: client.translate("music/skip:DESCRIPTION", null, "uk-UA"), uk: client.translate("music/skip:DESCRIPTION", null, "uk-UA"),
ru: client.translate("music/skip:DESCRIPTION", null, "ru-RU"), ru: client.translate("music/skip:DESCRIPTION", null, "ru-RU"),
}) })
.setDMPermission(false) .setContexts([InteractionContextType.PrivateChannel, InteractionContextType.Guild])
.addIntegerOption(option => .addIntegerOption(option =>
option option
.setName("position") .setName("position")

View file

@ -1,4 +1,4 @@
const { SlashCommandBuilder } = require("discord.js"); const { SlashCommandBuilder, InteractionContextType } = require("discord.js");
const BaseCommand = require("../../base/BaseCommand"); const BaseCommand = require("../../base/BaseCommand");
class Stop extends BaseCommand { class Stop extends BaseCommand {
@ -15,7 +15,7 @@ class Stop extends BaseCommand {
uk: client.translate("music/stop:DESCRIPTION", null, "uk-UA"), uk: client.translate("music/stop:DESCRIPTION", null, "uk-UA"),
ru: client.translate("music/stop:DESCRIPTION", null, "ru-RU"), ru: client.translate("music/stop:DESCRIPTION", null, "ru-RU"),
}) })
.setDMPermission(false), .setContexts([InteractionContextType.PrivateChannel, InteractionContextType.Guild]),
dirname: __dirname, dirname: __dirname,
ownerOnly: false, ownerOnly: false,
}); });

View file

@ -1,4 +1,4 @@
const { SlashCommandBuilder } = require("discord.js"); const { SlashCommandBuilder, InteractionContextType } = require("discord.js");
const BaseCommand = require("../../base/BaseCommand"); const BaseCommand = require("../../base/BaseCommand");
class Volume extends BaseCommand { class Volume extends BaseCommand {
@ -15,7 +15,7 @@ class Volume extends BaseCommand {
uk: client.translate("music/volume:DESCRIPTION", null, "uk-UA"), uk: client.translate("music/volume:DESCRIPTION", null, "uk-UA"),
ru: client.translate("music/volume:DESCRIPTION", null, "ru-RU"), ru: client.translate("music/volume:DESCRIPTION", null, "ru-RU"),
}) })
.setDMPermission(false) .setContexts([InteractionContextType.PrivateChannel, InteractionContextType.Guild])
.addIntegerOption(option => .addIntegerOption(option =>
option option
.setName("int") .setName("int")

View file

@ -1,4 +1,4 @@
const { SlashCommandBuilder, ActionRowBuilder, StringSelectMenuBuilder, AttachmentBuilder } = require("discord.js"); const { SlashCommandBuilder, ActionRowBuilder, StringSelectMenuBuilder, AttachmentBuilder, InteractionContextType } = require("discord.js");
const BaseCommand = require("../../base/BaseCommand"), const BaseCommand = require("../../base/BaseCommand"),
fetch = require("node-fetch"); fetch = require("node-fetch");
@ -16,7 +16,7 @@ class NSFW extends BaseCommand {
uk: client.translate("nsfw/nsfw:DESCRIPTION", null, "uk-UA"), uk: client.translate("nsfw/nsfw:DESCRIPTION", null, "uk-UA"),
ru: client.translate("nsfw/nsfw:DESCRIPTION", null, "ru-RU"), ru: client.translate("nsfw/nsfw:DESCRIPTION", null, "ru-RU"),
}) })
.setDMPermission(true), .setContexts([InteractionContextType.BotDM, InteractionContextType.PrivateChannel, InteractionContextType.Guild]),
dirname: __dirname, dirname: __dirname,
ownerOnly: false, ownerOnly: false,
}); });

View file

@ -1,4 +1,4 @@
const { SlashCommandBuilder } = require("discord.js"); const { SlashCommandBuilder, InteractionContextType } = require("discord.js");
const BaseCommand = require("../../base/BaseCommand"); const BaseCommand = require("../../base/BaseCommand");
class Debug extends BaseCommand { class Debug extends BaseCommand {
@ -15,7 +15,7 @@ class Debug extends BaseCommand {
uk: client.translate("owner/debug:DESCRIPTION", null, "uk-UA"), uk: client.translate("owner/debug:DESCRIPTION", null, "uk-UA"),
ru: client.translate("owner/debug:DESCRIPTION", null, "ru-RU"), ru: client.translate("owner/debug:DESCRIPTION", null, "ru-RU"),
}) })
.setDMPermission(false) .setContexts([InteractionContextType.Guild])
.addSubcommand(subcommand => .addSubcommand(subcommand =>
subcommand subcommand
.setName("set") .setName("set")

View file

@ -1,4 +1,4 @@
const { SlashCommandBuilder } = require("discord.js"); const { SlashCommandBuilder, InteractionContextType } = require("discord.js");
const BaseCommand = require("../../base/BaseCommand"); const BaseCommand = require("../../base/BaseCommand");
class Eval extends BaseCommand { class Eval extends BaseCommand {
@ -15,7 +15,7 @@ class Eval extends BaseCommand {
uk: client.translate("owner/eval:DESCRIPTION", null, "uk-UA"), uk: client.translate("owner/eval:DESCRIPTION", null, "uk-UA"),
ru: client.translate("owner/eval:DESCRIPTION", null, "ru-RU"), ru: client.translate("owner/eval:DESCRIPTION", null, "ru-RU"),
}) })
.setDMPermission(true) .setContexts([InteractionContextType.BotDM, InteractionContextType.PrivateChannel, InteractionContextType.Guild])
.addStringOption(option => .addStringOption(option =>
option option
.setName("code") .setName("code")

View file

@ -1,4 +1,4 @@
const { SlashCommandBuilder } = require("discord.js"); const { SlashCommandBuilder, InteractionContextType } = require("discord.js");
const BaseCommand = require("../../base/BaseCommand"), const BaseCommand = require("../../base/BaseCommand"),
i18next = require("i18next"); i18next = require("i18next");
// autoUpdateDocs = require("../../helpers/autoUpdateDocs"); // autoUpdateDocs = require("../../helpers/autoUpdateDocs");
@ -17,7 +17,7 @@ class Reload extends BaseCommand {
uk: client.translate("owner/reload:DESCRIPTION", null, "uk-UA"), uk: client.translate("owner/reload:DESCRIPTION", null, "uk-UA"),
ru: client.translate("owner/reload:DESCRIPTION", null, "ru-RU"), ru: client.translate("owner/reload:DESCRIPTION", null, "ru-RU"),
}) })
.setDMPermission(true) .setContexts([InteractionContextType.BotDM, InteractionContextType.PrivateChannel, InteractionContextType.Guild])
.addStringOption(option => .addStringOption(option =>
option option
.setName("command") .setName("command")
@ -44,7 +44,8 @@ class Reload extends BaseCommand {
cmd = client.commands.get(command); cmd = client.commands.get(command);
if (!cmd) return interaction.error("owner/reload:NOT_FOUND", { command }, { ephemeral: true }); if (!cmd) return interaction.error("owner/reload:NOT_FOUND", { command }, { ephemeral: true });
await client.unloadCommand(`../commands/${cmd.category}`, cmd.command.name); client.unloadCommand(`../commands/${cmd.category}`, cmd.command.name);
await client.loadCommand(`../commands/${cmd.category}`, cmd.command.name); await client.loadCommand(`../commands/${cmd.category}`, cmd.command.name);
i18next.reloadResources(["ru-RU", "uk-UA", "en-US"]); i18next.reloadResources(["ru-RU", "uk-UA", "en-US"]);

View file

@ -1,4 +1,4 @@
const { SlashCommandBuilder } = require("discord.js"); const { SlashCommandBuilder, InteractionContextType } = require("discord.js");
const BaseCommand = require("../../base/BaseCommand"); const BaseCommand = require("../../base/BaseCommand");
class Say extends BaseCommand { class Say extends BaseCommand {
@ -15,7 +15,7 @@ class Say extends BaseCommand {
uk: client.translate("owner/say:DESCRIPTION", null, "uk-UA"), uk: client.translate("owner/say:DESCRIPTION", null, "uk-UA"),
ru: client.translate("owner/say:DESCRIPTION", null, "ru-RU"), ru: client.translate("owner/say:DESCRIPTION", null, "ru-RU"),
}) })
.setDMPermission(false) .setContexts([InteractionContextType.Guild])
.addStringOption(option => .addStringOption(option =>
option option
.setName("message") .setName("message")

View file

@ -1,4 +1,4 @@
const { SlashCommandBuilder, ActionRowBuilder, ButtonBuilder, ButtonStyle } = require("discord.js"); const { SlashCommandBuilder, ActionRowBuilder, ButtonBuilder, ButtonStyle, InteractionContextType } = require("discord.js");
const BaseCommand = require("../../base/BaseCommand"); const BaseCommand = require("../../base/BaseCommand");
class Servers extends BaseCommand { class Servers extends BaseCommand {
@ -15,7 +15,7 @@ class Servers extends BaseCommand {
uk: client.translate("owner/servers:DESCRIPTION", null, "uk-UA"), uk: client.translate("owner/servers:DESCRIPTION", null, "uk-UA"),
ru: client.translate("owner/servers:DESCRIPTION", null, "ru-RU"), ru: client.translate("owner/servers:DESCRIPTION", null, "ru-RU"),
}) })
.setDMPermission(true), .setContexts([InteractionContextType.BotDM, InteractionContextType.PrivateChannel, InteractionContextType.Guild]),
dirname: __dirname, dirname: __dirname,
ownerOnly: true, ownerOnly: true,
}); });

View file

@ -1,4 +1,4 @@
const { SlashCommandBuilder, PermissionsBitField } = require("discord.js"); const { SlashCommandBuilder, PermissionsBitField, InteractionContextType } = require("discord.js");
const BaseCommand = require("../../base/BaseCommand"); const BaseCommand = require("../../base/BaseCommand");
class AddUser extends BaseCommand { class AddUser extends BaseCommand {
@ -15,7 +15,7 @@ class AddUser extends BaseCommand {
uk: client.translate("tickets/adduser:DESCRIPTION", null, "uk-UA"), uk: client.translate("tickets/adduser:DESCRIPTION", null, "uk-UA"),
ru: client.translate("tickets/adduser:DESCRIPTION", null, "ru-RU"), ru: client.translate("tickets/adduser:DESCRIPTION", null, "ru-RU"),
}) })
.setDMPermission(false) .setContexts([InteractionContextType.Guild])
.setDefaultMemberPermissions(PermissionsBitField.Flags.ManageMessages) .setDefaultMemberPermissions(PermissionsBitField.Flags.ManageMessages)
.addUserOption(option => .addUserOption(option =>
option option

View file

@ -1,4 +1,4 @@
const { SlashCommandBuilder, PermissionsBitField, ButtonBuilder, ButtonStyle, ActionRowBuilder } = require("discord.js"); const { SlashCommandBuilder, PermissionsBitField, ButtonBuilder, ButtonStyle, ActionRowBuilder, InteractionContextType } = require("discord.js");
const BaseCommand = require("../../base/BaseCommand"); const BaseCommand = require("../../base/BaseCommand");
class CloseTicket extends BaseCommand { class CloseTicket extends BaseCommand {
@ -15,7 +15,7 @@ class CloseTicket extends BaseCommand {
uk: client.translate("tickets/closeticket:DESCRIPTION", null, "uk-UA"), uk: client.translate("tickets/closeticket:DESCRIPTION", null, "uk-UA"),
ru: client.translate("tickets/closeticket:DESCRIPTION", null, "ru-RU"), ru: client.translate("tickets/closeticket:DESCRIPTION", null, "ru-RU"),
}) })
.setDMPermission(false) .setContexts([InteractionContextType.Guild])
.setDefaultMemberPermissions(PermissionsBitField.Flags.ManageMessages), .setDefaultMemberPermissions(PermissionsBitField.Flags.ManageMessages),
dirname: __dirname, dirname: __dirname,
ownerOnly: false, ownerOnly: false,

View file

@ -1,4 +1,4 @@
const { SlashCommandBuilder, PermissionsBitField, ButtonBuilder, ButtonStyle, ActionRowBuilder } = require("discord.js"); const { SlashCommandBuilder, PermissionsBitField, ButtonBuilder, ButtonStyle, ActionRowBuilder, InteractionContextType } = require("discord.js");
const BaseCommand = require("../../base/BaseCommand"); const BaseCommand = require("../../base/BaseCommand");
class CreateTicketEmbed extends BaseCommand { class CreateTicketEmbed extends BaseCommand {
@ -15,7 +15,7 @@ class CreateTicketEmbed extends BaseCommand {
uk: client.translate("tickets/createticketembed:DESCRIPTION", null, "uk-UA"), uk: client.translate("tickets/createticketembed:DESCRIPTION", null, "uk-UA"),
ru: client.translate("tickets/createticketembed:DESCRIPTION", null, "ru-RU"), ru: client.translate("tickets/createticketembed:DESCRIPTION", null, "ru-RU"),
}) })
.setDMPermission(false) .setContexts([InteractionContextType.Guild])
.setDefaultMemberPermissions(PermissionsBitField.Flags.ManageGuild), .setDefaultMemberPermissions(PermissionsBitField.Flags.ManageGuild),
dirname: __dirname, dirname: __dirname,
ownerOnly: false, ownerOnly: false,

View file

@ -1,4 +1,4 @@
const { SlashCommandBuilder, PermissionsBitField } = require("discord.js"); const { SlashCommandBuilder, PermissionsBitField, InteractionContextType } = require("discord.js");
const BaseCommand = require("../../base/BaseCommand"); const BaseCommand = require("../../base/BaseCommand");
class RemoveUser extends BaseCommand { class RemoveUser extends BaseCommand {
@ -15,7 +15,7 @@ class RemoveUser extends BaseCommand {
uk: client.translate("tickets/removeuser:DESCRIPTION", null, "uk-UA"), uk: client.translate("tickets/removeuser:DESCRIPTION", null, "uk-UA"),
ru: client.translate("tickets/removeuser:DESCRIPTION", null, "ru-RU"), ru: client.translate("tickets/removeuser:DESCRIPTION", null, "ru-RU"),
}) })
.setDMPermission(false) .setContexts([InteractionContextType.Guild])
.setDefaultMemberPermissions(PermissionsBitField.Flags.ManageMessages) .setDefaultMemberPermissions(PermissionsBitField.Flags.ManageMessages)
.addUserOption(option => .addUserOption(option =>
option option

View file

@ -1,4 +1,4 @@
const { InteractionType } = require("discord.js"); const { SlashCommandBuilder, InteractionType } = require("discord.js");
const BaseEvent = require("../base/BaseEvent"); const BaseEvent = require("../base/BaseEvent");
class CommandHandler extends BaseEvent { class CommandHandler extends BaseEvent {
@ -34,7 +34,6 @@ class CommandHandler extends BaseEvent {
if (interaction.type !== InteractionType.ApplicationCommand && !interaction.isCommand()) return; if (interaction.type !== InteractionType.ApplicationCommand && !interaction.isCommand()) return;
if (command?.dirname.includes("IAT") && interaction.guildId !== "1039187019957555252") return interaction.reply({ content: "IAT only", ephemeral: true }); if (command?.dirname.includes("IAT") && interaction.guildId !== "1039187019957555252") return interaction.reply({ content: "IAT only", ephemeral: true });
if (command?.dirname.includes("beatrun") && interaction.guildId !== "1113394230002454560") return interaction.reply({ content: "Beatrun.ru only", ephemeral: true });
if (command.ownerOnly && interaction.user.id !== client.config.owner.id) return interaction.error("misc:OWNER_ONLY", null, { ephemeral: true }); if (command.ownerOnly && interaction.user.id !== client.config.owner.id) return interaction.error("misc:OWNER_ONLY", null, { ephemeral: true });
if (!interaction.data.user.achievements.firstCommand.achieved) { if (!interaction.data.user.achievements.firstCommand.achieved) {
@ -59,7 +58,7 @@ class CommandHandler extends BaseEvent {
} }
client.logger.cmd( client.logger.cmd(
`[${interaction.guild ? interaction.guild.name : "DM"}]: [${interaction.user.getUsername()}] => /${command.command.name}${ `[${interaction.guild ? interaction.guild.name : "DM/Private Channel"}]: [${interaction.user.getUsername()}] => /${command.command.name}${
interaction.options.data.length > 0 interaction.options.data.length > 0
? `, args: [${interaction.options.data ? `, args: [${interaction.options.data
.map(arg => { .map(arg => {

View file

@ -36,10 +36,11 @@ class Ready extends BaseEvent {
const version = require("../package.json").version; const version = require("../package.json").version;
const status = [ const status = [
"Use /help to get commands list",
`${commands.length} ${client.functions.getNoun(commands.length, client.translate("misc:NOUNS:COMMANDS:1"), client.translate("misc:NOUNS:COMMANDS:2"), client.translate("misc:NOUNS:COMMANDS:5"))} available!`, `${commands.length} ${client.functions.getNoun(commands.length, client.translate("misc:NOUNS:COMMANDS:1"), client.translate("misc:NOUNS:COMMANDS:2"), client.translate("misc:NOUNS:COMMANDS:5"))} available!`,
`Bot is in ${servers} ${client.functions.getNoun(servers, client.translate("misc:NOUNS:SERVER:1"), client.translate("misc:NOUNS:SERVER:2"), client.translate("misc:NOUNS:SERVER:5"))}`, `I'm in ${servers} ${client.functions.getNoun(servers, client.translate("misc:NOUNS:SERVER:1"), client.translate("misc:NOUNS:SERVER:2"), client.translate("misc:NOUNS:SERVER:5"))}!`,
`Cached ${users} ${client.functions.getNoun(users, client.translate("misc:NOUNS:USERS:1"), client.translate("misc:NOUNS:USERS:2"), client.translate("misc:NOUNS:USERS:5"))}`, `Cached ${users} ${client.functions.getNoun(users, client.translate("misc:NOUNS:USERS:1"), client.translate("misc:NOUNS:USERS:2"), client.translate("misc:NOUNS:USERS:5"))}.`,
"Use /help for commands list!",
"Did you know that I have a brother called JaBa IT? Yeah! Ask Jonny about him.",
]; ];
let i = 0; let i = 0;

View file

@ -1,6 +1,6 @@
{ {
"name": "jaba", "name": "jaba",
"version": "4.6.4", "version": "4.6.5",
"description": "My Discord Bot", "description": "My Discord Bot",
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {
@ -10,16 +10,16 @@
"dependencies": { "dependencies": {
"@discord-player/extractor": "^4.5.1", "@discord-player/extractor": "^4.5.1",
"@discordjs/opus": "^0.9.0", "@discordjs/opus": "^0.9.0",
"@discordjs/rest": "^2.3.0", "@discordjs/rest": "^2.4.0",
"@discordjs/voice": "^0.17.0", "@discordjs/voice": "^0.17.0",
"@napi-rs/canvas": "^0.1.53", "@napi-rs/canvas": "^0.1.55",
"chalk": "^4.1.2", "chalk": "^4.1.2",
"cron": "^2.4.4", "cron": "^2.4.4",
"discord-api-types": "^0.37.93", "discord-api-types": "^0.37.100",
"discord-giveaways": "^6.0.1", "discord-giveaways": "^6.0.1",
"discord-player": "^6.7.1", "discord-player": "^6.7.1",
"discord-player-youtubei": "^1.2.6", "discord-player-youtubei": "1.3.1",
"discord.js": "^14.15.3", "discord.js": "^14.16.2",
"gamedig": "^4.1.0", "gamedig": "^4.1.0",
"i18next": "^21.10.0", "i18next": "^21.10.0",
"i18next-fs-backend": "^1.2.0", "i18next-fs-backend": "^1.2.0",
@ -30,7 +30,7 @@
"node-fetch": "^2.7.0" "node-fetch": "^2.7.0"
}, },
"devDependencies": { "devDependencies": {
"eslint": "^8.56.0" "eslint": "^9.10.0"
}, },
"eslintConfig": { "eslintConfig": {
"extends": "eslint:recommended", "extends": "eslint:recommended",

File diff suppressed because it is too large Load diff