This commit is contained in:
Jonny_Bro (Nikita) 2023-03-26 18:31:19 +05:00
parent 05666488ee
commit 792a73353d
185 changed files with 815 additions and 406 deletions

View file

@ -11,13 +11,22 @@ class Automod extends BaseCommand {
command: new SlashCommandBuilder()
.setName("automod")
.setDescription(client.translate("administration/automod:DESCRIPTION"))
.setDescriptionLocalizations({
"uk": client.translate("administration/automod:DESCRIPTION", null, "uk-UA"),
})
.setDMPermission(false)
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator)
.addBooleanOption(option => option.setName("state")
.setDescription(client.translate("common:STATE"))
.setDescriptionLocalizations({
"uk": client.translate("common:STATE", null, "uk-UA"),
})
.setRequired(true))
.addChannelOption(option => option.setName("channel")
.setDescription(client.translate("common:CHANNEL"))
.setDescriptionLocalizations({
"uk": client.translate("common:CHANNEL", null, "uk-UA"),
})
.addChannelTypes(ChannelType.GuildText)),
aliases: [],
dirname: __dirname,

View file

@ -11,13 +11,16 @@ class Autorole extends BaseCommand {
command: new SlashCommandBuilder()
.setName("autorole")
.setDescription(client.translate("administration/autorole:DESCRIPTION"))
.setDescriptionLocalizations({ "uk": client.translate("administration/autorole:DESCRIPTION", null, "uk-UA") })
.setDMPermission(false)
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator)
.addBooleanOption(option => option.setName("state")
.setDescription(client.translate("common:STATE"))
.setDescriptionLocalizations({ "uk": client.translate("common:STATE", null, "uk-UA") })
.setRequired(true))
.addRoleOption(option => option.setName("role")
.setDescription(client.translate("common:ROLE"))),
.setDescription(client.translate("common:ROLE"))
.setDescriptionLocalizations({ "uk": client.translate("common:ROLE", null, "uk-UA") })),
aliases: [],
dirname: __dirname,
ownerOnly: false,

View file

@ -11,16 +11,20 @@ class Config extends BaseCommand {
command: new SlashCommandBuilder()
.setName("config")
.setDescription(client.translate("administration/config:DESCRIPTION"))
.setDescriptionLocalizations({ "uk": client.translate("administration/config:DESCRIPTION", null, "uk-UA") })
.setDMPermission(false)
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator)
.addSubcommand(subcommand => subcommand.setName("list")
.setDescription(client.translate("administration/config:LIST")),
.setDescription(client.translate("administration/config:LIST"))
.setDescriptionLocalizations({ "uk": client.translate("administration/config:LIST", null, "uk-UA") }),
)
.addSubcommand(subcommand => subcommand.setName("set")
.setDescription(client.translate("administration/config:SET"))
.setDescriptionLocalizations({ "uk": client.translate("administration/config:SET", null, "uk-UA") })
.addStringOption(option => option.setName("setting")
.setDescription(client.translate("administration/config:SETTING"))
.addChoices(
.setDescriptionLocalizations({ "uk": client.translate("administration/config:SETTING", null, "uk-UA") })
.setChoices(
{ name: client.translate("administration/config:BIRTHDAYS"), value: "birthdays" },
{ name: client.translate("administration/config:MODLOGS"), value: "modlogs" },
{ name: client.translate("administration/config:NEWS"), value: "news" },
@ -30,9 +34,11 @@ class Config extends BaseCommand {
.setRequired(true))
.addBooleanOption(option => option.setName("state")
.setDescription(client.translate("common:STATE"))
.setDescriptionLocalizations({ "uk": client.translate("common:STATE", null, "uk-UA") })
.setRequired(true))
.addChannelOption(option => option.setName("channel")
.setDescription(client.translate("common:CHANNEL"))),
.setDescription(client.translate("common:CHANNEL"))
.setDescriptionLocalizations({ "uk": client.translate("common:STATE", null, "uk-UA") })),
),
aliases: [],
dirname: __dirname,

View file

@ -11,22 +11,29 @@ class Goodbye extends BaseCommand {
command: new SlashCommandBuilder()
.setName("goodbye")
.setDescription(client.translate("administration/goodbye:DESCRIPTION"))
.setDescriptionLocalizations({ "uk": client.translate("administration/goodbye:DESCRIPTION", null, "uk-UA") })
.setDMPermission(false)
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator)
.addSubcommand(subcommand => subcommand.setName("test")
.setDescription(client.translate("administration/goodbye:TEST")),
.setDescription(client.translate("administration/goodbye:TEST"))
.setDescriptionLocalizations({ "uk": client.translate("administration/goodbye:TEST", null, "uk-UA") }),
)
.addSubcommand(subcommand => subcommand.setName("config")
.setDescription(client.translate("administration/goodbye:CONFIG"))
.setDescriptionLocalizations({ "uk": client.translate("administration/goodbye:CONFIG", null, "uk-UA") })
.addBooleanOption(option => option.setName("state")
.setDescription(client.translate("common:STATE"))
.setDescriptionLocalizations({ "uk": client.translate("common:STATE", null, "uk-UA") })
.setRequired(true))
.addChannelOption(option => option.setName("channel")
.setDescription(client.translate("common:CHANNEL")))
.setDescription(client.translate("common:CHANNEL"))
.setDescriptionLocalizations({ "uk": client.translate("common:CHANNEL", null, "uk-UA") }))
.addStringOption(option => option.setName("message")
.setDescription(client.translate("administration/goodbye:MESSAGE")))
.setDescription(client.translate("administration/goodbye:MESSAGE"))
.setDescriptionLocalizations({ "uk": client.translate("common:MESSAGE", null, "uk-UA") }))
.addBooleanOption(option => option.setName("image")
.setDescription(client.translate("administration/goodbye:IMAGE"))),
.setDescription(client.translate("administration/goodbye:IMAGE"))
.setDescriptionLocalizations({ "uk": client.translate("common:IMAGE", null, "uk-UA") })),
),
aliases: [],
dirname: __dirname,

View file

@ -11,24 +11,30 @@ class Selectroles extends BaseCommand {
command: new SlashCommandBuilder()
.setName("selectroles")
.setDescription(client.translate("administration/selectroles:DESCRIPTION"))
.setDescriptionLocalizations({ "uk": client.translate("administration/selectroles:DESCRIPTION", null, "uk-UA") })
.setDMPermission(false)
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator)
.addSubcommand(subcommand => subcommand.setName("message")
.setDescription(client.translate("administration/selectroles:MESSAGE"))
.setDescriptionLocalizations({ "uk": client.translate("administration/selectroles:MESSAGE", null, "uk-UA") })
.addStringOption(option => option.setName("text")
.setDescription(client.translate("common:MESSAGE"))
.setRequired(true)),
)
.addSubcommand(subcommand => subcommand.setName("addrole")
.setDescription(client.translate("administration/selectroles:ADDROLE"))
.setDescriptionLocalizations({ "uk": client.translate("administration/selectroles:ADDROLE", null, "uk-UA") })
.addChannelOption(option => option.setName("channel")
.setDescription(client.translate("common:CHANNEL"))
.setDescriptionLocalizations({ "uk": client.translate("common:CHANNEL", null, "uk-UA") })
.setRequired(true))
.addStringOption(option => option.setName("message_id")
.setDescription(client.translate("common:MESSAGE_ID"))
.setDescriptionLocalizations({ "uk": client.translate("common:MESSAGE_ID", null, "uk-UA") })
.setRequired(true))
.addRoleOption(option => option.setName("role")
.setDescription(client.translate("common:ROLE"))
.setDescriptionLocalizations({ "uk": client.translate("common:ROLE", null, "uk-UA") })
.setRequired(true)),
),
aliases: [],

View file

@ -11,12 +11,14 @@ class Set extends BaseCommand {
command: new SlashCommandBuilder()
.setName("set")
.setDescription(client.translate("administration/set:DESCRIPTION"))
.setDescriptionLocalizations({ "uk": client.translate("administration/set:DESCRIPTION", null, "uk-UA") })
.setDMPermission(false)
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator)
.addStringOption(option => option.setName("type")
.setDescription(client.translate("owner/debug:TYPE"))
.setDescriptionLocalizations({ "uk": client.translate("owner/debug:TYPE", null, "uk-UA") })
.setRequired(true)
.addChoices(
.setChoices(
{ name: client.translate("common:LEVEL"), value: "level" },
{ name: client.translate("common:XP"), value: "xp" },
{ name: client.translate("common:CREDITS"), value: "credits" },
@ -24,9 +26,11 @@ class Set extends BaseCommand {
))
.addUserOption(option => option.setName("user")
.setDescription(client.translate("common:USER"))
.setDescriptionLocalizations({ "uk": client.translate("common:USER", null, "uk-UA") })
.setRequired(true))
.addIntegerOption(option => option.setName("int")
.setDescription(client.translate("common:INT"))
.setDescriptionLocalizations({ "uk": client.translate("common:INT", null, "uk-UA") })
.setRequired(true)),
aliases: [],
dirname: __dirname,
@ -64,7 +68,7 @@ class Set extends BaseCommand {
memberData.level = int;
await memberData.save();
return interaction.success(`owner/debug:SUCCESS_${type.toUpperCase()}`, {
username: member.toString(),
user: member.toString(),
amount: int,
}, { ephemeral: true });
}
@ -73,7 +77,7 @@ class Set extends BaseCommand {
memberData.exp = int;
await memberData.save();
return interaction.success(`owner/debug:SUCCESS_${type.toUpperCase()}`, {
username: member.toString(),
user: member.toString(),
amount: int,
}, { ephemeral: true });
}
@ -82,7 +86,7 @@ class Set extends BaseCommand {
memberData.money = int;
await memberData.save();
return interaction.success(`owner/debug:SUCCESS_${type.toUpperCase()}`, {
username: member.toString(),
user: member.toString(),
amount: int,
}, { ephemeral: true });
}
@ -91,7 +95,7 @@ class Set extends BaseCommand {
memberData.bankSold = int;
await memberData.save();
return interaction.success(`owner/debug:SUCCESS_${type.toUpperCase()}`, {
username: member.toString(),
user: member.toString(),
amount: int,
}, { ephemeral: true });
}

View file

@ -11,12 +11,14 @@ class Setlang extends BaseCommand {
command: new SlashCommandBuilder()
.setName("setlang")
.setDescription(client.translate("administration/setlang:DESCRIPTION"))
.setDescriptionLocalizations({ "uk": client.translate("administration/setlang:DESCRIPTION", null, "uk-UA") })
.setDMPermission(false)
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator)
.addStringOption(option => option.setName("language")
.setDescription(client.translate("common:LANGUAGE"))
.setDescriptionLocalizations({ "uk": client.translate("common:LANGUAGE", null, "uk-UA") })
.setRequired(true)
.addChoices(
.setChoices(
{ name: "Русский", value: "ru-RU" },
{ name: "Українська", value: "uk-UA" },
)),

View file

@ -11,10 +11,12 @@ class Stealemoji extends BaseCommand {
command: new SlashCommandBuilder()
.setName("stealemoji")
.setDescription(client.translate("administration/stealemoji:DESCRIPTION"))
.setDescriptionLocalizations({ "uk": client.translate("administration/stealemoji:DESCRIPTION", null, "uk-UA") })
.setDMPermission(false)
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator)
.addStringOption(option => option.setName("emoji")
.setDescription(client.translate("common:EMOJI"))
.setDescriptionLocalizations({ "uk": client.translate("common:EMOJI", null, "uk-UA") })
.setRequired(true)),
aliases: [],
dirname: __dirname,

View file

@ -11,22 +11,29 @@ class Welcome extends BaseCommand {
command: new SlashCommandBuilder()
.setName("welcome")
.setDescription(client.translate("administration/welcome:DESCRIPTION"))
.setDescriptionLocalizations({ "uk": client.translate("administration/welcome:DESCRIPTION", null, "uk-UA") })
.setDMPermission(false)
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator)
.addSubcommand(subcommand => subcommand.setName("test")
.setDescription(client.translate("administration/goodbye:TEST")),
.setDescription(client.translate("administration/goodbye:TEST"))
.setDescriptionLocalizations({ "uk": client.translate("administration/goodbye:TEST", null, "uk-UA") }),
)
.addSubcommand(subcommand => subcommand.setName("config")
.setDescription(client.translate("administration/goodbye:CONFIG"))
.setDescriptionLocalizations({ "uk": client.translate("administration/goodbye:CONFIG", null, "uk-UA") })
.addBooleanOption(option => option.setName("state")
.setDescription(client.translate("common:STATE"))
.setDescriptionLocalizations({ "uk": client.translate("common:STATE", null, "uk-UA") })
.setRequired(true))
.addChannelOption(option => option.setName("channel")
.setDescription(client.translate("common:CHANNEL")))
.setDescription(client.translate("common:CHANNEL"))
.setDescriptionLocalizations({ "uk": client.translate("common:CHANNEL", null, "uk-UA") }))
.addStringOption(option => option.setName("message")
.setDescription(client.translate("administration/goodbye:MESSAGE")))
.setDescription(client.translate("administration/goodbye:MESSAGE"))
.setDescriptionLocalizations({ "uk": client.translate("administration/goodbye:MESSAGE", null, "uk-UA") }))
.addBooleanOption(option => option.setName("image")
.setDescription(client.translate("administration/goodbye:IMAGE"))),
.setDescription(client.translate("administration/goodbye:IMAGE"))
.setDescriptionLocalizations({ "uk": client.translate("administration/goodbye:IMAGE", null, "uk-UA") })),
),
aliases: [],
dirname: __dirname,

View file

@ -11,9 +11,11 @@ class Achievements extends BaseCommand {
command: new SlashCommandBuilder()
.setName("achievements")
.setDescription(client.translate("economy/achievements:DESCRIPTION"))
.setDescriptionLocalizations({ "uk": client.translate("economy/achievements:DESCRIPTION", null, "uk-UA") })
.setDMPermission(false)
.addUserOption(option => option.setName("user")
.setDescription(client.translate("common:USER"))),
.setDescription(client.translate("common:USER"))
.setDescriptionLocalizations({ "uk": client.translate("common:USER", null, "uk-UA") })),
aliases: [],
dirname: __dirname,
ownerOnly: false,

View file

@ -11,16 +11,19 @@ class Bank extends BaseCommand {
command: new SlashCommandBuilder()
.setName("bank")
.setDescription(client.translate("economy/bank:DESCRIPTION"))
.setDescriptionLocalizations({ "uk": client.translate("economy/bank:DESCRIPTION", null, "uk-UA") })
.setDMPermission(false)
.addStringOption(option => option.setName("option")
.setDescription(client.translate("economy/bank:OPTION"))
.setDescriptionLocalizations({ "uk": client.translate("economy/bank:OPTION", null, "uk-UA") })
.setRequired(true)
.addChoices(
.setChoices(
{ name: client.translate("economy/bank:DEPOSIT"), value: "deposit" },
{ name: client.translate("economy/bank:WITHDRAW"), value: "withdraw" },
))
.addStringOption(option => option.setName("credits")
.setDescription(client.translate("moderation/clear:OPTION"))
.setDescription(client.translate("misc:OPTION_NAN_ALL"))
.setDescriptionLocalizations({ "uk": client.translate("misc:OPTION_NAN_ALL", null, "uk-UA") })
.setRequired(true)),
aliases: [],
dirname: __dirname,

View file

@ -11,14 +11,17 @@ class Birthdate extends BaseCommand {
command: new SlashCommandBuilder()
.setName("birthdate")
.setDescription(client.translate("economy/birthdate:DESCRIPTION"))
.setDescriptionLocalizations({ "uk": client.translate("economy/birthdate:DESCRIPTION", null, "uk-UA") })
.setDMPermission(false)
.addIntegerOption(option => option.setName("day")
.setDescription(client.translate("economy/birthdate:DAY"))
.setDescriptionLocalizations({ "uk": client.translate("economy/birthdate:DAY", null, "uk-UA") })
.setRequired(true))
.addIntegerOption(option => option.setName("month")
.setDescription(client.translate("economy/birthdate:MONTH"))
.setDescriptionLocalizations({ "uk": client.translate("economy/birthdate:MONTH", null, "uk-UA") })
.setRequired(true)
.addChoices(
.setChoices(
{ name: "Январь", value: 1 },
{ name: "Февраль", value: 2 },
{ name: "Март", value: 3 },
@ -34,7 +37,9 @@ class Birthdate extends BaseCommand {
))
.addIntegerOption(option => option.setName("year")
.setDescription(client.translate("economy/birthdate:YEAR"))
.setRequired(true)),
.setDescriptionLocalizations({ "uk": client.translate("economy/birthdate:YEAR", null, "uk-UA") })
.setRequired(true)
.setAutocomplete(true)),
aliases: [],
dirname: __dirname,
ownerOnly: false,
@ -70,6 +75,24 @@ class Birthdate extends BaseCommand {
date: client.printDate(d),
});
}
/**
*
* @param {import("../../base/JaBa")} client
* @param {import("discord.js").AutocompleteInteraction} interaction
* @returns
*/
async autocompleteRun(client, interaction) {
const int = interaction.options.getInteger("year"),
results = Array.from({ length: 2023 }, (_, k) => k + 1).filter(i => i.toString().includes(int));
return interaction.respond(
results.slice(0, 25).map(i => ({
name: i,
value: i,
}),
));
}
}
module.exports = Birthdate;

View file

@ -11,6 +11,7 @@ class Divorce extends BaseCommand {
command: new SlashCommandBuilder()
.setName("divorce")
.setDescription(client.translate("economy/divorce:DESCRIPTION"))
.setDescriptionLocalizations({ "uk": client.translate("economy/divorce:DESCRIPTION", null, "uk-UA") })
.setDMPermission(false),
aliases: [],
dirname: __dirname,

View file

@ -12,6 +12,7 @@ class ImportMee6 extends BaseCommand {
command: new SlashCommandBuilder()
.setName("importmee6")
.setDescription(client.translate("economy/importmee6:DESCRIPTION"))
.setDescriptionLocalizations({ "uk": client.translate("economy/importmee6:DESCRIPTION", null, "uk-UA") })
.setDMPermission(false),
aliases: [],
dirname: __dirname,
@ -41,7 +42,7 @@ class ImportMee6 extends BaseCommand {
interaction.editReply({
content: interaction.translate("owner/debug:SUCCESS_LEVEL", {
username: interaction.member.toString(),
user: interaction.member.toString(),
amount: level,
}),
});

View file

@ -11,11 +11,13 @@ class Leaderboard extends BaseCommand {
command: new SlashCommandBuilder()
.setName("leaderboard")
.setDescription(client.translate("economy/leaderboard:DESCRIPTION"))
.setDescriptionLocalizations({ "uk": client.translate("economy/leaderboard:DESCRIPTION", null, "uk-UA") })
.setDMPermission(false)
.addStringOption(option => option.setName("type")
.setDescription(client.translate("owner/debug:TYPE"))
.setDescriptionLocalizations({ "uk": client.translate("owner/debug:TYPE", null, "uk-UA") })
.setRequired(true)
.addChoices(
.setChoices(
{ name: client.translate("economy/leaderboard:LEVEL"), value: "level" },
{ name: client.translate("economy/leaderboard:MONEY"), value: "money" },
{ name: client.translate("economy/leaderboard:REP"), value: "rep" },

View file

@ -12,9 +12,11 @@ class Marry extends BaseCommand {
command: new SlashCommandBuilder()
.setName("marry")
.setDescription(client.translate("economy/marry:DESCRIPTION"))
.setDescriptionLocalizations({ "uk": client.translate("economy/marry:DESCRIPTION", null, "uk-UA") })
.setDMPermission(false)
.addUserOption(option => option.setName("user")
.setDescription(client.translate("common:USER"))
.setDescriptionLocalizations({ "uk": client.translate("common:USER", null, "uk-UA") })
.setRequired(true)),
aliases: [],
dirname: __dirname,

View file

@ -11,9 +11,11 @@ class Money extends BaseCommand {
command: new SlashCommandBuilder()
.setName("money")
.setDescription(client.translate("economy/money:DESCRIPTION"))
.setDescriptionLocalizations({ "uk": client.translate("economy/money:DESCRIPTION", null, "uk-UA") })
.setDMPermission(false)
.addUserOption(option => option.setName("user")
.setDescription(client.translate("common:USER"))),
.setDescription(client.translate("common:USER"))
.setDescriptionLocalizations({ "uk": client.translate("common:USER", null, "uk-UA") })),
aliases: [],
dirname: __dirname,
ownerOnly: false,
@ -56,7 +58,7 @@ class Money extends BaseCommand {
const embed = new EmbedBuilder()
.setAuthor({
name: interaction.translate("economy/money:TITLE", {
username: member.user.tag,
user: member.user.tag,
}),
iconURL: member.user.displayAvatarURL(),
})

View file

@ -12,6 +12,7 @@ class Number extends BaseCommand {
command: new SlashCommandBuilder()
.setName("number")
.setDescription(client.translate("economy/number:DESCRIPTION"))
.setDescriptionLocalizations({ "uk": client.translate("economy/number:DESCRIPTION", null, "uk-UA") })
.setDMPermission(false),
aliases: [],
dirname: __dirname,

View file

@ -11,12 +11,15 @@ class Pay extends BaseCommand {
command: new SlashCommandBuilder()
.setName("pay")
.setDescription(client.translate("economy/pay:DESCRIPTION"))
.setDescriptionLocalizations({ "uk": client.translate("economy/pay:DESCRIPTION", null, "uk-UA") })
.setDMPermission(false)
.addUserOption(option => option.setName("user")
.setDescription(client.translate("common:USER"))
.setDescriptionLocalizations({ "uk": client.translate("common:USER", null, "uk-UA") })
.setRequired(true))
.addIntegerOption(option => option.setName("amount")
.setDescription(client.translate("common:INT"))
.setDescriptionLocalizations({ "uk": client.translate("common:INT", null, "uk-UA") })
.setRequired(true)),
aliases: [],
dirname: __dirname,

View file

@ -11,9 +11,11 @@ class Profile extends BaseCommand {
command: new SlashCommandBuilder()
.setName("profile")
.setDescription(client.translate("economy/profile:DESCRIPTION"))
.setDescriptionLocalizations({ "uk": client.translate("economy/profile:DESCRIPTION", null, "uk-UA") })
.setDMPermission(false)
.addUserOption(option => option.setName("user")
.setDescription(client.translate("common:USER"))),
.setDescription(client.translate("common:USER"))
.setDescriptionLocalizations({ "uk": client.translate("common:USER", null, "uk-UA") })),
aliases: [],
dirname: __dirname,
ownerOnly: false,

View file

@ -11,9 +11,11 @@ class Rep extends BaseCommand {
command: new SlashCommandBuilder()
.setName("rep")
.setDescription(client.translate("economy/rep:DESCRIPTION"))
.setDescriptionLocalizations({ "uk": client.translate("economy/rep:DESCRIPTION", null, "uk-UA") })
.setDMPermission(false)
.addUserOption(option => option.setName("user")
.setDescription(client.translate("common:USER"))
.setDescriptionLocalizations({ "uk": client.translate("common:USER", null, "uk-UA") })
.setRequired(true)),
aliases: [],
dirname: __dirname,

View file

@ -11,12 +11,15 @@ class Rob extends BaseCommand {
command: new SlashCommandBuilder()
.setName("rob")
.setDescription(client.translate("economy/rob:DESCRIPTION"))
.setDescriptionLocalizations({ "uk": client.translate("economy/rob:DESCRIPTION", null, "uk-UA") })
.setDMPermission(false)
.addUserOption(option => option.setName("user")
.setDescription(client.translate("common:USER"))
.setDescriptionLocalizations({ "uk": client.translate("common:USER", null, "uk-UA") })
.setRequired(true))
.addIntegerOption(option => option.setName("amount")
.setDescription(client.translate("common:INT"))
.setDescriptionLocalizations({ "uk": client.translate("common:INT", null, "uk-UA") })
.setRequired(true)),
aliases: [],
dirname: __dirname,

View file

@ -11,9 +11,11 @@ class Setbio extends BaseCommand {
command: new SlashCommandBuilder()
.setName("setbio")
.setDescription(client.translate("economy/setbio:DESCRIPTION"))
.setDescriptionLocalizations({ "uk": client.translate("economy/setbio:DESCRIPTION", null, "uk-UA") })
.setDMPermission(true)
.addStringOption(option => option.setName("text")
.setDescription(client.translate("economy/profile:BIO"))
.setDescriptionLocalizations({ "uk": client.translate("economy/profile:BIO", null, "uk-UA") })
.setRequired(true)),
aliases: [],
dirname: __dirname,

View file

@ -11,9 +11,11 @@ class Slots extends BaseCommand {
command: new SlashCommandBuilder()
.setName("slots")
.setDescription(client.translate("economy/slots:DESCRIPTION"))
.setDescriptionLocalizations({ "uk": client.translate("economy/slots:DESCRIPTION", null, "uk-UA") })
.setDMPermission(false)
.addIntegerOption(option => option.setName("amount")
.setDescription(client.translate("common:INT"))
.setDescriptionLocalizations({ "uk": client.translate("common:INT", null, "uk-UA") })
.setRequired(true)),
aliases: [],
dirname: __dirname,

View file

@ -12,9 +12,11 @@ class TicTacToe extends BaseCommand {
command: new SlashCommandBuilder()
.setName("tictactoe")
.setDescription(client.translate("economy/tictactoe:DESCRIPTION"))
.setDescriptionLocalizations({ "uk": client.translate("economy/tictactoe:DESCRIPTION", null, "uk-UA") })
.setDMPermission(false)
.addUserOption(option => option.setName("user")
.setDescription(client.translate("common:USER"))
.setDescriptionLocalizations({ "uk": client.translate("common:USER", null, "uk-UA") })
.setRequired(true)),
aliases: [],
dirname: __dirname,

View file

@ -11,9 +11,11 @@ class Transactions extends BaseCommand {
command: new SlashCommandBuilder()
.setName("transactions")
.setDescription(client.translate("economy/transactions:DESCRIPTION"))
.setDescriptionLocalizations({ "uk": client.translate("economy/transactions:DESCRIPTION", null, "uk-UA") })
.setDMPermission(false)
.addBooleanOption(option => option.setName("clear")
.setDescription(client.translate("economy/transactions:CLEAR"))),
.setDescription(client.translate("economy/transactions:CLEAR"))
.setDescriptionLocalizations({ "uk": client.translate("economy/transactions:CLEAR", null, "uk-UA") })),
aliases: [],
dirname: __dirname,
ownerOnly: false,

View file

@ -11,6 +11,7 @@ class Work extends BaseCommand {
command: new SlashCommandBuilder()
.setName("work")
.setDescription(client.translate("economy/work:DESCRIPTION"))
.setDescriptionLocalizations({ "uk": client.translate("economy/work:DESCRIPTION", null, "uk-UA") })
.setDMPermission(false),
aliases: [],
dirname: __dirname,

View file

@ -11,9 +11,11 @@ class Eightball extends BaseCommand {
command: new SlashCommandBuilder()
.setName("8ball")
.setDescription(client.translate("fun/8ball:DESCRIPTION"))
.setDescriptionLocalizations({ "uk": client.translate("fun/8ball:DESCRIPTION", null, "uk-UA") })
.setDMPermission(true)
.addStringOption(option => option.setName("question")
.setDescription(client.translate("fun/8ball:QUESTION"))
.setDescriptionLocalizations({ "uk": client.translate("fun/8ball:QUESTION", null, "uk-UA") })
.setRequired(true)),
aliases: [],
dirname: __dirname,

View file

@ -12,6 +12,7 @@ class Cat extends BaseCommand {
command: new SlashCommandBuilder()
.setName("cat")
.setDescription(client.translate("fun/cat:DESCRIPTION"))
.setDescriptionLocalizations({ "uk": client.translate("fun/cat:DESCRIPTION", null, "uk-UA") })
.setDMPermission(true),
aliases: [],
dirname: __dirname,

View file

@ -12,6 +12,7 @@ class Crab extends BaseCommand {
command: new SlashCommandBuilder()
.setName("crab")
.setDescription(client.translate("fun/crab:DESCRIPTION"))
.setDescriptionLocalizations({ "uk": client.translate("fun/crab:DESCRIPTION", null, "uk-UA") })
.setDMPermission(true),
aliases: [],
dirname: __dirname,

View file

@ -12,6 +12,7 @@ class Dog extends BaseCommand {
command: new SlashCommandBuilder()
.setName("dog")
.setDescription(client.translate("fun/dog:DESCRIPTION"))
.setDescriptionLocalizations({ "uk": client.translate("fun/dog:DESCRIPTION", null, "uk-UA") })
.setDMPermission(true),
aliases: [],
dirname: __dirname,

View file

@ -12,12 +12,15 @@ class LMGTFY extends BaseCommand {
command: new SlashCommandBuilder()
.setName("lmgtfy")
.setDescription(client.translate("fun/lmgtfy:DESCRIPTION"))
.setDescriptionLocalizations({ "uk": client.translate("fun/lmgtfy:DESCRIPTION", null, "uk-UA") })
.setDMPermission(true)
.addStringOption(option => option.setName("query")
.setDescription(client.translate("fun/lmgtfy:QUERY"))
.setDescriptionLocalizations({ "uk": client.translate("fun/lmgtfy:QUERY", null, "uk-UA") })
.setRequired(true))
.addBooleanOption(option => option.setName("short")
.setDescription(client.translate("fun/lmgtfy:SHORT"))
.setDescriptionLocalizations({ "uk": client.translate("fun/lmgtfy:SHORT", null, "uk-UA") })
.setRequired(true)),
aliases: [],
dirname: __dirname,
@ -51,7 +54,7 @@ class LMGTFY extends BaseCommand {
});
} else {
interaction.reply({
content: `<${url}>`,
content: `\`\`\`<${url}>\`\`\``,
ephemeral: true,
});
}

View file

@ -12,14 +12,17 @@ class Lovecalc extends BaseCommand {
command: new SlashCommandBuilder()
.setName("lovecalc")
.setDescription(client.translate("fun/lovecalc:DESCRIPTION"))
.setDescriptionLocalizations({ "uk": client.translate("fun/lovecalc:DESCRIPTION", null, "uk-UA") })
.setDMPermission(false)
.addUserOption(option =>
option.setName("first_member")
.setDescription(client.translate("common:USER"))
.setDescriptionLocalizations({ "uk": client.translate("common:USER", null, "uk-UA") })
.setRequired(true))
.addUserOption(option =>
option.setName("second_member")
.setDescription(client.translate("common:USER"))),
.setDescription(client.translate("common:USER"))
.setDescriptionLocalizations({ "uk": client.translate("common:USER", null, "uk-UA") })),
aliases: [],
dirname: __dirname,
ownerOnly: false,

View file

@ -12,6 +12,7 @@ class Memes extends BaseCommand {
command: new SlashCommandBuilder()
.setName("memes")
.setDescription(client.translate("fun/memes:DESCRIPTION"))
.setDescriptionLocalizations({ "uk": client.translate("fun/memes:DESCRIPTION", null, "uk-UA") })
.setDMPermission(false),
aliases: [],
dirname: __dirname,
@ -34,7 +35,7 @@ class Memes extends BaseCommand {
async execute(client, interaction) {
await interaction.deferReply();
const tags = ["memes", "dankmemes", "me_irl", "wholesomememes"].map(tag =>
const tags = ["funny", "memes", "dankmemes", "me_irl", "wholesomememes"].map(tag =>
JSON.parse(JSON.stringify({
label: tag,
value: tag,

View file

@ -11,9 +11,11 @@ class Afk extends BaseCommand {
command: new SlashCommandBuilder()
.setName("afk")
.setDescription(client.translate("general/afk:DESCRIPTION"))
.setDescriptionLocalizations({ "uk": client.translate("general/afk:DESCRIPTION", null, "uk-UA") })
.setDMPermission(true)
.addStringOption(option => option.setName("message")
.setDescription(client.translate("common:MESSAGE"))
.setDescriptionLocalizations({ "uk": client.translate("common:MESSAGE", null, "uk-UA") })
.setRequired(true)),
aliases: [],
dirname: __dirname,

View file

@ -11,9 +11,11 @@ class Avatar extends BaseCommand {
command: new SlashCommandBuilder()
.setName("avatar")
.setDescription(client.translate("general/avatar:DESCRIPTION"))
.setDescriptionLocalizations({ "uk": client.translate("general/avatar:DESCRIPTION", null, "uk-UA") })
.setDMPermission(true)
.addUserOption(option => option.setName("user")
.setDescription(client.translate("common:USER"))),
.setDescription(client.translate("common:USER"))
.setDescriptionLocalizations({ "uk": client.translate("common:USER", null, "uk-UA") })),
aliases: [],
dirname: __dirname,
ownerOnly: false,

View file

@ -11,6 +11,7 @@ class Boosters extends BaseCommand {
command: new SlashCommandBuilder()
.setName("boosters")
.setDescription(client.translate("general/boosters:DESCRIPTION"))
.setDescriptionLocalizations({ "uk": client.translate("general/boosters:DESCRIPTION", null, "uk-UA") })
.setDMPermission(false),
aliases: [],
dirname: __dirname,

View file

@ -11,9 +11,11 @@ class Emoji extends BaseCommand {
command: new SlashCommandBuilder()
.setName("emoji")
.setDescription(client.translate("general/emoji:DESCRIPTION"))
.setDescriptionLocalizations({ "uk": client.translate("general/emoji:DESCRIPTION", null, "uk-UA") })
.setDMPermission(true)
.addStringOption(option => option.setName("emoji")
.setDescription(client.translate("common:EMOJI"))
.setDescriptionLocalizations({ "uk": client.translate("commom:EMOJI", null, "uk-UA") })
.setRequired(true)),
aliases: [],
dirname: __dirname,

View file

@ -11,10 +11,12 @@ class Help extends BaseCommand {
command: new SlashCommandBuilder()
.setName("help")
.setDescription(client.translate("general/help:DESCRIPTION"))
.setDescriptionLocalizations({ "uk": client.translate("general/help:DESCRIPTION", null, "uk-UA") })
.setDMPermission(true)
.addStringOption(option =>
option.setName("command")
.setDescription(client.translate("common:COMMAND"))),
.setDescription(client.translate("common:COMMAND"))
.setDescriptionLocalizations({ "uk": client.translate("common:COMMAND", null, "uk-UA") })),
aliases: [],
dirname: __dirname,
ownerOnly: false,
@ -39,6 +41,7 @@ class Help extends BaseCommand {
const commands = [...new Map(client.commands.map(v => [v.constructor.name, v])).values()];
const categories = [];
const command = interaction.options.getString("command");
if ((commands.find(c => c.command.name === command).category === "Owner") && interaction.user.id !== client.config.owner.id) return interaction.error("misc:OWNER_ONLY", null, { edit: true, ephemeral: true });
if (command) return interaction.editReply({ embeds: [ generateCommandHelp(interaction, command) ] });
@ -125,6 +128,7 @@ function getPermName(bitfield = 0) {
function generateCommandHelp(interaction, command) {
const cmd = interaction.client.commands.get(command);
if (!cmd) return interaction.error("general/help:NOT_FOUND", { command }, { edit: true });
const usage = interaction.translate(`${cmd.category.toLowerCase()}/${cmd.command.name}:USAGE`) === "" ?
interaction.translate("misc:NO_ARGS")
: interaction.translate(`${cmd.category.toLowerCase()}/${cmd.command.name}:USAGE`);

View file

@ -12,9 +12,11 @@ class Minecraft extends BaseCommand {
command: new SlashCommandBuilder()
.setName("minecraft")
.setDescription(client.translate("general/minecraft:DESCRIPTION"))
.setDescriptionLocalizations({ "uk": client.translate("general/minecraft:DESCRIPTION", null, "uk-UA") })
.setDMPermission(true)
.addStringOption(option => option.setName("ip")
.setDescription(client.translate("common:IP"))
.setDescriptionLocalizations({ "uk": client.translate("common:IP", null, "uk-UA") })
.setRequired(true)),
aliases: [],
dirname: __dirname,

View file

@ -11,6 +11,7 @@ class Ping extends BaseCommand {
command: new SlashCommandBuilder()
.setName("ping")
.setDescription(client.translate("general/ping:DESCRIPTION"))
.setDescriptionLocalizations({ "uk": client.translate("general/ping:DESCRIPTION", null, "uk-UA") })
.setDMPermission(true),
aliases: [],
dirname: __dirname,

View file

@ -13,12 +13,15 @@ class Remindme extends BaseCommand {
command: new SlashCommandBuilder()
.setName("remindme")
.setDescription(client.translate("general/remindme:DESCRIPTION"))
.setDescriptionLocalizations({ "uk": client.translate("general/remindme:DESCRIPTION", null, "uk-UA") })
.setDMPermission(true)
.addStringOption(option => option.setName("time")
.setDescription(client.translate("owner/remindme:TIME"))
.setDescription(client.translate("general/remindme:TIME"))
.setDescriptionLocalizations({ "uk": client.translate("general/remindme:TIME", null, "uk-UA") })
.setRequired(true))
.addStringOption(option => option.setName("message")
.setDescription(client.translate("common:MESSAGE"))
.setDescriptionLocalizations({ "uk": client.translate("common:MESSAGE", null, "uk-UA") })
.setRequired(true)),
aliases: [],
dirname: __dirname,

View file

@ -11,12 +11,15 @@ class Report extends BaseCommand {
command: new SlashCommandBuilder()
.setName("report")
.setDescription(client.translate("general/report:DESCRIPTION"))
.setDescriptionLocalizations({ "uk": client.translate("general/report:DESCRIPTION", null, "uk-UA") })
.setDMPermission(false)
.addUserOption(option => option.setName("user")
.setDescription(client.translate("common:USER"))
.setDescriptionLocalizations({ "uk": client.translate("common:USER", null, "uk-UA") })
.setRequired(true))
.addStringOption(option => option.setName("message")
.setDescription(client.translate("common:MESSAGE"))
.setDescriptionLocalizations({ "uk": client.translate("common:MESSAGE", null, "uk-UA") })
.setRequired(true)),
aliases: [],
dirname: __dirname,

View file

@ -11,6 +11,7 @@ class Serverinfo extends BaseCommand {
command: new SlashCommandBuilder()
.setName("serverinfo")
.setDescription(client.translate("general/serverinfo:DESCRIPTION"))
.setDescriptionLocalizations({ "uk": client.translate("general/serverinfo:DESCRIPTION", null, "uk-UA") })
.setDMPermission(false),
aliases: [],
dirname: __dirname,

View file

@ -12,9 +12,11 @@ class Shorturl extends BaseCommand {
command: new SlashCommandBuilder()
.setName("shorturl")
.setDescription(client.translate("general/shorturl:DESCRIPTION"))
.setDescriptionLocalizations({ "uk": client.translate("general/shorturl:DESCRIPTION", null, "uk-UA") })
.setDMPermission(true)
.addStringOption(option => option.setName("url")
.setDescription(client.translate("general/shorturl:URL"))
.setDescriptionLocalizations({ "uk": client.translate("general/shorturl:URL", null, "uk-UA") })
.setRequired(true)),
aliases: [],
dirname: __dirname,

View file

@ -11,6 +11,7 @@ class Staff extends BaseCommand {
command: new SlashCommandBuilder()
.setName("staff")
.setDescription(client.translate("general/staff:DESCRIPTION"))
.setDescriptionLocalizations({ "uk": client.translate("general/staff:DESCRIPTION", null, "uk-UA") })
.setDMPermission(false),
aliases: [],
dirname: __dirname,

View file

@ -11,9 +11,11 @@ class Suggest extends BaseCommand {
command: new SlashCommandBuilder()
.setName("suggest")
.setDescription(client.translate("general/suggest:DESCRIPTION"))
.setDescriptionLocalizations({ "uk": client.translate("general/suggest:DESCRIPTION", null, "uk-UA") })
.setDMPermission(false)
.addStringOption(option => option.setName("message")
.setDescription(client.translate("common:MESSAGE"))
.setDescriptionLocalizations({ "uk": client.translate("common:MESSAGE", null, "uk-UA") })
.setRequired(true)),
aliases: [],
dirname: __dirname,

View file

@ -11,9 +11,11 @@ class Userinfo extends BaseCommand {
command: new SlashCommandBuilder()
.setName("userinfo")
.setDescription(client.translate("general/userinfo:DESCRIPTION"))
.setDescriptionLocalizations({ "uk": client.translate("general/userinfo:DESCRIPTION", null, "uk-UA") })
.setDMPermission(false)
.addUserOption(option => option.setName("user")
.setDescription(client.translate("common:USER"))),
.setDescription(client.translate("common:USER"))
.setDescriptionLocalizations({ "uk": client.translate("common:USER", null, "uk-UA") })),
aliases: [],
dirname: __dirname,
ownerOnly: false,

View file

@ -12,9 +12,11 @@ class Whois extends BaseCommand {
command: new SlashCommandBuilder()
.setName("whois")
.setDescription(client.translate("general/whois:DESCRIPTION"))
.setDescriptionLocalizations({ "uk": client.translate("general/whois:DESCRIPTION", null, "uk-UA") })
.setDMPermission(true)
.addStringOption(option => option.setName("ip")
.setDescription(client.translate("common:IP"))
.setDescriptionLocalizations({ "uk": client.translate("common:IP", null, "uk-UA") })
.setRequired(true)),
aliases: [],
dirname: __dirname,

View file

@ -13,6 +13,7 @@ class Checkjar extends BaseCommand {
command: new SlashCommandBuilder()
.setName("checkjar")
.setDescription(client.translate("iat/checkjar:DESCRIPTION"))
.setDescriptionLocalizations({ "uk": client.translate("iat/checkjar:DESCRIPTION", null, "uk-UA") })
.setDMPermission(false),
aliases: [],
dirname: __dirname,

View file

@ -11,13 +11,19 @@ class Clear extends BaseCommand {
command: new SlashCommandBuilder()
.setName("clear")
.setDescription(client.translate("moderation/clear:DESCRIPTION"))
.setDescriptionLocalizations({ "uk": client.translate("moderation/clear:DESCRIPTION", null, "uk-UA") })
.setDMPermission(false)
.setDefaultMemberPermissions(PermissionFlagsBits.ModerateMembers && PermissionFlagsBits.ManageMessages)
.addStringOption(option => option.setName("option")
.setDescription(client.translate("moderation/clear:OPTION"))
.setDescriptionLocalizations({ "uk": client.translate("moderation/clear:OPTION", null, "uk-UA") })
.setRequired(true))
.addUserOption(option => option.setName("user")
.setDescription(client.translate("common:USER"))),
.setDescription(client.translate("common:USER"))
.setDescriptionLocalizations({ "uk": client.translate("common:USER", null, "uk-UA") }))
.addStringOption(option => option.setName("id")
.setDescription(client.translate("common:USER_ID"))
.setDescriptionLocalizations({ "uk": client.translate("common:USER_ID", null, "uk-UA") })),
aliases: [],
dirname: __dirname,
ownerOnly: false,
@ -39,8 +45,9 @@ class Clear extends BaseCommand {
async execute(client, interaction) {
await interaction.deferReply({ ephemeral: true });
const option = interaction.options.getString("option");
const member = interaction.options.getMember("user");
const option = interaction.options.getString("option"),
member = interaction.options.getMember("user"),
user_id = interaction.options.getString("id");
if (option === "all") {
const row = new ActionRowBuilder()
@ -105,23 +112,25 @@ class Clear extends BaseCommand {
});
} else {
if (isNaN(option) || parseInt(option) < 1) return interaction.error("misc:OPTION_NAN_ALL", null, { ephemeral: true });
let messages = await interaction.channel.messages.fetch({
limit: option,
});
if (member) messages = messages.filter(m => m.author.id === member.id);
if (messages.length > option) messages.length = parseInt(option, 10);
if ((!member && !user_id) || (member && user_id)) return interaction.replyT("moderation/clear:REQUIRE_ID_USER", null, { edit: true });
if (member || user_id) messages = messages.filter(m => m.author.id === (member?.id || user_id));
interaction.channel.bulkDelete(messages.filter(m => !m.pinned), true);
if (member) {
if (member || user_id) {
interaction.replyT("moderation/clear:CLEARED_MEMBER", {
amount: `**${option}** ${client.getNoun(option, interaction.translate("misc:NOUNS:MESSAGES:1"), interaction.translate("misc:NOUNS:MESSAGES:2"), interaction.translate("misc:NOUNS:MESSAGES:5"))}`,
username: member.user.tag,
}, { ephemeral: true, edit: true });
user: (member?.user.tag || user_id),
}, { edit: true });
} else {
interaction.replyT("moderation/clear:CLEARED", {
amount: `**${option}** ${client.getNoun(option, interaction.translate("misc:NOUNS:MESSAGES:1"), interaction.translate("misc:NOUNS:MESSAGES:2"), interaction.translate("misc:NOUNS:MESSAGES:5"))}`,
}, { ephemeral: true, edit: true });
}, { edit: true });
}
}
}

View file

@ -11,10 +11,12 @@ class Clearwarns extends BaseCommand {
command: new SlashCommandBuilder()
.setName("clearwarns")
.setDescription(client.translate("moderation/clearwarns:DESCRIPTION"))
.setDescriptionLocalizations({ "uk": client.translate("moderation/clearwarns:DESCRIPTION", null, "uk-UA") })
.setDMPermission(false)
.setDefaultMemberPermissions(PermissionFlagsBits.ModerateMembers && PermissionFlagsBits.ManageMessages)
.addUserOption(option => option.setName("user")
.setDescription(client.translate("common:USER"))
.setDescriptionLocalizations({ "uk": client.translate("common:USER", null, "uk-UA") })
.setRequired(true)),
aliases: [],
dirname: __dirname,

View file

@ -12,39 +12,51 @@ class Giveaway extends BaseCommand {
command: new SlashCommandBuilder()
.setName("giveaway")
.setDescription(client.translate("moderation/giveaway:DESCRIPTION"))
.setDescriptionLocalizations({ "uk": client.translate("moderation/giveaway:DESCRIPTION", null, "uk-UA") })
.setDMPermission(false)
.setDefaultMemberPermissions(PermissionFlagsBits.ModerateMembers && PermissionFlagsBits.ManageMessages)
.addSubcommand(subcommand => subcommand.setName("create")
.setDescription(client.translate("moderation/giveaway:CREATE"))
.setDescriptionLocalizations({ "uk": client.translate("moderation/giveaway:CREATE", null, "uk-UA") })
.addStringOption(option => option.setName("duration")
.setDescription(client.translate("common:DURATION"))
.setDescriptionLocalizations({ "uk": client.translate("common:DURATION", null, "uk-UA") })
.setRequired(true))
.addIntegerOption(option => option.setName("winners_count")
.setDescription(client.translate("moderation/giveaway:WINNERS_COUNT"))
.setDescriptionLocalizations({ "uk": client.translate("moderation/giveaway:WINNERS_COUNT", null, "uk-UA") })
.setRequired(true))
.addStringOption(option => option.setName("prize")
.setDescription(client.translate("moderation/giveaway:PRIZE"))
.setDescriptionLocalizations({ "uk": client.translate("moderation/giveaway:PRIZE", null, "uk-UA") })
.setRequired(true))
.addBooleanOption(option => option.setName("isdrop")
.setDescription(client.translate("moderation/giveaway:ISDROP"))
.setDescriptionLocalizations({ "uk": client.translate("moderation/giveaway:ISDROP", null, "uk-UA") })
.setRequired(true)),
)
.addSubcommand(subcommand => subcommand.setName("reroll")
.setDescription(client.translate("moderation/giveaway:REROLL"))
.setDescriptionLocalizations({ "uk": client.translate("moderation/giveaway:REROLL", null, "uk-UA") })
.addStringOption(option => option.setName("giveaway_id")
.setDescription(client.translate("moderation/giveaway:GIVEAWAY_ID"))
.setDescriptionLocalizations({ "uk": client.translate("moderation/giveaway:GIVEAWAY_ID", null, "uk-UA") })
.setRequired(true)),
)
.addSubcommand(subcommand => subcommand.setName("end")
.setDescription(client.translate("moderation/giveaway:END"))
.setDescriptionLocalizations({ "uk": client.translate("moderation/giveaway:END", null, "uk-UA") })
.addStringOption(option => option.setName("giveaway_id")
.setDescription(client.translate("moderation/giveaway:GIVEAWAY_ID"))
.setDescriptionLocalizations({ "uk": client.translate("moderation/giveaway:GIVEAWAY_ID", null, "uk-UA") })
.setRequired(true)),
)
.addSubcommand(subcommand => subcommand.setName("delete")
.setDescription(client.translate("moderation/giveaway:DELETE"))
.setDescriptionLocalizations({ "uk": client.translate("moderation/giveaway:DELETE", null, "uk-UA") })
.addStringOption(option => option.setName("giveaway_id")
.setDescription(client.translate("moderation/giveaway:GIVEAWAY_ID"))
.setDescriptionLocalizations({ "uk": client.translate("moderation/giveaway:GIVEAWAY_ID", null, "uk-UA") })
.setRequired(true)),
),
aliases: [],

View file

@ -11,10 +11,12 @@ class Poll extends BaseCommand {
command: new SlashCommandBuilder()
.setName("poll")
.setDescription(client.translate("moderation/poll:DESCRIPTION"))
.setDescriptionLocalizations({ "uk": client.translate("moderation/poll:DESCRIPTION", null, "uk-UA") })
.setDMPermission(false)
.setDefaultMemberPermissions(PermissionFlagsBits.ModerateMembers && PermissionFlagsBits.ManageMessages)
.addStringOption(option => option.setName("question")
.setDescription(client.translate("moderation/poll:QUESTION"))
.setDescriptionLocalizations({ "uk": client.translate("moderation/poll:QUESTION", null, "uk-UA") })
.setRequired(true)),
aliases: [],
dirname: __dirname,

View file

@ -11,10 +11,12 @@ class Unban extends BaseCommand {
command: new SlashCommandBuilder()
.setName("unban")
.setDescription(client.translate("moderation/unban:DESCRIPTION"))
.setDescriptionLocalizations({ "uk": client.translate("moderation/unban:DESCRIPTION", null, "uk-UA") })
.setDMPermission(false)
.setDefaultMemberPermissions(PermissionFlagsBits.ModerateMembers && PermissionFlagsBits.ManageMessages)
.addStringOption(option => option.setName("user_id")
.setDescription(client.translate("common:USER_ID"))
.setDescriptionLocalizations({ "uk": client.translate("common:USER_ID", null, "uk-UA") })
.setRequired(true)),
aliases: [],
dirname: __dirname,

View file

@ -106,7 +106,7 @@ class Warn extends BaseCommand {
if (sanctions >= banCount) {
member.send({
content: interaction.translate("moderation/ban:BANNED_DM", {
username: member.user,
user: member.user,
moderator: interaction.user.tag,
server: interaction.guild.name,
reason,
@ -124,7 +124,7 @@ class Warn extends BaseCommand {
interaction.guild.members.ban(member).catch(() => {});
interaction.followUp({
content: interaction.translate("moderation/setwarns:AUTO_BAN", {
username: member.user.tag,
user: member.user.tag,
count: `${banCount} ${client.getNoun(banCount, interaction.translate("misc:NOUNS:WARNS:1"), interaction.translate("misc:NOUNS:WARNS:2"), interaction.translate("misc:NOUNS:WARNS:5"))}`,
}),
});
@ -135,7 +135,7 @@ class Warn extends BaseCommand {
if (sanctions >= kickCount) {
member.send({
content: interaction.translate("moderation/kick:KICKED_DM", {
username: member.user,
user: member.user,
moderator: interaction.user.tag,
server: interaction.guild.name,
reason,
@ -153,7 +153,7 @@ class Warn extends BaseCommand {
member.kick().catch(() => {});
interaction.followUp({
content: interaction.translate("moderation/setwarns:AUTO_KICK", {
username: member.user.tag,
user: member.user.tag,
count: `${kickCount} ${client.getNoun(kickCount, interaction.translate("misc:NOUNS:WARNS:1"), interaction.translate("misc:NOUNS:WARNS:2"), interaction.translate("misc:NOUNS:WARNS:5"))}`,
}),
});
@ -162,7 +162,7 @@ class Warn extends BaseCommand {
member.send({
content: interaction.translate("moderation/warn:WARNED_DM", {
username: member.user.tag,
user: member.user.tag,
server: interaction.guild.name,
moderator: interaction.user.tag,
reason,

View file

@ -11,10 +11,12 @@ class Warns extends BaseCommand {
command: new SlashCommandBuilder()
.setName("warns")
.setDescription(client.translate("moderation/warns:DESCRIPTION"))
.setDescriptionLocalizations({ "uk": client.translate("moderation/warns:DESCRIPTION", null, "uk-UA") })
.setDMPermission(false)
.setDefaultMemberPermissions(PermissionFlagsBits.ModerateMembers && PermissionFlagsBits.ManageMessages)
.addUserOption(option => option.setName("user")
.setDescription(client.translate("common:USER"))
.setDescriptionLocalizations({ "uk": client.translate("common:USER", null, "uk-UA") })
.setRequired(true)),
aliases: [],
dirname: __dirname,

View file

@ -11,6 +11,7 @@ class Back extends BaseCommand {
command: new SlashCommandBuilder()
.setName("back")
.setDescription(client.translate("music/back:DESCRIPTION"))
.setDescriptionLocalizations({ "uk": client.translate("music/back:DESCRIPTION", null, "uk-UA") })
.setDMPermission(false),
aliases: [],
dirname: __dirname,

View file

@ -13,9 +13,11 @@ class Clips extends BaseCommand {
command: new SlashCommandBuilder()
.setName("clips")
.setDescription(client.translate("music/clips:DESCRIPTION"))
.setDescriptionLocalizations({ "uk": client.translate("music/clips:DESCRIPTION", null, "uk-UA") })
.setDMPermission(false)
.addStringOption(option => option.setName("query")
.setDescription(client.translate("music/clips:QUERY"))
.setDescriptionLocalizations({ "uk": client.translate("music/clips:QUERY", null, "uk-UA") })
.setRequired(true)
.setAutocomplete(true)),
aliases: [],
@ -76,10 +78,12 @@ class Clips extends BaseCommand {
* @returns
*/
async autocompleteRun(client, interaction) {
const files = fs.readdirSync("./clips");
const query = interaction.options.getString("query"),
files = fs.readdirSync("./clips"),
results = files.filter(f => f.includes(query));
return interaction.respond(
files.slice(0, 10).map(file => ({
results.slice(0, 25).map(file => ({
name: file.substring(0, file.length - 4),
value: `./clips/${file}`,
}),

View file

@ -12,11 +12,12 @@ class Loop extends BaseCommand {
command: new SlashCommandBuilder()
.setName("loop")
.setDescription(client.translate("music/loop:DESCRIPTION"))
.setDescriptionLocalizations({ "uk": client.translate("music/loop:DESCRIPTION", null, "uk-UA") })
.setDMPermission(false)
.addStringOption(option => option.setName("option")
.setDescription(client.translate("economy/bank:OPTION"))
.setDescription(client.translate("music/loop:OPTION"))
.setRequired(true)
.addChoices(
.setChoices(
{ name: client.translate("music/loop:AUTOPLAY"), value: "3" },
{ name: client.translate("music/loop:QUEUE"), value: "2" },
{ name: client.translate("music/loop:TRACK"), value: "1" },

View file

@ -12,6 +12,7 @@ class Nowplaying extends BaseCommand {
command: new SlashCommandBuilder()
.setName("nowplaying")
.setDescription(client.translate("music/nowplaying:DESCRIPTION"))
.setDescriptionLocalizations({ "uk": client.translate("music/nowplaying:DESCRIPTION", null, "uk-UA") })
.setDMPermission(false),
aliases: [],
dirname: __dirname,

View file

@ -11,9 +11,11 @@ class Play extends BaseCommand {
command: new SlashCommandBuilder()
.setName("play")
.setDescription(client.translate("music/play:DESCRIPTION"))
.setDescriptionLocalizations({ "uk": client.translate("music/play:DESCRIPTION", null, "uk-UA") })
.setDMPermission(false)
.addStringOption(option => option.setName("query")
.setDescription(client.translate("music/play:QUERY"))
.setDescriptionLocalizations({ "uk": client.translate("music/play:QUERY", null, "uk-UA") })
.setRequired(true)
.setAutocomplete(true)),
aliases: [],
@ -80,7 +82,7 @@ class Play extends BaseCommand {
* @returns
*/
async autocompleteRun(client, interaction) {
const query = interaction.options.getString("query", true),
const query = interaction.options.getString("query"),
results = await client.player.search(query);
return interaction.respond(

View file

@ -12,6 +12,7 @@ class Queue extends BaseCommand {
command: new SlashCommandBuilder()
.setName("queue")
.setDescription(client.translate("music/queue:DESCRIPTION"))
.setDescriptionLocalizations({ "uk": client.translate("music/queue:DESCRIPTION", null, "uk-UA") })
.setDMPermission(false),
aliases: [],
dirname: __dirname,

View file

@ -11,8 +11,10 @@ class Seek extends BaseCommand {
command: new SlashCommandBuilder()
.setName("seek")
.setDescription(client.translate("music/seek:DESCRIPTION"))
.setDescriptionLocalizations({ "uk": client.translate("music/seek:DESCRIPTION", null, "uk-UA") })
.addIntegerOption(option => option.setName("time")
.setDescription(client.translate("music/seek:TIME"))
.setDescriptionLocalizations({ "uk": client.translate("music/seek:TIME", null, "uk-UA") })
.setRequired(true)),
aliases: [],
dirname: __dirname,

View file

@ -11,6 +11,7 @@ class Shuffle extends BaseCommand {
command: new SlashCommandBuilder()
.setName("shuffle")
.setDescription(client.translate("music/shuffle:DESCRIPTION"))
.setDescriptionLocalizations({ "uk": client.translate("music/shuffle:DESCRIPTION", null, "uk-UA") })
.setDMPermission(false),
aliases: [],
dirname: __dirname,

View file

@ -11,6 +11,7 @@ class Skip extends BaseCommand {
command: new SlashCommandBuilder()
.setName("skip")
.setDescription(client.translate("music/skip:DESCRIPTION"))
.setDescriptionLocalizations({ "uk": client.translate("music/skip:DESCRIPTION", null, "uk-UA") })
.setDMPermission(false),
aliases: [],
dirname: __dirname,

View file

@ -11,9 +11,11 @@ class Skipto extends BaseCommand {
command: new SlashCommandBuilder()
.setName("skipto")
.setDescription(client.translate("music/skipto:DESCRIPTION"))
.setDescriptionLocalizations({ "uk": client.translate("music/skipto:DESCRIPTION", null, "uk-UA") })
.setDMPermission(false)
.addIntegerOption(option => option.setName("position")
.setDescription(client.translate("music/skipto:POSITION"))
.setDescriptionLocalizations({ "uk": client.translate("music/skipto:POSITION", null, "uk-UA") })
.setRequired(true)),
aliases: [],
dirname: __dirname,

View file

@ -11,6 +11,7 @@ class Stop extends BaseCommand {
command: new SlashCommandBuilder()
.setName("stop")
.setDescription(client.translate("music/stop:DESCRIPTION"))
.setDescriptionLocalizations({ "uk": client.translate("music/stop:DESCRIPTION", null, "uk-UA") })
.setDMPermission(false),
aliases: [],
dirname: __dirname,

74
commands/Music/volume.js Normal file
View file

@ -0,0 +1,74 @@
const { SlashCommandBuilder } = require("discord.js");
const BaseCommand = require("../../base/BaseCommand");
class Volume extends BaseCommand {
/**
*
* @param {import("../base/JaBa")} client
*/
constructor(client) {
super({
command: new SlashCommandBuilder()
.setName("volume")
.setDescription(client.translate("music/volume:DESCRIPTION"))
.setDescriptionLocalizations({ "uk": client.translate("music/volume:DESCRIPTION", null, "uk-UA") })
.setDMPermission(false)
.addIntegerOption(option => option.setName("int")
.setDescription(client.translate("common:INT"))
.setDescriptionLocalizations({ "uk": client.translate("common:INT", null, "uk-UA") })
.setRequired(true)
.setAutocomplete(true)),
aliases: [],
dirname: __dirname,
ownerOnly: false,
});
}
/**
*
* @param {import("../../base/JaBa")} client
*/
async onLoad() {
//...
}
/**
*
* @param {import("../../base/JaBa")} client
* @param {import("discord.js").ChatInputCommandInteraction} interaction
* @param {Object} data
*/
async execute(client, interaction) {
const voice = interaction.member.voice.channel;
if (!voice) return interaction.error("music/play:NO_VOICE_CHANNEL", null, { ephemeral: true });
const queue = client.player.nodes.get(interaction.guildId);
if (!queue) return interaction.error("music/play:NOT_PLAYING", null, { ephemeral: true });
const volume = interaction.options.getInteger("int");
if (volume <= 0 || volume > 100) return interaction.error("common:INVALID_NUMBER_RANGE", { min: 1, max: 100 });
queue.node.setVolume(volume);
interaction.success("music/volume:SUCCESS", {
volume,
});
}
/**
*
* @param {import("../../base/JaBa")} client
* @param {import("discord.js").AutocompleteInteraction} interaction
* @returns
*/
async autocompleteRun(client, interaction) {
const int = interaction.options.getInteger("int"),
results = Array.from({ length: 100 }, (_, k) => k + 1).filter(i => i.toString().includes(int));
return interaction.respond(
results.slice(0, 25).map(i => ({
name: i,
value: i,
}),
));
}
}
module.exports = Volume;

View file

@ -10,8 +10,9 @@ class NSFW extends BaseCommand {
constructor(client) {
super({
command: new SlashCommandBuilder()
.setName("nsfw")
.setDescription(client.translate("nsfw/nsfw:DESCRIPTION"))
.setName("pic")
.setDescription(client.translate("nsfw/pic:DESCRIPTION"))
.setDescriptionLocalizations({ "uk": client.translate("nsfw/pic:DESCRIPTION", null, "uk-UA") })
.setDMPermission(true),
aliases: [],
dirname: __dirname,

View file

@ -11,15 +11,19 @@ class Announcement extends BaseCommand {
command: new SlashCommandBuilder()
.setName("announcement")
.setDescription(client.translate("owner/announcement:DESCRIPTION"))
.setDescriptionLocalizations({ "uk": client.translate("owner/announcement:DESCRIPTION", null, "uk-UA") })
.setDMPermission(true)
.addStringOption(option => option.setName("message")
.setDescription(client.translate("common:MESSAGE"))
.setDescriptionLocalizations({ "uk": client.translate("common:MESSAGE", null, "uk-UA") })
.setRequired(true))
.addBooleanOption(option => option.setName("tag")
.setDescription(client.translate("owner/announcement:TAG"))
.setDescriptionLocalizations({ "uk": client.translate("owner/announcement:TAG", null, "uk-UA") })
.setRequired(true))
.addBooleanOption(option => option.setName("important")
.setDescription(client.translate("owner/announcement:IMPORTANT"))),
.setDescription(client.translate("owner/announcement:IMPORTANT"))
.setDescriptionLocalizations({ "uk": client.translate("owner/announcement:IMPORTANT", null, "uk-UA") })),
aliases: [],
dirname: __dirname,
ownerOnly: true,

View file

@ -11,13 +11,16 @@ class Debug extends BaseCommand {
command: new SlashCommandBuilder()
.setName("debug")
.setDescription(client.translate("owner/debug:DESCRIPTION"))
.setDescriptionLocalizations({ "uk": client.translate("owner/debug:DESCRIPTION", null, "uk-UA") })
.setDMPermission(false)
.addSubcommand(subcommand => subcommand.setName("set")
.setDescription(client.translate("owner/debug:SET"))
.setDescriptionLocalizations({ "uk": client.translate("owner/debug:SET", null, "uk-UA") })
.addStringOption(option => option.setName("type")
.setDescription(client.translate("owner/debug:TYPE"))
.setDescriptionLocalizations({ "uk": client.translate("owner/debug:TYPE", null, "uk-UA") })
.setRequired(true)
.addChoices(
.setChoices(
{ name: client.translate("common:LEVEL"), value: "level" },
{ name: client.translate("common:XP"), value: "xp" },
{ name: client.translate("common:CREDITS"), value: "credits" },
@ -26,17 +29,21 @@ class Debug extends BaseCommand {
))
.addUserOption(option => option.setName("user")
.setDescription(client.translate("common:USER"))
.setDescriptionLocalizations({ "uk": client.translate("common:USER", null, "uk-UA") })
.setRequired(true))
.addIntegerOption(option => option.setName("int")
.setDescription(client.translate("common:INT"))
.setDescriptionLocalizations({ "uk": client.translate("common:INT", null, "uk-UA") })
.setRequired(true)),
)
.addSubcommand(subcommand => subcommand.setName("add")
.setDescription(client.translate("owner/debug:ADD"))
.setDescriptionLocalizations({ "uk": client.translate("owner/debug:ADD", null, "uk-UA") })
.addStringOption(option => option.setName("type")
.setDescription(client.translate("owner/debug:TYPE"))
.setDescriptionLocalizations({ "uk": client.translate("owner/debug:TYPE", null, "uk-UA") })
.setRequired(true)
.addChoices(
.setChoices(
{ name: client.translate("common:LEVEL"), value: "level" },
{ name: client.translate("common:XP"), value: "xp" },
{ name: client.translate("common:CREDITS"), value: "credits" },
@ -45,9 +52,11 @@ class Debug extends BaseCommand {
))
.addUserOption(option => option.setName("user")
.setDescription(client.translate("common:USER"))
.setDescriptionLocalizations({ "uk": client.translate("common:USER", null, "uk-UA") })
.setRequired(true))
.addIntegerOption(option => option.setName("int")
.setDescription(client.translate("owner/debug:INT"))
.setDescription(client.translate("common:INT"))
.setDescriptionLocalizations({ "uk": client.translate("common:INT", null, "uk-UA") })
.setRequired(true)),
),
aliases: [],
@ -92,7 +101,7 @@ class Debug extends BaseCommand {
memberData.level = int;
await memberData.save();
return interaction.success(`owner/debug:SUCCESS_${type.toUpperCase()}`, {
username: member.toString(),
user: member.toString(),
amount: int,
}, { ephemeral: true });
}
@ -101,7 +110,7 @@ class Debug extends BaseCommand {
memberData.exp = int;
await memberData.save();
return interaction.success(`owner/debug:SUCCESS_${type.toUpperCase()}`, {
username: member.toString(),
user: member.toString(),
amount: int,
}, { ephemeral: true });
}
@ -110,7 +119,7 @@ class Debug extends BaseCommand {
memberData.money = int;
await memberData.save();
return interaction.success(`owner/debug:SUCCESS_${type.toUpperCase()}`, {
username: member.toString(),
user: member.toString(),
amount: int,
}, { ephemeral: true });
}
@ -119,7 +128,7 @@ class Debug extends BaseCommand {
memberData.bankSold = int;
await memberData.save();
return interaction.success(`owner/debug:SUCCESS_${type.toUpperCase()}`, {
username: member.toString(),
user: member.toString(),
amount: int,
}, { ephemeral: true });
}
@ -128,7 +137,7 @@ class Debug extends BaseCommand {
userData.rep = int;
await userData.save();
return interaction.success(`owner/debug:SUCCESS_${type.toUpperCase()}`, {
username: member.toString(),
user: member.toString(),
amount: int,
}, { ephemeral: true });
}
@ -153,7 +162,7 @@ class Debug extends BaseCommand {
memberData.level += int;
await memberData.save();
return interaction.success(`owner/debug:SUCCESS_${type.toUpperCase()}`, {
username: member.toString(),
user: member.toString(),
amount: int,
}, { ephemeral: true });
}
@ -162,7 +171,7 @@ class Debug extends BaseCommand {
memberData.exp += int;
await memberData.save();
return interaction.success(`owner/debug:SUCCESS_${type.toUpperCase()}`, {
username: member.toString(),
user: member.toString(),
amount: int,
}, { ephemeral: true });
}
@ -171,7 +180,7 @@ class Debug extends BaseCommand {
memberData.money += int;
await memberData.save();
return interaction.success(`owner/debug:SUCCESS_${type.toUpperCase()}`, {
username: member.toString(),
user: member.toString(),
amount: int,
}, { ephemeral: true });
}
@ -180,7 +189,7 @@ class Debug extends BaseCommand {
memberData.bankSold += int;
await memberData.save();
return interaction.success(`owner/debug:SUCCESS_${type.toUpperCase()}`, {
username: member.toString(),
user: member.toString(),
amount: int,
}, { ephemeral: true });
}
@ -189,7 +198,7 @@ class Debug extends BaseCommand {
userData.rep += int;
await userData.save();
return interaction.success(`owner/debug:SUCCESS_${type.toUpperCase()}`, {
username: member.toString(),
user: member.toString(),
amount: int,
}, { ephemeral: true });
}

View file

@ -11,9 +11,11 @@ class Eval extends BaseCommand {
command: new SlashCommandBuilder()
.setName("eval")
.setDescription(client.translate("owner/eval:DESCRIPTION"))
.setDescriptionLocalizations({ "uk": client.translate("owner/eval:DESCRIPTION", null, "uk-UA") })
.setDMPermission(true)
.addStringOption(option => option.setName("code")
.setDescription(client.translate("owner/eval:CODE"))
.setDescriptionLocalizations({ "uk": client.translate("owner/eval:CODE", null, "uk-UA") })
.setRequired(true)),
aliases: [],
dirname: __dirname,

View file

@ -13,10 +13,13 @@ class Reload extends BaseCommand {
command: new SlashCommandBuilder()
.setName("reload")
.setDescription(client.translate("owner/reload:DESCRIPTION"))
.setDescriptionLocalizations({ "uk": client.translate("owner/reload:DESCRIPTION", null, "uk-UA") })
.setDMPermission(true)
.addStringOption(option => option.setName("command")
.setDescription(client.translate("common:COMMAND"))
.setRequired(true)),
.setDescriptionLocalizations({ "uk": client.translate("common:COMMAND", null, "uk-UA") })
.setRequired(true)
.setAutocomplete(true)),
aliases: [],
dirname: __dirname,
ownerOnly: true,
@ -50,6 +53,24 @@ class Reload extends BaseCommand {
command: cmd.command.name,
}, { ephemeral: true });
}
/**
*
* @param {import("../../base/JaBa")} client
* @param {import("discord.js").AutocompleteInteraction} interaction
* @returns
*/
async autocompleteRun(client, interaction) {
const command = interaction.options.getString("command"),
results = client.commands.filter(c => c.command.name.includes(command));
return interaction.respond(
results.map(c => c).slice(0, 25).map(c => ({
name: c.command.name,
value: c.command.name,
}),
));
}
}
module.exports = Reload;

View file

@ -11,12 +11,15 @@ class Say extends BaseCommand {
command: new SlashCommandBuilder()
.setName("say")
.setDescription(client.translate("owner/say:DESCRIPTION"))
.setDescriptionLocalizations({ "uk": client.translate("owner/say:DESCRIPTION", null, "uk-UA") })
.setDMPermission(false)
.addStringOption(option => option.setName("message")
.setDescription(client.translate("common:MESSAGE"))
.setDescriptionLocalizations({ "uk": client.translate("common:MESSAGE", null, "uk-UA") })
.setRequired(true))
.addChannelOption(option => option.setName("channel")
.setDescription(client.translate("common:CHANNEL"))),
.setDescription(client.translate("common:CHANNEL"))
.setDescriptionLocalizations({ "uk": client.translate("common:CHANNEL", null, "uk-UA") })),
aliases: [],
dirname: __dirname,
ownerOnly: true,

View file

@ -11,6 +11,7 @@ class Servers extends BaseCommand {
command: new SlashCommandBuilder()
.setName("servers")
.setDescription(client.translate("owner/servers:DESCRIPTION"))
.setDescriptionLocalizations({ "uk": client.translate("owner/servers:DESCRIPTION", null, "uk-UA") })
.setDMPermission(true),
aliases: [],
dirname: __dirname,

View file

@ -1,3 +1,11 @@
### JaBa v4.2.1
* Добавлено
* Команда *volume* - установить громкость бота.
* Отправка сообщения при бане пользователя.
* Фильтрация сообщений в *clear* по ID или пользователю.
* Удаление спама если включён Автомод.
* Подсказки по командам на языке вашего клиента.
### JaBa v4.2.0
Я решил отказаться от своего модуля музыки в пользу основного, т.к. он был переписан авторами и теперь работает намного лучше.

View file

@ -41,8 +41,8 @@ class CommandHandler extends BaseEvent {
}
if (interaction.type !== InteractionType.ApplicationCommand && !interaction.isCommand()) return;
if (command.guildOnly && !interaction.inGuild()) return interaction.replyT("misc:GUILD_ONLY", { ephemeral: true });
if (command.ownerOnly && interaction.user.id !== client.config.owner.id) return interaction.replyT("misc:OWNER_ONLY", { ephemeral: true });
if (command.guildOnly && !interaction.inGuild()) return interaction.error("misc:GUILD_ONLY", null, { ephemeral: true });
if (command.ownerOnly && interaction.user.id !== client.config.owner.id) return interaction.error("misc:OWNER_ONLY", null, { ephemeral: true });
if (!userData.achievements.firstCommand.achieved) {
userData.achievements.firstCommand.progress.now = 1;

View file

@ -0,0 +1,32 @@
const { EmbedBuilder } = require("discord.js"),
BaseEvent = require("../../base/BaseEvent");
class guildBanAdd extends BaseEvent {
constructor() {
super({
name: "guildBanAdd",
once: false,
});
}
/**
*
* @param {import("../../base/JaBa")} client
* @param {import("discord.js").GuildBan} ban
*/
async execute(client, ban) {
const embed = new EmbedBuilder()
.setAuthor({
name: client.user.name,
iconURL: ban.guild.iconURL(),
})
.setColor("#FF0000")
.setDescription(`Вы были забанены на **${ban.guild.name}** по причине **${ban.reason || "Не указана"}**`);
ban.user.send({
embeds: [embed],
});
}
}
module.exports = guildBanAdd;

View file

@ -15,8 +15,6 @@ class GuildCreate extends BaseEvent {
* @param {import("discord.js").Guild} guild
*/
async execute(client, guild) {
const messageOptions = {};
const userData = await client.findOrCreateUser({
id: guild.ownerId,
});
@ -24,15 +22,11 @@ class GuildCreate extends BaseEvent {
if (!userData.achievements.invite.achieved) {
userData.achievements.invite.progress.now += 1;
userData.achievements.invite.achieved = true;
messageOptions.files = [{
name: "unlocked.png",
attachment: "./assets/img/achievements/achievement_unlocked7.png",
}];
userData.markModified("achievements.invite");
await userData.save();
}
const thanksEmbed = new EmbedBuilder()
const thanks = new EmbedBuilder()
.setAuthor({
name: "Спасибо что добавили меня на свой сервер!",
})
@ -42,10 +36,15 @@ class GuildCreate extends BaseEvent {
text: client.config.embed.footer,
})
.setTimestamp();
messageOptions.embeds = [thanksEmbed];
const owner = await guild.fetchOwner();
owner.send(messageOptions);
owner.send({
files: [{
name: "unlocked.png",
attachment: "./assets/img/achievements/achievement_unlocked7.png",
}],
embeds: [thanks],
});
const users = guild.members.cache.filter(m => !m.user.bot).size;
const bots = guild.members.cache.filter(m => m.user.bot).size;

View file

@ -20,7 +20,7 @@ class GuildDelete extends BaseEvent {
name: guild.name,
iconURL: guild.iconURL(),
})
.setColor("#B22222")
.setColor("#FF0000")
.setDescription(`Вышел с сервера **${guild.name}**.`);
client.channels.cache.get(client.config.support.logs).send({
embeds: [embed],

View file

@ -1,6 +1,9 @@
const { PermissionsBitField } = require("discord.js");
const BaseEvent = require("../base/BaseEvent"),
xpCooldown = {};
xpCooldown = {},
usersMap = new Map(),
messageLimit = 10,
timeDifferenceMs = 5000;
class MessageCreate extends BaseEvent {
constructor() {
@ -50,7 +53,7 @@ class MessageCreate extends BaseEvent {
if (/(discord\.(gg|io|me|li)\/.+|discordapp\.com\/invite\/.+)/i.test(message.content))
if (!message.channel.permissionsFor(message.member).has(PermissionsBitField.Flags.ManageMessages)) {
message.delete();
return message.error("administration/automod:DELETED");
message.error("administration/automod:DELETED");
}
const afkReason = data.userData.afk;
@ -58,7 +61,7 @@ class MessageCreate extends BaseEvent {
data.userData.afk = null;
await data.userData.save();
message.replyT("general/afk:DELETED", {
username: message.author.username,
user: message.author.username,
}, { mention: true });
}
@ -66,9 +69,53 @@ class MessageCreate extends BaseEvent {
const userData = await client.findOrCreateUser({
id: u.id,
});
if (userData.afk) message.error("general/afk:IS_AFK", { user: u.tag, reason: userData.afk });
if (userData.afk) message.replyT("general/afk:IS_AFK", { user: u.tag, reason: userData.afk }, { ephemeral: true });
});
}
if (data.guildData.plugins.automod.enabled)
if (usersMap.has(message.author.id)) {
let msgCount = userData.msgCount;
const userData = usersMap.get(message.author.id),
{ lastMessage, timer } = userData,
difference = message.createdTimestamp - lastMessage.createdTimestamp;
if (difference > timeDifferenceMs) {
clearTimeout(timer);
userData.msgCount = 1;
userData.lastMessage = message;
userData.timer = setTimeout(() => {
usersMap.delete(message.author.id);
}, 1000);
usersMap.set(message.author.id, userData);
} else {
++msgCount;
if (parseInt(msgCount) === messageLimit) {
message.replyT("administration/automod:");
let messages = await message.channel.messages.fetch({
limit: messageLimit,
});
messages = messages.filter(m => m.author.id === message.user.id);
message.channel.bulkDelete(messages.filter(m => !m.pinned), true);
} else {
userData.msgCount = msgCount;
usersMap.set(message.author.id, userData);
}
}
} else {
const fn = setTimeout(() => {
usersMap.delete(message.author.id);
}, 1000);
usersMap.set(message.author.id, {
msgCount: 1,
lastMessage: message,
timer: fn,
});
}
return;
}
}

View file

@ -1,9 +1,10 @@
{
"DESCRIPTION": "Включить или отключить автоудаление ссылок-приглашений",
"DESCRIPTION": "Включить или отключить автоудаление спама и ссылок-приглашений",
"USAGE": "[state] (#channel)",
"EXAMPLES": "automod state:True\nautomod state:False channel:#general\nautomod state:False",
"ENABLED": "Ссылки-приглашения будут удаляться автоматически\nИспользуйте `automod false #channel` для игнорирования канала!",
"DISABLED_CHANNEL": "Автомодерация не будет выполняться в {{channel}}!",
"DISABLED": "Автомодерация отключена!",
"DELETED": "Ваше сообщение было удалено, т.к. содержало в себе ссылку-приглашение!"
"ENABLED": "Ссылки-приглашения будут удаляться автоматически\nИспользуйте `automod false #channel` для игнорирования канала",
"DISABLED_CHANNEL": "Автомодерация не будет выполняться в {{channel}}",
"DISABLED": "Автомодерация отключена",
"DELETED": "Ваше сообщение было удалено, т.к. содержало в себе ссылку-приглашение",
"NO_SPAM": "Прекратите спамить!"
}

View file

@ -2,7 +2,7 @@
"DESCRIPTION": "Включить или отключить автоназначение роли при входе на сервер",
"USAGE": "[state] (@role)",
"EXAMPLES": "autorole state:True role:@новенький\nautorole state:False",
"MISSING_ROLE": "Укажите роль!",
"SUCCESS_ENABLED": "Автоназначение роли включено!\nНовые пользователи будут автоматически получать {{role}} при входе на сервер.",
"SUCCESS_DISABLED": "Автоназначение роли отключено!"
"MISSING_ROLE": "Укажите роль",
"SUCCESS_ENABLED": "Автоназначение роли включено!\nНовые пользователи будут автоматически получать {{role}} при входе на сервер",
"SUCCESS_DISABLED": "Автоназначение роли отключено"
}

View file

@ -19,14 +19,14 @@
"AUTOMOD_TITLE": "Автомодерация",
"AUTOROLE_TITLE": "Автоназначение роли при входе",
"AUTO_SANCTIONS": "Автоматические наказания",
"BAN_CONTENT": "Бан: После **{{count}}** предупреждений.",
"BAN_NOT_DEFINED": "Бан: Не назначено.",
"DASHBOARD_CONTENT": "Нажмите сюда, чтобы перейти в панель управления!",
"BAN_CONTENT": "Бан: После **{{count}}** предупреждений",
"BAN_NOT_DEFINED": "Бан: Не назначено",
"DASHBOARD_CONTENT": "Нажмите сюда, чтобы перейти в панель управления",
"DASHBOARD_TITLE": "Изменить настройки",
"GOODBYE_CONTENT": "Канал: {{channel}}\nКарточка: {{withImage}}",
"GOODBYE_TITLE": "Прощание",
"KICK_CONTENT": "Кик: После **{{count}}** предупреждений.",
"KICK_NOT_DEFINED": "Кик: Не назначено.",
"KICK_CONTENT": "Кик: После **{{count}}** предупреждений",
"KICK_NOT_DEFINED": "Кик: Не назначено",
"LIST": "Показать настройки сервера",
"SET": "Изменить настройки сервера",
"SETTING": "Параметр",

View file

@ -2,6 +2,6 @@
"DESCRIPTION": "Включить или отключить автоудаление команд модерации",
"USAGE": "[state]",
"EXAMPLES": "deletemod state:True\ndeletemod state:False",
"ENABLED": "Автоудаление команд модерации включено!",
"DISABLED": "Автоудаление команд модерации отключено!"
"ENABLED": "Автоудаление команд модерации включено",
"DISABLED": "Автоудаление команд модерации отключено"
}

View file

@ -3,13 +3,13 @@
"USAGE": "config [state] [#channel] [message] [image] \nИли [test]",
"EXAMPLES": "goodbye state:True channel:#welcome Прощай! image:True\ngoodbye test",
"TEST": "Проверить",
"TEST_SUCCESS": "Тест выполнен...",
"TEST_SUCCESS": "Тест выполнен",
"CONFIG": "Настроить",
"IMAGE": "Добавить карточку к сообщению?",
"MESSAGE": "Ваше сообщение (доступны подмены с помощью {user}, {server} и {membercount})",
"ENABLED": "Прощальные сообщения включены в {{channel}}!\nИспользуйте `goodbye test` для просмотра сообщения!",
"DISABLED": "Прощальные сообщения отключены!",
"ENABLED": "Прощальные сообщения включены в {{channel}}!\nИспользуйте `goodbye test` для просмотра сообщения",
"DISABLED": "Прощальные сообщения отключены",
"DEFAULT_MESSAGE": "Пока, {user}! Нас теперь {membercount} без тебя :'(",
"IMG_GOODBYE": "Вышел с {{server}}!",
"IMG_GOODBYE": "Вышел с {{server}}",
"TITLE": "До встречи!"
}

View file

@ -2,5 +2,5 @@
"DESCRIPTION": "Изменить язык бота на сервере",
"USAGE": "[language]",
"EXAMPLES": "setlang language:Русский",
"SUCCESS": ":flag_ru: Язык сервера изменён на **{{lang}}**!"
"SUCCESS": ":flag_ru: Язык сервера изменён на **{{lang}}**"
}

View file

@ -2,6 +2,6 @@
"DESCRIPTION": "Скопировать эмодзи на текущий сервер",
"USAGE": "[emoji]",
"EXAMPLES": "stealemoji emoji::coolstorybob:",
"SUCCESS": "{{emoji}} добавлен!",
"SUCCESS": "{{emoji}} добавлен",
"ERROR": "Произошла ошибка при добавлении {{emoji}}.\n```{{e}}```"
}

View file

@ -2,9 +2,9 @@
"DESCRIPTION": "Включить или отключить сообщения при входе пользователя на сервер",
"USAGE": "config [state] [#channel] [message] [image] \nИли [test]",
"EXAMPLES": "welcome state:True channel:#welcome Добро пожаловать! image:True\nwelcome test",
"ENABLED": "Приветствующие сообщения включены в {{channel}}!\nИспользуйте `welcome test` для просмотра сообщения!",
"DISABLED": "Приветствующие сообщения отключены!",
"DEFAULT_MESSAGE": "Добро пожаловать {user}! Нас теперь {membercount}!",
"IMG_WELCOME": "Добро пожаловать на {{server}}!",
"ENABLED": "Приветствующие сообщения включены в {{channel}}!\nИспользуйте `welcome test` для просмотра сообщения",
"DISABLED": "Приветствующие сообщения отключены",
"DEFAULT_MESSAGE": "Добро пожаловать {user}! Нас теперь {membercount}",
"IMG_WELCOME": "Добро пожаловать на {{server}}",
"TITLE": "Добро пожаловать!"
}

View file

@ -2,13 +2,13 @@
"DESCRIPTION": "Показать список достижений пользователя",
"USAGE": "(@user)",
"EXAMPLES": "achievements\nachievements user:@Jonny_Bro#4226",
"SEND_CMD": "Используйте свою первую команду!",
"CLAIM_SALARY": "Получите зарплату 10 раз!",
"MARRY": "Найдите вторую половинку и женитесь!",
"SLOTS": "Выиграйте 3 раза подряд в слоты!",
"TIP": "Поддержите разработчика!",
"REP": "Достигните 20 очков репутации!",
"INVITE": "Пригласите JaBa на ваш сервер!",
"SEND_CMD": "Используйте свою первую команду",
"CLAIM_SALARY": "Получите зарплату 10 раз",
"MARRY": "Найдите вторую половинку",
"SLOTS": "Выиграйте 3 раза подряд в слоты",
"TIP": "Поддержите разработчика",
"REP": "Достигните 20 очков репутации",
"INVITE": "Пригласите JaBa на ваш сервер",
"TITLE": "🔥 Достижения",
"PROGRESS": "Прогресс: {{now}}/{{total}} ({{percent}}%)"
}

View file

@ -5,8 +5,8 @@
"OPTION": "Действие",
"DEPOSIT": "Внести",
"WITHDRAW": "Снять",
"NOT_ENOUGH_CREDIT": "У вас нет {{money}}!",
"NOT_ENOUGH_BANK": "Недостаточно кредитов на банковском счету, необходимо {{money}}!",
"SUCCESS_DEP": "{{money}} внесено на ваш банковский счёт!",
"NOT_ENOUGH_CREDIT": "У вас нет {{money}}",
"NOT_ENOUGH_BANK": "Недостаточно кредитов на банковском счету, необходимо {{money}}",
"SUCCESS_DEP": "{{money}} внесено на ваш банковский счёт",
"SUCCESS_WD": "Вы сняли {{money}} с вашего банковского счёта"
}

View file

@ -6,8 +6,8 @@
"MONTH": "Месяц",
"YEAR": "Год",
"DATE_TOO_LOW": "Вам больше 80 лет? :eyes:",
"DATE_TOO_HIGH": "Хммм... Вы ещё не родились!",
"DATE_TOO_HIGH": "Хммм... Вы ещё не родились",
"HAPPY_BIRTHDAY": "День рождения",
"HAPPY_BIRTHDAY_MESSAGE": "Поздравляем {{name}} (<@{{user}}>) с днём рождения, сегодня ему(ей) исполнилось {{age}}!",
"SUCCESS": "Ваша дата рождения установлена на **{{date}}**!"
"SUCCESS": "Ваша дата рождения установлена на **{{date}}**"
}

View file

@ -2,7 +2,7 @@
"DESCRIPTION": "Развестись с пользователем",
"USAGE": "",
"EXAMPLES": "divorce",
"NOT_MARRIED": "Вы не состоите в браке!",
"DIVORCED": "Вы развелись с {{user}}!",
"DIVORCED_U": "{{user}} развёлся с вами!"
"NOT_MARRIED": "Вы не состоите в браке",
"DIVORCED": "Вы развелись с {{user}}",
"DIVORCED_U": "{{user}} развёлся с вами"
}

View file

@ -5,6 +5,6 @@
"LEVEL": "Уровень",
"MONEY": "Кредиты",
"REP": "Репутация",
"MOBILE": ":confused: Я заметил, что вы онлайн с телефона... Таблица лидеров может отображаться некорректно на маленьких экранах. Попробуйте позже с другого устройства!",
"MOBILE": ":confused: Я заметил, что вы онлайн с телефона... Таблица лидеров может отображаться некорректно на маленьких экранах. Попробуйте позже с другого устройства",
"TABLE": "Таблица лидеров {{name}}"
}

View file

@ -2,15 +2,15 @@
"DESCRIPTION": "Женитесь на том, кого любите",
"USAGE": "[@user]",
"EXAMPLES": "marry user:@Jonny_Bro#4226",
"ALREADY_MARRIED": "Вы уже состоите в браке! Вы можете развестить с помощью команды `divorce`.",
"ALREADY_MARRIED_USER": "Вы опоздали! {{user}} уже состоит в браке!",
"YOURSELF": "Вы не можете жениться на себе!",
"REQUEST_AUTHOR_TO_AMEMBER": "Вы уже отправили предложение {{user}}!",
"REQUEST_AMEMBER_TO_AUTHOR": "{{user}} отправил(а) вам предложение! Вы можете отказать или согласиться (либо дождаться истечения срока предложения).",
"REQUEST_AMEMBER_TO_MEMBER": "{{secondUser}} уже отправил(а) предложение {{firstUser}}!",
"REQUEST_MEMBER_TO_AMEMBER": "{{firstUser}} уже отправил(а) предложение {{secondUser}}! Подождите пока {{secondUser}} согласиться или откажет на предложение {{firstUser}} (либо дождитесь истечения срока предложения)!",
"ALREADY_MARRIED": "Вы уже состоите в браке! Вы можете развестить с помощью команды `divorce`",
"ALREADY_MARRIED_USER": "Вы опоздали! {{user}} уже состоит в браке",
"YOURSELF": "Вы не можете жениться на себе",
"REQUEST_AUTHOR_TO_AMEMBER": "Вы уже отправили предложение {{user}}",
"REQUEST_AMEMBER_TO_AUTHOR": "{{user}} отправил(а) вам предложение! Вы можете отказать или согласиться (либо дождаться истечения срока предложения)",
"REQUEST_AMEMBER_TO_MEMBER": "{{secondUser}} уже отправил(а) предложение {{firstUser}}",
"REQUEST_MEMBER_TO_AMEMBER": "{{firstUser}} уже отправил(а) предложение {{secondUser}}! Подождите пока {{secondUser}} согласиться или откажет на предложение {{firstUser}} (либо дождитесь истечения срока предложения)",
"REQUEST": "{{to}}, вы согласны вступить в брак с {{from}}?",
"DENIED": "{{creator}}, у меня есть плохие новости... {{partner}} отказался(лась) от вашего предложение.",
"SUCCESS": "🎉 Поздравляем! **{{creator}}** и **{{partner}}** теперь состоят в браке!",
"DENIED": "{{creator}}, у меня есть плохие новости... {{partner}} отказался(лась) от вашего предложение",
"SUCCESS": "🎉 Поздравляем! **{{creator}}** и **{{partner}}** теперь состоят в браке",
"BOT_USER": "Боты вечно одиноки ;("
}

View file

@ -2,6 +2,6 @@
"DESCRIPTION": "Показать количество кредитов у пользователя",
"USAGE": "(@user)",
"EXAMPLES": "money\nmoney user:@Jonny_Bro#4226",
"BOT_USER": "Никто не знает сколько у ботов денег...",
"TITLE": "Кредиты {{username}}"
"BOT_USER": "У него слишком много денег, я не могу вывести это число",
"TITLE": "Кредиты {{user}}"
}

View file

@ -2,11 +2,11 @@
"DESCRIPTION": "Угадай загаданное мною число",
"USAGE": "",
"EXAMPLES": "number",
"GAME_START": "Я загадал число, начинайте!\nНапишите STOP, если хотите остановить игру!",
"TOO_BIG": "{{user}}, моё число **больше** чем `{{number}}`!",
"TOO_SMALL": "{{user}}, моё число **меньше** чем `{{number}}`!",
"WON": "{{winner}} выиграл {{credits}}!",
"DEFEAT": "Никто не угадал число! Им было **{{number}}**!",
"GAME_START": "Я загадал число, начинайте!\nНапишите STOP, если хотите остановить игру",
"TOO_BIG": "{{user}}, моё число **больше** чем `{{number}}`",
"TOO_SMALL": "{{user}}, моё число **меньше** чем `{{number}}`",
"WON": "{{winner}} выиграл {{credits}}",
"DEFEAT": "Никто не угадал число! Им было **{{number}}**",
"GAME_STATS": "🎉 | {{winner}} угадал число! Им было **{{number}}**!\n\n**Статистика:**\n*-* __**Длительность**__: {{time}}\n*-* __**Участники ({{participantCount}})**__: {{participants}}",
"GAME_RUNNING": "Игра уже идёт!"
"GAME_RUNNING": "Игра уже идёт"
}

View file

@ -2,8 +2,8 @@
"DESCRIPTION": "Отправить кредиты пользователю",
"USAGE": "[@user] [amount]",
"EXAMPLES": "pay user:@Jonny_Bro#4226 amount:1000",
"BOT_USER": "Ботам не нужны деньги B)!",
"YOURSELF": "Вы не можете перевести кредиты самому себе!",
"BOT_USER": "Ботам не нужны деньги B)",
"YOURSELF": "Вы не можете перевести кредиты самому себе",
"INVALID_AMOUNT": "Укажите сумму",
"ENOUGH_MONEY": "У вас нет {{amount}}",
"SUCCESS": "Вы отправили {{user}} {{amount}}!"

View file

@ -2,10 +2,10 @@
"DESCRIPTION": "Показать профиль пользователя",
"USAGE": "(@user)",
"EXAMPLES": "profile\nprofile user:@Jonny_Bro#4226",
"BOT_USER": "У ботов нет профиля!",
"BOT_USER": "У ботов нет профиля",
"TITLE": "Профиль {{user}}",
"LINK": "Профиль",
"LINK_TEXT": "Нажмите сюда, чтобы открыть профиль текущего сервера в панели управления!",
"LINK_TEXT": "Нажмите сюда, чтобы открыть профиль текущего сервера в панели управления",
"BIO": "🔖 Биография",
"CASH": "💵 Кредиты",
"BANK": "💳 Банк",
@ -17,5 +17,5 @@
"LOVER": "❤ Вторая половинка",
"REGISTERED": "📅 Профиль создан",
"ACHIEVEMENTS": "🔥 Достижения",
"ACHIEVEMENTS_CONTENT": "Получите больше информации с помощью `achievements`!"
"ACHIEVEMENTS_CONTENT": "Получите больше информации с помощью `achievements`"
}

Some files were not shown because too many files have changed in this diff Show more