This commit is contained in:
JonnyBro 2022-08-08 18:19:56 +05:00
parent f2da9a27a0
commit b258fbf6e6
86 changed files with 1137 additions and 1006 deletions

View file

@ -20,7 +20,7 @@ class Marry extends Command {
} }
async run(message, args, data) { async run(message, args, data) {
if (data.userData.lover) return message.error("economy/marry:ALREADY_MARRIED", { prefix: data.guild.prefix }); if (data.userData.lover) return message.error("economy/marry:ALREADY_MARRIED", { prefix: data.guildData.prefix });
const member = await this.client.resolveMember(args[0], message.guild); const member = await this.client.resolveMember(args[0], message.guild);
if (!member) return message.error("economy/marry:INVALID_MEMBER"); if (!member) return message.error("economy/marry:INVALID_MEMBER");

View file

@ -54,7 +54,7 @@ class Number extends Command {
participants: participants.map(p => `<@${p}>`).join(", ") participants: participants.map(p => `<@${p}>`).join(", ")
}); });
if (participants.length > 1 && data.guild.disabledCategories && !data.guild.disabledCategories.includes("Economy")) { if (participants.length > 1 && data.guildData.disabledCategories && !data.guildData.disabledCategories.includes("Economy")) {
const won = 100 * (participants.length * 0.5); const won = 100 * (participants.length * 0.5);
message.sendT("economy/number:WON", { message.sendT("economy/number:WON", {

View file

@ -119,7 +119,7 @@ class Profile extends Command {
{ {
name: message.translate("economy/profile:ACHIEVEMENTS"), name: message.translate("economy/profile:ACHIEVEMENTS"),
value: message.translate("economy/profile:ACHIEVEMENTS_CONTENT", { value: message.translate("economy/profile:ACHIEVEMENTS_CONTENT", {
prefix: data.guild.prefix prefix: data.guildData.prefix
}) })
} }
]) ])

13
.gitignore vendored
View file

@ -1,25 +1,18 @@
# Bot Configuration # Bot Configuration
config.js /config.js
# DB # DB
giveaways.json /giveaways.json
# Backups
backups
# commands.md # commands.md
**/commands.md **/commands.md
# Clips # Clips
clips /clips
# Mac OS files # Mac OS files
.DS_Store .DS_Store
# PM2
report*.json
!languages/**/general/report.json
# IDE # IDE
.vscode .vscode

View file

@ -1,38 +0,0 @@
const Command = require("../../base/Command");
class Addemoji extends Command {
constructor(client) {
super(client, {
name: "addemoji",
dirname: __dirname,
enabled: true,
guildOnly: true,
aliases: ["adde"],
memberPermissions: ["MANAGE_GUILD"],
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS"],
nsfw: false,
ownerOnly: false,
cooldown: 1000
});
}
async run(message, args) {
const url = args[0];
if (!url) return message.error("administration/addemoji:MISSING_URL");
const name = args[1] ? args[1].replace(/[^a-z0-9]/gi, "") : null;
if (!name) return message.error("administration/addemoji:MISSING_NAME");
if (name.length < 2 || name.length > 32) return message.error("administration/addemoji:INVALID_NAME");
message.guild.emojis
.create(url, name)
.then(emoji => message.success("administration/addemoji:SUCCESS", {
emoji: emoji.name
}))
.catch(() => message.error("administration/addemoji:ERROR", {
emoji: name
}));
}
}
module.exports = Addemoji;

View file

@ -1,55 +0,0 @@
const Command = require("../../base/Command");
class Automod extends Command {
constructor(client) {
super(client, {
name: "automod",
dirname: __dirname,
enabled: true,
guildOnly: true,
aliases: ["autom"],
memberPermissions: ["MANAGE_GUILD"],
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS"],
nsfw: false,
ownerOnly: false,
cooldown: 1000
});
}
async run(message, args, data) {
const status = args[0];
if (!status || (status !== "on" && status !== "off")) return message.error("administration/automod:MISSING_STATUS");
if (status === "on") {
data.guild.plugins.automod = {
enabled: true,
ignored: []
};
data.guild.markModified("plugins.automod");
data.guild.save();
message.success("administration/automod:ENABLED", {
prefix: data.guild.prefix
});
} else if (status === "off") {
if (message.mentions.channels.filter((ch) => ch.type === "GUILD_TEXT" && ch.guild.id === message.guild.id).first()) {
const channel = message.mentions.channels.first();
data.guild.plugins.automod.ignored.push(channel);
data.guild.markModified("plugins.automod");
data.guild.save();
message.success("administration/automod:DISABLED_CHANNEL", {
channel: channel.toString()
});
} else {
data.guild.plugins.automod = {
enabled: false,
ignored: []
};
data.guild.markModified("plugins.automod");
data.guild.save();
message.success("administration/automod:DISABLED");
}
}
}
}
module.exports = Automod;

View file

@ -1,59 +0,0 @@
const Command = require("../../base/Command");
class Autorole extends Command {
constructor(client) {
super(client, {
name: "autorole",
dirname: __dirname,
enabled: true,
guildOnly: true,
aliases: ["autor"],
memberPermissions: ["MANAGE_GUILD"],
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS"],
nsfw: false,
ownerOnly: false,
cooldown: 1000
});
}
async run(message, args, data) {
const status = args[0];
if (status !== "on" && status !== "off") return message.error("administration/autorole:MISSING_STATUS");
if (status === "on") {
const role = await Resolvers.resolveRole({
message,
search: args.slice(1).join(" ")
});
if (!role) return message.error("administration/autorole:MISSING_ROLE");
data.guild.plugins.autorole = {
enabled: true,
role: role.id
};
data.guild.markModified("plugins.autorole");
await data.guild.save();
message.success("administration/autorole:SUCCESS_ENABLED", {
roleName: role.name
});
} else if (status === "off") {
if (!data.guild.plugins.autorole.enabled) return message.success("administration/autorole:ALREADY_DISABLED", {
prefix: data.guild.prefix
});
data.guild.plugins.autorole = {
enabled: false,
role: null
};
data.guild.markModified("plugins.autorole");
await data.guild.save();
message.success("administration/autorole:SUCCESS_DISABLED", {
prefix: data.guild.prefix
});
}
}
}
module.exports = Autorole;

View file

@ -1,103 +0,0 @@
const Command = require("../../base/Command"),
Discord = require("discord.js");
class Configuration extends Command {
constructor(client) {
super(client, {
name: "configuration",
dirname: __dirname,
enabled: true,
guildOnly: true,
aliases: ["conf", "config"],
memberPermissions: ["MANAGE_GUILD"],
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS"],
nsfw: false,
ownerOnly: false,
cooldown: 2000
});
}
async run(message, args, data) {
const guildData = data.guild;
const embed = new Discord.EmbedBuilder()
.setAuthor({
name: message.guild.name,
iconURL: message.guild.iconURL()
})
.setColor(data.config.embed.color)
.setFooter({
text: data.config.embed.footer
});
embed.addFields([
{ // Ignored channels
name: message.translate("administration/configuration:IGNORED_CHANNELS_TITLE"),
value: guildData.ignoredChannels.length > 0 ? guildData.ignoredChannels.map((ch) => `<#${ch}>`).join(", ") : message.translate("administration/configuration:NO_IGNORED_CHANNELS")
},
{ // Autorole plugin
name: message.translate("administration/configuration:AUTOROLE_TITLE"),
value: guildData.plugins.autorole.enabled ? message.translate("administration/configuration:AUTOROLE_CONTENT", {
roleName: `<@&${guildData.plugins.autorole.role}>`
}) : message.translate("administration/configuration:AUTOROLE_DISABLED")
},
{ // Welcome plugin
name: message.translate("administration/configuration:WELCOME_TITLE"),
value: guildData.plugins.welcome.enabled ? message.translate("administration/configuration:WELCOME_CONTENT", {
channel: `<#${guildData.plugins.welcome.channel}>`,
withImage: guildData.plugins.welcome.withImage ? message.translate("common:YES") : message.translate("common:NO")
}) : message.translate("administration/configuration:WELCOME_DISABLED")
},
{ // Goodbye plugin
name: message.translate("administration/configuration:GOODBYE_TITLE"),
value: guildData.plugins.goodbye.enabled ? message.translate("administration/configuration:GOODBYE_CONTENT", {
channel: `<#${guildData.plugins.goodbye.channel}>`,
withImage: guildData.plugins.goodbye.withImage ? message.translate("common:YES") : message.translate("common:NO")
}) : message.translate("administration/configuration:GOODBYE_DISABLED")
},
{ // Special channels
name: message.translate("administration/configuration:SPECIAL_CHANNELS"),
value: message.translate("administration/configuration:SUGGESTIONS", {
channel: guildData.plugins.suggestions ? `<#${guildData.plugins.suggestions}>` : message.translate("common:NOT_DEFINED")
}) + "\n" +
message.translate("administration/configuration:REPORTS", {
channel: guildData.plugins.reports ? `<#${guildData.plugins.reports}>` : message.translate("common:NOT_DEFINED")
}) + "\n" +
message.translate("administration/configuration:MODLOGS", {
channel: guildData.plugins.modlogs ? `<#${guildData.plugins.modlogs}>` : message.translate("common:NOT_DEFINED")
}) + "\n" +
message.translate("administration/configuration:BIRTHDAYS", {
channel: guildData.plugins.birthdays ? `<#${guildData.plugins.birthdays}>` : message.translate("common:NOT_DEFINED")
})
},
{ // Auto sanctions
name: message.translate("administration/configuration:AUTO_SANCTIONS"),
value: (guildData.plugins.warnsSanctions.kick ? message.translate("administration/configuration:KICK_CONTENT", {
count: guildData.plugins.warnsSanctions.kick
}) : message.translate("administration/configuration:KICK_NOT_DEFINED")) + "\n" + (guildData.plugins.warnsSanctions.ban ? message.translate("administration/configuration:BAN_CONTENT", {
count: guildData.plugins.warnsSanctions.ban
}) : message.translate("administration/configuration:BAN_NOT_DEFINED"))
},
{ // Automod plugin
name: message.translate("administration/configuration:AUTOMOD_TITLE"),
value: guildData.plugins.automod.enabled ? message.translate("administration/configuration:AUTOMOD_CONTENT", {
channels: guildData.plugins.automod.ignored.map((ch) => `<#${ch}>`)
}) : message.translate("administration/configuration:AUTOMOD_DISABLED")
},
{ // Auto-delete mod commands
name: message.translate("administration/configuration:AUTODELETEMOD"),
value: guildData.autoDeleteModCommands ? message.translate("administration/configuration:AUTODELETEMOD_ENABLED") : message.translate("administration/configuration:AUTODELETEMOD_DISABLED")
},
{ // Dashboard link
name: message.translate("administration/configuration:DASHBOARD_TITLE"),
value: `[${message.translate("administration/configuration:DASHBOARD_CONTENT")}](${data.config.dashboard.baseURL})`
}
]);
message.reply({
embeds: [embed]
});
}
}
module.exports = Configuration;

View file

@ -1,35 +0,0 @@
const Command = require("../../base/Command");
class Deletemod extends Command {
constructor(client) {
super(client, {
name: "deletemod",
dirname: __dirname,
enabled: true,
guildOnly: true,
aliases: ["delm"],
memberPermissions: ["MANAGE_MESSAGES"],
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS"],
nsfw: false,
ownerOnly: false,
cooldown: 1000
});
}
async run(message, args, data) {
const status = args[0];
if (!status || status !== "on" && status !== "off") return message.error("administration/deletemod:MISSING_STATUS");
if (status === "on") {
data.guild.autoDeleteModCommands = true;
data.guild.save();
message.success("administration/deletemod:ENABLED");
} else {
data.guild.autoDeleteModCommands = false;
data.guild.save();
message.success("administration/deletemod:DISABLED");
}
}
}
module.exports = Deletemod;

View file

@ -1,107 +0,0 @@
const Command = require("../../base/Command");
class Goodbye extends Command {
constructor(client) {
super(client, {
name: "goodbye",
dirname: __dirname,
enabled: true,
guildOnly: true,
aliases: ["gb"],
memberPermissions: ["MANAGE_GUILD"],
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS"],
nsfw: false,
ownerOnly: false,
cooldown: 1000
});
}
async run(message, args, data) {
if (args[0] === "test" && data.guild.plugins.goodbye.enabled) {
this.client.emit("guildMemberRemove", message.member);
return message.success("administration/goodbye:TEST_SUCCESS");
}
if ((!args[0] || !["edit", "off"].includes(args[0])) && data.guild.plugins.goodbye.enabled) return message.error("administration/goodbye:MISSING_STATUS");
if (args[0] === "off") {
data.guild.plugins.goodbye = {
enabled: false,
message: null,
channelID: null,
withImage: null
};
data.guild.markModified("plugins.goodbye");
data.guild.save();
return message.error("administration/goodbye:DISABLED", {
prefix: data.guild.prefix
});
} else {
const goodbye = {
enabled: true,
channel: null,
message: null,
withImage: null,
};
message.sendT("administration/goodbye:FORM_1", {
author: message.author.toString()
});
const filter = m => m.author.id === message.author.id;
const collector = message.channel.createMessageCollector({
filter,
time: 120000 // 2 minutes
});
collector.on("collect", async msg => {
// If the message is filled, it means the user sent yes or no for the image
if (goodbye.message) {
if (msg.content.toLowerCase() === message.translate("common:YES").toLowerCase()) goodbye.withImage = true;
else if (msg.content.toLowerCase() === message.translate("common:NO").toLowerCase()) goodbye.withImage = false;
else return message.error("misc:INVALID_YES_NO");
data.guild.plugins.goodbye = goodbye;
data.guild.markModified("plugins.goodbye");
await data.guild.save();
message.sendT("administration/goodbye:FORM_SUCCESS", {
prefix: data.guild.prefix,
channel: `<#${goodbye.channel}>`
});
return collector.stop();
}
// If the channel is filled and the message is not, it means the user sent the message
if (goodbye.channel && !goodbye.message) {
if (msg.content.length < 1800) {
goodbye.message = msg.content;
return message.sendT("administration/goodbye:FORM_3");
}
return message.error("administration/goodbye:MAX_CHARACT");
}
// If the channel is not filled, it means the user sent it
if (!goodbye.channel) {
const channel = await Resolvers.resolveChannel({
message: msg,
channelType: "GUILD_TEXT"
});
if (!channel) return message.error("misc:INVALID_CHANNEL");
goodbye.channel = channel.id;
return message.sendT("administration/goodbye:FORM_2", {
channel: channel.toString(),
author: msg.author.tag,
memberCount: msg.guild.memberCount
});
}
});
collector.on("end", (_, reason) => {
if (reason === "time") return message.error("misc:TIMES_UP");
});
}
}
}
module.exports = Goodbye;

View file

@ -1,57 +0,0 @@
const Command = require("../../base/Command");
class Set extends Command {
constructor(client) {
super(client, {
name: "set",
dirname: __dirname,
enabled: true,
guildOnly: true,
aliases: [],
memberPermissions: ["MANAGE_GUILD"],
botPermissions: ["SEND_MESSAGES"],
nsfw: false,
ownerOnly: false,
cooldown: 2000
});
}
async run(message, args) {
const status = args[0];
if (!status || !["level", "xp", "credits", "bank"].includes(status)) return message.error("administration/set:NO_STATUS");
const member = await this.client.resolveMember(args[1], message.guild);
if (!member) return message.error("administration/set:INVALID_MEMBER");
if (member.user.bot) return message.error("administration/set:BOT_USER");
const number = args[2];
if (!number || isNaN(number) || parseInt(number, 10) < 0) return message.error("administration/set:INVALID_AMOUNT");
const amount = Math.ceil(parseInt(number, 10));
const memberData = await this.client.findOrCreateMember({
id: member.id,
guildID: message.guild.id
});
if (status === "level") {
memberData.level = parseInt(amount, 10);
memberData.save();
} else if (status === "xp") {
memberData.exp = parseInt(amount, 10);
memberData.save();
} else if (status === "credits") {
memberData.money = parseInt(amount, 10);
memberData.save();
} else if (status === "bank") {
memberData.bankSold = parseInt(amount, 10);
memberData.save();
}
message.success("administration/set:SUCCESS_" + status.toUpperCase(), {
username: member.user.tag,
amount
});
}
}
module.exports = Set;

View file

@ -1,44 +0,0 @@
const Command = require("../../base/Command");
class Setbirthdays extends Command {
constructor(client) {
super(client, {
name: "setbirthdays",
dirname: __dirname,
enabled: true,
guildOnly: true,
aliases: ["setb"],
memberPermissions: ["MANAGE_GUILD"],
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS"],
nsfw: false,
ownerOnly: false,
cooldown: 1000
});
}
async run(message, args, data) {
const areBirthdaysEnabled = Boolean(data.guild.plugins.birthdays);
const sentChannel = await Resolvers.resolveChannel({
message,
search: args.join(" "),
channelType: "GUILD_TEXT"
});
if (!sentChannel && areBirthdaysEnabled) {
data.guild.plugins.birthdays = null;
data.guild.markModified("plugins.birthdays");
await data.guild.save();
return message.success("administration/setbirthdays:DISABLED");
} else {
const channel = sentChannel || message.channel;
data.guild.plugins.birthdays = channel.id;
data.guild.markModified("plugins.birthdays");
await data.guild.save();
return message.success("administration/setbirthdays:ENABLED", {
channel: channel.toString()
});
}
}
}
module.exports = Setbirthdays;

View file

@ -1,33 +0,0 @@
const Command = require("../../base/Command");
class Setlang extends Command {
constructor(client) {
super(client, {
name: "setlang",
dirname: __dirname,
enabled: true,
guildOnly: true,
aliases: ["setl"],
memberPermissions: ["MANAGE_GUILD"],
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS"],
nsfw: false,
ownerOnly: false,
cooldown: 1000
});
}
async run(message, args, data) {
const language = this.client.languages.find((l) => l.name === args[0] || l.aliases.includes(args[0]));
if (!args[0] || !language) return message.error("administration/setlang:MISSING_LANG", { list: this.client.languages.map((l) => `\`${l.name} (${l.aliases.slice(0, 2).join(", ")})\``).join(", ") });
data.guild.language = language.name;
await data.guild.save();
return message.sendT("administration/setlang:SUCCESS", {
lang: language.nativeName
});
}
}
module.exports = Setlang;

View file

@ -1,44 +0,0 @@
const Command = require("../../base/Command");
class Setmodlogs extends Command {
constructor(client) {
super(client, {
name: "setmodlogs",
dirname: __dirname,
enabled: true,
guildOnly: true,
aliases: ["setm"],
memberPermissions: ["MANAGE_GUILD"],
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS"],
nsfw: false,
ownerOnly: false,
cooldown: 1000
});
}
async run(message, args, data) {
const areModLogsEnabled = Boolean(data.guild.plugins.modlogs);
const sentChannel = await Resolvers.resolveChannel({
message,
search: args.join(" "),
channelType: "GUILD_TEXT"
});
if (!sentChannel && areModLogsEnabled) {
data.guild.plugins.modlogs = null;
data.guild.markModified("plugins.modlogs");
await data.guild.save();
return message.success("administration/setmodlogs:DISABLED");
} else {
const channel = sentChannel || message.channel;
data.guild.plugins.modlogs = channel.id;
data.guild.markModified("plugins.modlogs");
await data.guild.save();
return message.success("administration/setmodlogs:ENABLED", {
channel: channel.toString()
});
}
}
}
module.exports = Setmodlogs;

View file

@ -1,44 +0,0 @@
const Command = require("../../base/Command");
class Setnews extends Command {
constructor(client) {
super(client, {
name: "setnews",
dirname: __dirname,
enabled: true,
guildOnly: true,
aliases: [],
memberPermissions: ["MANAGE_GUILD"],
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS"],
nsfw: false,
ownerOnly: false,
cooldown: 1000
});
}
async run(message, args, data) {
const areNewsEnabled = Boolean(data.guild.plugins.news);
const sentChannel = await Resolvers.resolveChannel({
message,
search: args.join(" "),
channelType: "GUILD_TEXT"
});
if (areNewsEnabled && !sentChannel) {
data.guild.plugins.news = null;
data.guild.markModified("plugins.news");
await data.guild.save();
return message.success("administration/setnews:DISABLED");
} else {
const channel = sentChannel || message.channel;
data.guild.plugins.news = channel.id;
data.guild.markModified("plugins.news");
await data.guild.save();
return message.success("administration/setnews:ENABLED", {
channel: channel.toString()
});
}
}
}
module.exports = Setnews;

View file

@ -1,44 +0,0 @@
const Command = require("../../base/Command");
class Setreports extends Command {
constructor(client) {
super(client, {
name: "setreports",
dirname: __dirname,
enabled: true,
guildOnly: true,
aliases: ["setr"],
memberPermissions: ["MANAGE_GUILD"],
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS"],
nsfw: false,
ownerOnly: false,
cooldown: 1000
});
}
async run(message, args, data) {
const areReportsEnabled = Boolean(data.guild.plugins.reports);
const sentChannel = await Resolvers.resolveChannel({
message,
search: args.join(" "),
channelType: "GUILD_TEXT"
});
if (!sentChannel && areReportsEnabled) {
data.guild.plugins.reports = null;
data.guild.markModified("plugins.reports");
await data.guild.save();
return message.success("administration/setreports:DISABLED");
} else {
const channel = sentChannel || message.channel;
data.guild.plugins.reports = channel.id;
data.guild.markModified("plugins.reports");
await data.guild.save();
return message.success("administration/setreports:ENABLED", {
channel: channel.toString()
});
}
}
}
module.exports = Setreports;

View file

@ -1,44 +0,0 @@
const Command = require("../../base/Command");
class Setsuggests extends Command {
constructor(client) {
super(client, {
name: "setsuggests",
dirname: __dirname,
enabled: true,
guildOnly: true,
aliases: ["setsu"],
memberPermissions: ["MANAGE_GUILD"],
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS"],
nsfw: false,
ownerOnly: false,
cooldown: 1000
});
}
async run(message, args, data) {
const areSuggestsEnabled = Boolean(data.guild.plugins.suggestions);
const sentChannel = await Resolvers.resolveChannel({
message,
search: args.join(" "),
channelType: "GUILD_TEXT"
});
if (!sentChannel && areSuggestsEnabled) {
data.guild.plugins.suggestions = null;
data.guild.markModified("plugins.suggestions");
await data.guild.save();
return message.success("administration/setsuggests:DISABLED");
} else {
const channel = sentChannel || message.channel;
data.guild.plugins.suggestions = channel.id;
data.guild.markModified("plugins.suggestions");
await data.guild.save();
return message.success("administration/setsuggests:ENABLED", {
channel: channel.toString()
});
}
}
}
module.exports = Setsuggests;

View file

@ -1,110 +0,0 @@
const Command = require("../../base/Command");
class Welcome extends Command {
constructor(client) {
super(client, {
name: "welcome",
dirname: __dirname,
enabled: true,
guildOnly: true,
aliases: ["welc"],
memberPermissions: ["MANAGE_GUILD"],
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS"],
nsfw: false,
ownerOnly: false,
cooldown: 1000
});
}
async run(message, args, data) {
if (args[0] === "test" && data.guild.plugins.welcome.enabled) {
this.client.emit("guildMemberAdd", message.member);
return message.success("administration/welcome:TEST_SUCCESS");
}
if ((!args[0] || !["edit", "off"].includes(args[0])) && data.guild.plugins.welcome.enabled) return message.error("administration/welcome:MISSING_STATUS");
if (args[0] === "off") {
data.guild.plugins.welcome = {
enabled: false,
message: null,
channelID: null,
withImage: null
};
data.guild.markModified("plugins.welcome");
data.guild.save();
return message.error("administration/welcome:DISABLED", {
prefix: data.guild.prefix
});
} else {
const welcome = {
enabled: true,
channel: null,
message: null,
withImage: null,
};
message.sendT("administration/welcome:FORM_1", {
author: message.author.toString()
});
const filter = m => m.author.id === message.author.id;
const collector = message.channel.createMessageCollector({
filter,
time: 120000 // 2 minutes
});
collector.on("collect", async msg => {
// If the message is filled, it means the user sent yes or no for the image
if (welcome.message) {
if (msg.content.toLowerCase() === message.translate("common:YES").toLowerCase()) {
welcome.withImage = true;
} else if (msg.content.toLowerCase() === message.translate("common:NO").toLowerCase()) {
welcome.withImage = false;
} else {
return message.error("misc:INVALID_YES_NO");
}
data.guild.plugins.welcome = welcome;
data.guild.markModified("plugins.welcome");
await data.guild.save();
message.sendT("administration/welcome:FORM_SUCCESS", {
prefix: data.guild.prefix,
channel: `<#${welcome.channel}>`
});
return collector.stop();
}
// If the channel is filled and the message is not, it means the user sent the message
if (welcome.channel && !welcome.message) {
if (msg.content.length < 1800) {
welcome.message = msg.content;
return message.sendT("administration/welcome:FORM_3");
}
return message.error("administration/goodbye:MAX_CHARACT");
}
// If the channel is not filled, it means the user sent it
if (!welcome.channel) {
const channel = await Resolvers.resolveChannel({
message: msg,
channelType: "GUILD_TEXT"
});
if (!channel) return message.error("misc:INVALID_CHANNEL");
welcome.channel = channel.id;
return message.sendT("administration/welcome:FORM_2", {
guildName: message.guild.name,
author: msg.author.tag,
memberCount: msg.guild.memberCount
});
}
});
collector.on("end", (_, reason) => {
if (reason === "time") return message.error("misc:TIMES_UP");
});
}
}
}
module.exports = Welcome;

View file

@ -0,0 +1,72 @@
const { SlashCommandBuilder, PermissionFlagsBits, ChannelType } = require("discord.js");
const BaseCommand = require("../../base/BaseCommand");
class Automod extends BaseCommand {
/**
*
* @param {import("../../base/JaBa")} client
*/
constructor(client) {
super({
command: new SlashCommandBuilder()
.setName("automod")
.setDescription(client.translate("administration/automod:DESCRIPTION"))
.setDefaultMemberPermissions(PermissionFlagsBits.ManageGuild)
.addBooleanOption(option => option.setName("state")
.setDescription(client.translate("common:STATE"))
.setRequired(true))
.addChannelOption(option => option.setName("channel")
.setDescription(client.translate("common:CHANNEL"))
.addChannelTypes(ChannelType.GuildText)),
aliases: [],
dirname: __dirname,
guildOnly: true
});
}
/**
*
* @param {import("../../base/JaBa")} client
*/
async onLoad() {
//...
}
/**
*
* @param {import("../../base/JaBa")} client
* @param {import("discord.js").ChatInputCommandInteraction} interaction
* @param {Array} data
*/
async execute(client, interaction, data) {
const state = interaction.options.getBoolean("state");
const channel = interaction.options.getChannel("channel");
if (state) {
data.guildData.plugins.automod = {
enabled: true,
ignored: []
};
data.guildData.markModified("plugins.automod");
await data.guildData.save();
return interaction.success("administration/automod:ENABLED");
} else {
if (channel) {
data.guildData.plugins.automod.ignored.push(channel);
data.guildData.markModified("plugins.automod");
await data.guildData.save();
interaction.success("administration/automod:DISABLED_CHANNEL", {
channel: channel.toString()
});
} else {
data.guildData.plugins.automod = {
enabled: false,
ignored: []
};
data.guildData.markModified("plugins.automod");
await data.guildData.save();
interaction.success("administration/automod:DISABLED");
}
}
}
}
module.exports = Automod;

View file

@ -0,0 +1,74 @@
const { SlashCommandBuilder, PermissionFlagsBits } = require("discord.js");
const BaseCommand = require("../../base/BaseCommand");
class Autorole extends BaseCommand {
/**
*
* @param {import("../../base/JaBa")} client
*/
constructor(client) {
super({
command: new SlashCommandBuilder()
.setName("autorole")
.setDescription(client.translate("administration/autorole:DESCRIPTION"))
.setDefaultMemberPermissions(PermissionFlagsBits.ManageGuild)
.addBooleanOption(option => option.setName("state")
.setDescription(client.translate("common:STATE"))
.setRequired(true))
.addRoleOption(option => option.setName("role")
.setDescription(client.translate("common:ROLE"))),
aliases: [],
dirname: __dirname,
guildOnly: true
});
}
/**
*
* @param {import("../../base/JaBa")} client
*/
async onLoad() {
//...
}
/**
*
* @param {import("../../base/JaBa")} client
* @param {import("discord.js").ChatInputCommandInteraction} interaction
* @param {Array} data
*/
async execute(client, interaction, data) {
const state = interaction.options.getBoolean("state");
if (state) {
const role = interaction.options.getRole("role", true);
if (!role) return interaction.error("administration/autorole:MISSING_ROLE");
data.guildData.plugins.autorole = {
enabled: true,
role: role.id
};
data.guildData.markModified("plugins.autorole");
await data.guildData.save();
interaction.success("administration/autorole:SUCCESS_ENABLED", {
roleName: role.name
});
} else {
if (!data.guildData.plugins.autorole.enabled) return interaction.success("administration/autorole:ALREADY_DISABLED", {
prefix: data.guildData.prefix
});
data.guildData.plugins.autorole = {
enabled: false,
role: null
};
data.guildData.markModified("plugins.autorole");
await data.guildData.save();
interaction.success("administration/autorole:SUCCESS_DISABLED", {
prefix: data.guildData.prefix
});
}
}
}
module.exports = Autorole;

View file

@ -0,0 +1,115 @@
const { SlashCommandBuilder, EmbedBuilder, PermissionFlagsBits } = require("discord.js");
const BaseCommand = require("../../base/BaseCommand");
class Config extends BaseCommand {
/**
*
* @param {import("../../base/JaBa")} client
*/
constructor(client) {
super({
command: new SlashCommandBuilder()
.setName("config")
.setDescription(client.translate("administration/config:DESCRIPTION"))
.setDefaultMemberPermissions(PermissionFlagsBits.ManageGuild),
aliases: [],
dirname: __dirname,
guildOnly: true
});
}
/**
*
* @param {import("../../base/JaBa")} client
*/
async onLoad() {
//...
}
/**
*
* @param {import("../../base/JaBa")} client
* @param {import("discord.js").ChatInputCommandInteraction} interaction
* @param {Array} data
*/
async execute(client, interaction, data) {
const guildData = data.guildData;
const embed = new EmbedBuilder()
.setAuthor({
name: interaction.guild.name,
iconURL: interaction.guild.iconURL()
})
.setColor(client.config.embed.color)
.setFooter({
text: client.config.embed.footer
})
.addFields([
{
name: interaction.translate("administration/config:WELCOME_TITLE"),
value: guildData.plugins.welcome.enabled ? interaction.translate("administration/config:WELCOME_CONTENT", {
channel: `<#${guildData.plugins.welcome.channel}>`,
withImage: guildData.plugins.welcome.withImage ? interaction.translate("common:YES") : interaction.translate("common:NO")
}) : interaction.translate("common:DISABLED"),
inline: true
},
{
name: interaction.translate("administration/config:GOODBYE_TITLE"),
value: guildData.plugins.goodbye.enabled ? interaction.translate("administration/config:GOODBYE_CONTENT", {
channel: `<#${guildData.plugins.goodbye.channel}>`,
withImage: guildData.plugins.goodbye.withImage ? interaction.translate("common:YES") : interaction.translate("common:NO")
}) : interaction.translate("common:DISABLED"),
inline: true
},
{
name: interaction.translate("administration/config:AUTOROLE_TITLE"),
value: guildData.plugins.autorole.enabled ? `<@&${guildData.plugins.autorole.role}>`
: interaction.translate("common:DISABLED")
},
{
name: interaction.translate("administration/config:AUTO_SANCTIONS"),
value: (guildData.plugins.warnsSanctions.kick ? interaction.translate("administration/config:KICK_CONTENT", {
count: guildData.plugins.warnsSanctions.kick
}) : interaction.translate("administration/config:KICK_NOT_DEFINED")) + "\n" + (guildData.plugins.warnsSanctions.ban ? interaction.translate("administration/config:BAN_CONTENT", {
count: guildData.plugins.warnsSanctions.ban
}) : interaction.translate("administration/config:BAN_NOT_DEFINED"))
},
{
name: interaction.translate("administration/config:AUTOMOD_TITLE"),
value: guildData.plugins.automod.enabled ? interaction.translate("administration/config:AUTOMOD_CONTENT", {
channels: guildData.plugins.automod.ignored.map(ch => `<#${ch}>`)
}) : interaction.translate("common:DISABLED")
},
{
name: interaction.translate("administration/config:AUTODELETEMOD"),
value: guildData.autoDeleteModCommands ? interaction.translate("administration/config:AUTODELETEMOD_ENABLED") : interaction.translate("administration/config:AUTODELETEMOD_DISABLED")
},
{
name: interaction.translate("administration/config:SPECIAL_CHANNELS"),
value: interaction.translate("administration/config:NEWS", {
channel: guildData.plugins.news ? `<#${guildData.plugins.news}>` : `*${interaction.translate("common:NOT_DEFINED")}*`
}) + "\n" +
interaction.translate("administration/config:SUGGESTIONS", {
channel: guildData.plugins.suggestions ? `<#${guildData.plugins.suggestions}>` : `*${interaction.translate("common:NOT_DEFINED")}*`
}) + "\n" +
interaction.translate("administration/config:REPORTS", {
channel: guildData.plugins.reports ? `<#${guildData.plugins.reports}>` : `*${interaction.translate("common:NOT_DEFINED")}*`
}) + "\n" +
interaction.translate("administration/config:MODLOGS", {
channel: guildData.plugins.modlogs ? `<#${guildData.plugins.modlogs}>` : `*${interaction.translate("common:NOT_DEFINED")}*`
}) + "\n" +
interaction.translate("administration/config:BIRTHDAYS", {
channel: guildData.plugins.birthdays ? `<#${guildData.plugins.birthdays}>` : `*${interaction.translate("common:NOT_DEFINED")}*`
})
},
{
name: interaction.translate("administration/config:DASHBOARD_TITLE"),
value: `[${interaction.translate("administration/config:DASHBOARD_CONTENT")}](${client.config.dashboard.baseURL})`
}
]);
interaction.reply({
embeds: [embed]
});
}
}
module.exports = Config;

View file

@ -0,0 +1,45 @@
const { SlashCommandBuilder, PermissionFlagsBits } = require("discord.js");
const BaseCommand = require("../../base/BaseCommand");
class Deletemod extends BaseCommand {
/**
*
* @param {import("../../base/JaBa")} client
*/
constructor(client) {
super({
command: new SlashCommandBuilder()
.setName("deletemod")
.setDescription(client.translate("administration/deletemod:DESCRIPTION"))
.setDefaultMemberPermissions(PermissionFlagsBits.ManageGuild)
.addBooleanOption(option => option.setName("state")
.setDescription(client.translate("common:STATE"))
.setRequired(true)),
aliases: [],
dirname: __dirname,
guildOnly: true
});
}
/**
*
* @param {import("../../base/JaBa")} client
*/
async onLoad() {
//...
}
/**
*
* @param {import("../../base/JaBa")} client
* @param {import("discord.js").ChatInputCommandInteraction} interaction
* @param {Array} data
*/
async execute(client, interaction, data) {
const state = interaction.options.getBoolean("state");
data.guildData.autoDeleteModCommands = state;
await data.guildData.save();
interaction.success(`administration/deletemod:${state ? "ENABLED" : "DISABLED"}`);
}
}
module.exports = Deletemod;

View file

@ -0,0 +1,90 @@
const { SlashCommandBuilder, PermissionFlagsBits } = require("discord.js");
const BaseCommand = require("../../base/BaseCommand");
class Goodbye extends BaseCommand {
/**
*
* @param {import("../../base/JaBa")} client
*/
constructor(client) {
super({
command: new SlashCommandBuilder()
.setName("goodbye")
.setDescription(client.translate("administration/goodbye:DESCRIPTION"))
.setDefaultMemberPermissions(PermissionFlagsBits.ManageGuild)
.addSubcommand(subcommand => subcommand.setName("test")
.setDescription(client.translate("administration/goodbye:TEST"))
)
.addSubcommand(subcommand => subcommand.setName("config")
.setDescription(client.translate("administration/goodbye:CONFIG"))
.addBooleanOption(option => option.setName("state")
.setDescription(client.translate("common:STATE"))
.setRequired(true))
.addChannelOption(option => option.setName("channel")
.setDescription(client.translate("common:CHANNEL")))
.addStringOption(option => option.setName("message")
.setDescription(client.translate("common:MESSAGE")))
.addBooleanOption(option => option.setName("image")
.setDescription(client.translate("administration/goodbye:IMAGE")))
),
aliases: [],
dirname: __dirname,
guildOnly: true
});
}
/**
*
* @param {import("../../base/JaBa")} client
*/
async onLoad() {
//...
}
/**
*
* @param {import("../../base/JaBa")} client
* @param {import("discord.js").ChatInputCommandInteraction} interaction
* @param {Array} data
*/
async execute(client, interaction, data) {
const command = interaction.options.getSubcommand();
if (command === "test") {
client.emit("guildMemberRemove", interaction.member);
return interaction.success("administration/goodbye:TEST_SUCCESS");
} else {
const state = interaction.options.getBoolean("state");
if (!state) {
data.guildData.plugins.goodbye = {
enabled: false,
message: null,
channelID: null,
withImage: null
};
data.guildData.markModified("plugins.goodbye");
await data.guildData.save();
interaction.success("administration/goodbye:DISABLED");
} else {
const channel = interaction.options.getChannel("channel");
const message = interaction.options.getString("message");
const image = interaction.options.getBoolean("image");
data.guildData.plugins.goodbye = {
enabled: true,
channel: channel.id,
message: message,
withImage: image,
};
data.guildData.markModified("plugins.goodbye");
await data.guildData.save();
interaction.success("administration/goodbye:ENABLED", {
channel: `<#${data.guildData.plugins.goodbye.channel}>`
});
}
}
}
}
module.exports = Goodbye;

View file

@ -0,0 +1,106 @@
const { SlashCommandBuilder, PermissionFlagsBits } = require("discord.js");
const BaseCommand = require("../../base/BaseCommand");
class Set extends BaseCommand {
/**
*
* @param {import("../base/JaBa")} client
*/
constructor(client) {
super({
command: new SlashCommandBuilder()
.setName("set")
.setDescription(client.translate("administration/set:DESCRIPTION"))
.setDefaultMemberPermissions(PermissionFlagsBits.ManageGuild)
.addStringOption(option => option.setName("type")
.setDescription(client.translate("owner/debug:TYPE"))
.setRequired(true)
.addChoices(
{ name: client.translate("common:LEVEL"), value: "level" },
{ name: client.translate("common:XP"), value: "xp" },
{ name: client.translate("common:CREDITS"), value: "credits" },
{ name: client.translate("economy/transactions:BANK"), value: "bank" },
{ name: client.translate("common:REP"), value: "rep" },
))
.addUserOption(option => option.setName("user")
.setDescription(client.translate("common:USER"))
.setRequired(true))
.addIntegerOption(option => option.setName("int")
.setDescription(client.translate("common:INT"))
.setRequired(true)),
aliases: [],
dirname: __dirname,
guildOnly: true,
ownerOnly: false
});
}
/**
*
* @param {import("../../base/JaBa")} client
*/
async onLoad() {
//...
}
/**
*
* @param {import("../../base/JaBa")} client
* @param {import("discord.js").ChatInputCommandInteraction} interaction
* @param {Array} data
*/
async execute(client, interaction, data) {
const type = interaction.options.getString("type");
const member = interaction.options.getMember("user");
if (member.user.bot) return interaction.error("misc:BOT_USER", null, { ephemeral: true });
const int = interaction.options.getInteger("int");
if (int < 0) return interaction.error("administration/set:INVALID_NUMBER", null, { ephemeral: true });
switch (type) {
case "level": {
data.memberData.level = int;
await data.memberData.save();
return interaction.success("owner/debug:SUCCESS_" + type.toUpperCase(), {
username: member.toString(),
amount: int
}, { ephemeral: true });
}
case "xp": {
data.memberData.exp = int;
await data.memberData.save();
return interaction.success("owner/debug:SUCCESS_" + type.toUpperCase(), {
username: member.toString(),
amount: int
}, { ephemeral: true });
}
case "credits": {
data.memberData.money = int;
await data.memberData.save();
return interaction.success("owner/debug:SUCCESS_" + type.toUpperCase(), {
username: member.toString(),
amount: int
}, { ephemeral: true });
}
case "bank": {
data.memberData.bankSold = int;
await data.memberData.save();
return interaction.success("owner/debug:SUCCESS_" + type.toUpperCase(), {
username: member.toString(),
amount: int
}, { ephemeral: true });
}
case "rep": {
data.memberData.rep = int;
await data.memberData.save();
return interaction.success("owner/debug:SUCCESS_" + type.toUpperCase(), {
username: member.toString(),
amount: int
}, { ephemeral: true });
}
}
}
}
module.exports = Set;

View file

@ -0,0 +1,61 @@
const { SlashCommandBuilder, PermissionFlagsBits, ChannelType } = require("discord.js");
const BaseCommand = require("../../base/BaseCommand");
class Setbirthdays extends BaseCommand {
/**
*
* @param {import("../../base/JaBa")} client
*/
constructor(client) {
super({
command: new SlashCommandBuilder()
.setName("setbirthdays")
.setDescription(client.translate("administration/setbirthdays:DESCRIPTION"))
.setDefaultMemberPermissions(PermissionFlagsBits.ManageGuild)
.addBooleanOption(option => option.setName("state")
.setDescription(client.translate("common:STATE"))
.setRequired(true))
.addChannelOption(option => option.setName("channel")
.setDescription(client.translate("common:CHANNEL"))
.addChannelTypes(ChannelType.GuildText)),
aliases: [],
dirname: __dirname,
guildOnly: true
});
}
/**
*
* @param {import("../../base/JaBa")} client
*/
async onLoad() {
//...
}
/**
*
* @param {import("../../base/JaBa")} client
* @param {import("discord.js").ChatInputCommandInteraction} interaction
* @param {Array} data
*/
async execute(client, interaction, data) {
const state = interaction.options.getBoolean("state");
const channel = interaction.options.getChannel("channel");
if (!state) {
data.guildData.plugins.birthdays = null;
data.guildData.markModified("plugins.birthdays");
await data.guildData.save();
return interaction.success("administration/setbirthdays:DISABLED");
} else {
if (channel) {
data.guildData.plugins.birthdays = channel.id;
data.guildData.markModified("plugins.birthdays");
await data.guildData.save();
interaction.success("administration/setbirthdays:ENABLED", {
channel: channel.toString()
});
} else return interaction.replyT(`administration/setbirthdays:${data.guildData.plugins.birthdays ? "ENABLED" : "DISABLED"}`, data.guildData.plugins.birthdays ? { channel: interaction.guild.channels.cache.get(data.guildData.plugins.birthdays).toString() } : null);
}
}
}
module.exports = Setbirthdays;

View file

@ -0,0 +1,53 @@
const { SlashCommandBuilder, PermissionFlagsBits } = require("discord.js");
const BaseCommand = require("../../base/BaseCommand");
class Setlang extends BaseCommand {
/**
*
* @param {import("../../base/JaBa")} client
*/
constructor(client) {
super({
command: new SlashCommandBuilder()
.setName("setlang")
.setDescription(client.translate("administration/setlang:DESCRIPTION"))
.setDefaultMemberPermissions(PermissionFlagsBits.ManageGuild)
.addStringOption(option => option.setName("language")
.setDescription(client.translate("common:LANGUAGE"))
.setRequired(true)
.addChoices(
{ name: "Русский", value: "ru-RU" },
{ name: "Українська", value: "uk-UA" }
)),
aliases: [],
dirname: __dirname,
guildOnly: true
});
}
/**
*
* @param {import("../../base/JaBa")} client
*/
async onLoad() {
//...
}
/**
*
* @param {import("../../base/JaBa")} client
* @param {import("discord.js").ChatInputCommandInteraction} interaction
* @param {Array} data
*/
async execute(client, interaction, data) {
const lang = interaction.options.getString("language");
const language = client.languages.find(l => l.name === lang);
data.guildData.language = language.name;
await data.guildData.save();
return interaction.success("administration/setlang:SUCCESS", {
lang: language.nativeName
});
}
}
module.exports = Setlang;

View file

@ -0,0 +1,61 @@
const { SlashCommandBuilder, PermissionFlagsBits, ChannelType } = require("discord.js");
const BaseCommand = require("../../base/BaseCommand");
class Setmodlogs extends BaseCommand {
/**
*
* @param {import("../../base/JaBa")} client
*/
constructor(client) {
super({
command: new SlashCommandBuilder()
.setName("setmodlogs")
.setDescription(client.translate("administration/setmodlogs:DESCRIPTION"))
.setDefaultMemberPermissions(PermissionFlagsBits.ManageGuild)
.addBooleanOption(option => option.setName("state")
.setDescription(client.translate("common:STATE"))
.setRequired(true))
.addChannelOption(option => option.setName("channel")
.setDescription(client.translate("common:CHANNEL"))
.addChannelTypes(ChannelType.GuildText)),
aliases: [],
dirname: __dirname,
guildOnly: true
});
}
/**
*
* @param {import("../../base/JaBa")} client
*/
async onLoad() {
//...
}
/**
*
* @param {import("../../base/JaBa")} client
* @param {import("discord.js").ChatInputCommandInteraction} interaction
* @param {Array} data
*/
async execute(client, interaction, data) {
const state = interaction.options.getBoolean("state");
const channel = interaction.options.getChannel("channel");
if (!state) {
data.guildData.plugins.modlogs = null;
data.guildData.markModified("plugins.modlogs");
await data.guildData.save();
return interaction.success("administration/setmodlogs:DISABLED");
} else {
if (channel) {
data.guildData.plugins.modlogs = channel.id;
data.guildData.markModified("plugins.modlogs");
await data.guildData.save();
interaction.success("administration/setmodlogs:ENABLED", {
channel: channel.toString()
});
} else return interaction.replyT(`administration/setmodlogs:${data.guildData.plugins.modlogs ? "ENABLED" : "DISABLED"}`, data.guildData.plugins.modlogs ? { channel: interaction.guild.channels.cache.get(data.guildData.plugins.modlogs).toString() } : null);
}
}
}
module.exports = Setmodlogs;

View file

@ -0,0 +1,61 @@
const { SlashCommandBuilder, PermissionFlagsBits, ChannelType } = require("discord.js");
const BaseCommand = require("../../base/BaseCommand");
class Setnews extends BaseCommand {
/**
*
* @param {import("../../base/JaBa")} client
*/
constructor(client) {
super({
command: new SlashCommandBuilder()
.setName("setnews")
.setDescription(client.translate("administration/setnews:DESCRIPTION"))
.setDefaultMemberPermissions(PermissionFlagsBits.ManageGuild)
.addBooleanOption(option => option.setName("state")
.setDescription(client.translate("common:STATE"))
.setRequired(true))
.addChannelOption(option => option.setName("channel")
.setDescription(client.translate("common:CHANNEL"))
.addChannelTypes(ChannelType.GuildText)),
aliases: [],
dirname: __dirname,
guildOnly: true
});
}
/**
*
* @param {import("../../base/JaBa")} client
*/
async onLoad() {
//...
}
/**
*
* @param {import("../../base/JaBa")} client
* @param {import("discord.js").ChatInputCommandInteraction} interaction
* @param {Array} data
*/
async execute(client, interaction, data) {
const state = interaction.options.getBoolean("state");
const channel = interaction.options.getChannel("channel");
if (!state) {
data.guildData.plugins.news = null;
data.guildData.markModified("plugins.news");
await data.guildData.save();
return interaction.success("administration/setnews:DISABLED");
} else {
if (channel) {
data.guildData.plugins.news = channel.id;
data.guildData.markModified("plugins.news");
await data.guildData.save();
interaction.success("administration/setnews:ENABLED", {
channel: channel.toString()
});
} else return interaction.replyT(`administration/setnews:${data.guildData.plugins.news ? "ENABLED" : "DISABLED"}`, data.guildData.plugins.news ? { channel: interaction.guild.channels.cache.get(data.guildData.plugins.news).toString() } : null);
}
}
}
module.exports = Setnews;

View file

@ -0,0 +1,61 @@
const { SlashCommandBuilder, PermissionFlagsBits, ChannelType } = require("discord.js");
const BaseCommand = require("../../base/BaseCommand");
class Setreports extends BaseCommand {
/**
*
* @param {import("../../base/JaBa")} client
*/
constructor(client) {
super({
command: new SlashCommandBuilder()
.setName("setreports")
.setDescription(client.translate("administration/setreports:DESCRIPTION"))
.setDefaultMemberPermissions(PermissionFlagsBits.ManageGuild)
.addBooleanOption(option => option.setName("state")
.setDescription(client.translate("common:STATE"))
.setRequired(true))
.addChannelOption(option => option.setName("channel")
.setDescription(client.translate("common:CHANNEL"))
.addChannelTypes(ChannelType.GuildText)),
aliases: [],
dirname: __dirname,
guildOnly: true
});
}
/**
*
* @param {import("../../base/JaBa")} client
*/
async onLoad() {
//...
}
/**
*
* @param {import("../../base/JaBa")} client
* @param {import("discord.js").ChatInputCommandInteraction} interaction
* @param {Array} data
*/
async execute(client, interaction, data) {
const state = interaction.options.getBoolean("state");
const channel = interaction.options.getChannel("channel");
if (!state) {
data.guildData.plugins.reports = null;
data.guildData.markModified("plugins.reports");
await data.guildData.save();
return interaction.success("administration/setreports:DISABLED");
} else {
if (channel) {
data.guildData.plugins.reports = channel.id;
data.guildData.markModified("plugins.reports");
await data.guildData.save();
interaction.success("administration/setreports:ENABLED", {
channel: channel.toString()
});
} else return interaction.replyT(`administration/setreports:${data.guildData.plugins.reports ? "ENABLED" : "DISABLED"}`, data.guildData.plugins.reports ? { channel: interaction.guild.channels.cache.get(data.guildData.plugins.reports).toString() } : null);
}
}
}
module.exports = Setreports;

View file

@ -0,0 +1,61 @@
const { SlashCommandBuilder, PermissionFlagsBits, ChannelType } = require("discord.js");
const BaseCommand = require("../../base/BaseCommand");
class Setsuggests extends BaseCommand {
/**
*
* @param {import("../../base/JaBa")} client
*/
constructor(client) {
super({
command: new SlashCommandBuilder()
.setName("setsuggests")
.setDescription(client.translate("administration/setsuggests:DESCRIPTION"))
.setDefaultMemberPermissions(PermissionFlagsBits.ManageGuild)
.addBooleanOption(option => option.setName("state")
.setDescription(client.translate("common:STATE"))
.setRequired(true))
.addChannelOption(option => option.setName("channel")
.setDescription(client.translate("common:CHANNEL"))
.addChannelTypes(ChannelType.GuildText)),
aliases: [],
dirname: __dirname,
guildOnly: true
});
}
/**
*
* @param {import("../../base/JaBa")} client
*/
async onLoad() {
//...
}
/**
*
* @param {import("../../base/JaBa")} client
* @param {import("discord.js").ChatInputCommandInteraction} interaction
* @param {Array} data
*/
async execute(client, interaction, data) {
const state = interaction.options.getBoolean("state");
const channel = interaction.options.getChannel("channel");
if (!state) {
data.guildData.plugins.suggestions = null;
data.guildData.markModified("plugins.suggestions");
await data.guildData.save();
return interaction.success("administration/setsuggests:DISABLED");
} else {
if (channel) {
data.guildData.plugins.suggestions = channel.id;
data.guildData.markModified("plugins.suggestions");
await data.guildData.save();
interaction.success("administration/setsuggests:ENABLED", {
channel: channel.toString()
});
} else return interaction.replyT(`administration/setsuggests:${data.guildData.plugins.suggestions ? "ENABLED" : "DISABLED"}`, data.guildData.plugins.suggestions ? { channel: interaction.guild.channels.cache.get(data.guildData.plugins.suggestions).toString() } : null);
}
}
}
module.exports = Setsuggests;

View file

@ -0,0 +1,90 @@
const { SlashCommandBuilder, PermissionFlagsBits } = require("discord.js");
const BaseCommand = require("../../base/BaseCommand");
class Welcome extends BaseCommand {
/**
*
* @param {import("../../base/JaBa")} client
*/
constructor(client) {
super({
command: new SlashCommandBuilder()
.setName("welcome")
.setDescription(client.translate("administration/welcome:DESCRIPTION"))
.setDefaultMemberPermissions(PermissionFlagsBits.ManageGuild)
.addSubcommand(subcommand => subcommand.setName("test")
.setDescription(client.translate("administration/goodbye:TEST"))
)
.addSubcommand(subcommand => subcommand.setName("config")
.setDescription(client.translate("administration/goodbye:CONFIG"))
.addBooleanOption(option => option.setName("state")
.setDescription(client.translate("common:STATE"))
.setRequired(true))
.addChannelOption(option => option.setName("channel")
.setDescription(client.translate("common:CHANNEL")))
.addStringOption(option => option.setName("message")
.setDescription(client.translate("common:MESSAGE")))
.addBooleanOption(option => option.setName("image")
.setDescription(client.translate("administration/goodbye:IMAGE")))
),
aliases: [],
dirname: __dirname,
guildOnly: true
});
}
/**
*
* @param {import("../../base/JaBa")} client
*/
async onLoad() {
//...
}
/**
*
* @param {import("../../base/JaBa")} client
* @param {import("discord.js").ChatInputCommandInteraction} interaction
* @param {Array} data
*/
async execute(client, interaction, data) {
const command = interaction.options.getSubcommand();
if (command === "test") {
client.emit("guildMemberAdd", interaction.member);
return interaction.success("administration/goodbye:TEST_SUCCESS");
} else {
const state = interaction.options.getBoolean("state");
if (!state) {
data.guildData.plugins.welcome = {
enabled: false,
message: null,
channelID: null,
withImage: null
};
data.guildData.markModified("plugins.welcome");
await data.guildData.save();
interaction.success("administration/welcome:DISABLED");
} else {
const channel = interaction.options.getChannel("channel");
const message = interaction.options.getString("message");
const image = interaction.options.getBoolean("image");
data.guildData.plugins.welcome = {
enabled: true,
channel: channel.id,
message: message,
withImage: image,
};
data.guildData.markModified("plugins.welcome");
await data.guildData.save();
interaction.success("administration/welcome:ENABLED", {
channel: `<#${data.guildData.plugins.welcome.channel}>`
});
}
}
}
}
module.exports = Welcome;

View file

@ -48,7 +48,7 @@ class Memes extends BaseCommand {
); );
const msg = await interaction.reply({ const msg = await interaction.reply({
content: interaction.translate("common:AVAILABLE_CATEGORIES"), content: interaction.translate("common:AVAILABLE_OPTIONS"),
components: [row], components: [row],
fetchReply: true fetchReply: true
}); });

View file

@ -69,7 +69,7 @@ class Help extends BaseCommand {
); );
const msg = await interaction.reply({ const msg = await interaction.reply({
content: interaction.translate("common:AVAILABLE_CATEGORIES"), content: interaction.translate("common:AVAILABLE_OPTIONS"),
components: [row], components: [row],
fetchReply: true fetchReply: true
}); });

View file

@ -1,4 +1,4 @@
const { SlashCommandBuilder, EmbedBuilder } = require("discord.js"); const { SlashCommandBuilder, EmbedBuilder, ChannelType } = require("discord.js");
const BaseCommand = require("../../base/BaseCommand"); const BaseCommand = require("../../base/BaseCommand");
class Serverinfo extends BaseCommand { class Serverinfo extends BaseCommand {
@ -85,9 +85,9 @@ class Serverinfo extends BaseCommand {
}, },
{ {
name: client.customEmojis.channels + interaction.translate("common:CHANNELS"), name: client.customEmojis.channels + interaction.translate("common:CHANNELS"),
value: `${guild.channels.cache.filter(c => c.type === "GUILD_TEXT").size} ${client.getNoun(guild.channels.cache.filter(c => c.type === "GUILD_TEXT").size, interaction.translate("misc:NOUNS:TEXT:1"), interaction.translate("misc:NOUNS:TEXT:2"), interaction.translate("misc:NOUNS:TEXT:5"))}` + value: `${guild.channels.cache.filter(c => c.type === ChannelType.GuildText).size} ${client.getNoun(guild.channels.cache.filter(c => c.type === ChannelType.GuildText).size, interaction.translate("misc:NOUNS:TEXT:1"), interaction.translate("misc:NOUNS:TEXT:2"), interaction.translate("misc:NOUNS:TEXT:5"))}` +
"\n" + `${guild.channels.cache.filter(c => c.type === "GUILD_VOICE").size} ${client.getNoun(guild.channels.cache.filter(c => c.type === "GUILD_VOICE").size, interaction.translate("misc:NOUNS:VOICE:1"), interaction.translate("misc:NOUNS:VOICE:2"), interaction.translate("misc:NOUNS:VOICE:5"))}` + "\n" + `${guild.channels.cache.filter(c => c.type === ChannelType.GuildVoice).size} ${client.getNoun(guild.channels.cache.filter(c => c.type === ChannelType.GuildVoice).size, interaction.translate("misc:NOUNS:VOICE:1"), interaction.translate("misc:NOUNS:VOICE:2"), interaction.translate("misc:NOUNS:VOICE:5"))}` +
"\n" + `${guild.channels.cache.filter(c => c.type === "GUILD_CATEGORY").size} ${client.getNoun(guild.channels.cache.filter(c => c.type === "GUILD_CATEGORY").size, interaction.translate("misc:NOUNS:CATEGORY:1"), interaction.translate("misc:NOUNS:CATEGORY:2"), interaction.translate("misc:NOUNS:CATEGORY:5"))}`, "\n" + `${guild.channels.cache.filter(c => c.type === ChannelType.GuildCategory).size} ${client.getNoun(guild.channels.cache.filter(c => c.type === ChannelType.GuildCategory).size, interaction.translate("misc:NOUNS:CATEGORY:1"), interaction.translate("misc:NOUNS:CATEGORY:2"), interaction.translate("misc:NOUNS:CATEGORY:5"))}`,
inline: true inline: true
} }
]) ])

View file

@ -58,7 +58,7 @@ class Giveaway extends BaseCommand {
); );
const msg = await interaction.reply({ const msg = await interaction.reply({
content: interaction.translate("common:AVAILABLE_CATEGORIES"), content: interaction.translate("common:AVAILABLE_OPTIONS"),
components: [row], components: [row],
ephemeral: true, ephemeral: true,
fetchReply: true fetchReply: true

View file

@ -1,4 +1,4 @@
const { ContextMenuCommandBuilder, ApplicationCommandType, PermissionFlagsBits, TextInputStyle, ModalBuilder, EmbedBuilder, ActionRowBuilder, TextInputBuilder } = require("discord.js"); const { ContextMenuCommandBuilder, ModalBuilder, EmbedBuilder, ActionRowBuilder, TextInputBuilder, ApplicationCommandType, PermissionFlagsBits, TextInputStyle } = require("discord.js");
const BaseCommand = require("../../base/BaseCommand"); const BaseCommand = require("../../base/BaseCommand");
class Warn extends BaseCommand { class Warn extends BaseCommand {
@ -49,7 +49,7 @@ class Warn extends BaseCommand {
const reasonInput = new TextInputBuilder() const reasonInput = new TextInputBuilder()
.setCustomId("warn_reason") .setCustomId("warn_reason")
.setLabel(interaction.translate("moderation/warn:REASON")) .setLabel(interaction.translate("moderation/warn:MODAL_REASON"))
.setStyle(TextInputStyle.Short); .setStyle(TextInputStyle.Short);
modal.addComponents(new ActionRowBuilder().addComponents(reasonInput)); modal.addComponents(new ActionRowBuilder().addComponents(reasonInput));
@ -58,10 +58,10 @@ class Warn extends BaseCommand {
const submitted = await interaction.awaitModalSubmit({ const submitted = await interaction.awaitModalSubmit({
time: 120000, time: 120000,
filter: i => i.user.id === interaction.member.id, filter: i => i.user.id === interaction.member.id && i.customId === "warn_modal",
}); });
if (submitted && submitted.customId === "warn_modal") { if (submitted) {
const reason = submitted.fields.getTextInputValue("warn_reason"); const reason = submitted.fields.getTextInputValue("warn_reason");
const sanctions = memberData.sanctions.filter((s) => s.type === "warn").length; const sanctions = memberData.sanctions.filter((s) => s.type === "warn").length;

View file

@ -63,7 +63,7 @@ class Loop extends BaseCommand {
); );
const msg = await interaction.reply({ const msg = await interaction.reply({
content: interaction.translate("common:AVAILABLE_CATEGORIES"), content: interaction.translate("common:AVAILABLE_OPTIONS"),
components: [row], components: [row],
fetchReply: true fetchReply: true
}); });
@ -82,8 +82,11 @@ class Loop extends BaseCommand {
queue.setRepeatMode(mode); queue.setRepeatMode(mode);
return i.update({ return i.update({
content: interaction.translate(`music/loop:${type === "3" ? "AUTOPLAY_ENABLED" : content: interaction.translate(`music/loop:${
type === "2" ? "QUEUE_ENABLED" : type === "1" ? "TRACK_ENABLED" : "LOOP_DISABLED"}`), type === "3" ? "AUTOPLAY_ENABLED" :
type === "2" ? "QUEUE_ENABLED" :
type === "1" ? "TRACK_ENABLED" : "LOOP_DISABLED"
}`),
components: [] components: []
}); });
}); });

View file

@ -59,8 +59,9 @@ class Nowplaying extends BaseCommand {
{ {
name: "\u200b", name: "\u200b",
value: `${interaction.translate("music/nowplaying:REPEAT")}: \`${ value: `${interaction.translate("music/nowplaying:REPEAT")}: \`${
queue.repeatMode === QueueRepeatMode.AUTOPLAY ? interaction.translate("music/nowplaying:AUTOPLAY") : queue.repeatMode === QueueRepeatMode.QUEUE ? interaction.translate("music/nowplaying:QUEUE") : queue.repeatMode === QueueRepeatMode.TRACK ? interaction.translate("music/nowplaying:TRACK") queue.repeatMode === QueueRepeatMode.AUTOPLAY ? interaction.translate("music/nowplaying:AUTOPLAY") :
: interaction.translate("music/nowplaying:DISABLED") queue.repeatMode === QueueRepeatMode.QUEUE ? interaction.translate("music/nowplaying:QUEUE") :
queue.repeatMode === QueueRepeatMode.TRACK ? interaction.translate("music/nowplaying:TRACK") : interaction.translate("common:DISABLED")
}\`` }\``
} }
]) ])

View file

@ -46,9 +46,9 @@ class Skipto extends BaseCommand {
queue.skipTo(queue.tracks[position - 1]); queue.skipTo(queue.tracks[position - 1]);
interaction.success("music/skipto:SUCCESS", { interaction.success("music/skipto:SUCCESS", {
position: position - 1 position: position
}); });
} else return interaction.error("music/skipto:ERROR", { position: position - 1 }); } else return interaction.error("music/skipto:ERROR", { position: position });
} }
} }

View file

@ -50,7 +50,7 @@ class NSFW extends BaseCommand {
); );
const msg = await interaction.reply({ const msg = await interaction.reply({
content: interaction.translate("common:AVAILABLE_CATEGORIES"), content: interaction.translate("common:AVAILABLE_OPTIONS"),
ephemeral: true, ephemeral: true,
components: [row], components: [row],
fetchReply: true fetchReply: true

View file

@ -23,8 +23,8 @@ class Debug extends BaseCommand {
{ name: client.translate("economy/transactions:BANK"), value: "bank" }, { name: client.translate("economy/transactions:BANK"), value: "bank" },
{ name: client.translate("common:REP"), value: "rep" }, { name: client.translate("common:REP"), value: "rep" },
)) ))
.addUserOption(option => option.setName("target") .addUserOption(option => option.setName("user")
.setDescription(client.translate("owner/debug:TARGET")) .setDescription(client.translate("common:USER"))
.setRequired(true)) .setRequired(true))
.addIntegerOption(option => option.setName("int") .addIntegerOption(option => option.setName("int")
.setDescription(client.translate("common:INT")) .setDescription(client.translate("common:INT"))
@ -69,20 +69,20 @@ class Debug extends BaseCommand {
* @param {Array} data * @param {Array} data
*/ */
async execute(client, interaction, data) { async execute(client, interaction, data) {
const action = interaction.options.getSubcommand(); const command = interaction.options.getSubcommand();
if (action === "set") { if (command === "set") {
const type = interaction.options.getString("type"); const type = interaction.options.getString("type");
const member = interaction.options.getMember("user"); const member = interaction.options.getMember("user");
if (member.user.bot) return interaction.error("misc:BOT_USER", null, { ephemeral: true });
const int = interaction.options.getInteger("int"); const int = interaction.options.getInteger("int");
if (member.user.bot) return interaction.error("misc:BOT_USER");
switch (type) { switch (type) {
case "level": { case "level": {
data.memberData.level = int; data.memberData.level = int;
await data.memberData.save(); await data.memberData.save();
return interaction.success("owner/debug:SUCCESS_" + type.toUpperCase(), { return interaction.success("owner/debug:SUCCESS_" + type.toUpperCase(), {
username: member.user.tag, username: member.toString(),
amount: int amount: int
}, { ephemeral: true }); }, { ephemeral: true });
} }
@ -91,7 +91,7 @@ class Debug extends BaseCommand {
data.memberData.exp = int; data.memberData.exp = int;
await data.memberData.save(); await data.memberData.save();
return interaction.success("owner/debug:SUCCESS_" + type.toUpperCase(), { return interaction.success("owner/debug:SUCCESS_" + type.toUpperCase(), {
username: member.user.tag, username: member.toString(),
amount: int amount: int
}, { ephemeral: true }); }, { ephemeral: true });
} }
@ -100,7 +100,7 @@ class Debug extends BaseCommand {
data.memberData.money = int; data.memberData.money = int;
await data.memberData.save(); await data.memberData.save();
return interaction.success("owner/debug:SUCCESS_" + type.toUpperCase(), { return interaction.success("owner/debug:SUCCESS_" + type.toUpperCase(), {
username: member.user.tag, username: member.toString(),
amount: int amount: int
}, { ephemeral: true }); }, { ephemeral: true });
} }
@ -109,7 +109,7 @@ class Debug extends BaseCommand {
data.memberData.bankSold = int; data.memberData.bankSold = int;
await data.memberData.save(); await data.memberData.save();
return interaction.success("owner/debug:SUCCESS_" + type.toUpperCase(), { return interaction.success("owner/debug:SUCCESS_" + type.toUpperCase(), {
username: member.user.tag, username: member.toString(),
amount: int amount: int
}, { ephemeral: true }); }, { ephemeral: true });
} }
@ -118,7 +118,7 @@ class Debug extends BaseCommand {
data.memberData.rep = int; data.memberData.rep = int;
await data.memberData.save(); await data.memberData.save();
return interaction.success("owner/debug:SUCCESS_" + type.toUpperCase(), { return interaction.success("owner/debug:SUCCESS_" + type.toUpperCase(), {
username: member.user.tag, username: member.toString(),
amount: int amount: int
}, { ephemeral: true }); }, { ephemeral: true });
} }
@ -126,15 +126,15 @@ class Debug extends BaseCommand {
} else { } else {
const type = interaction.options.getString("type"); const type = interaction.options.getString("type");
const member = interaction.options.getMember("target"); const member = interaction.options.getMember("target");
if (member.user.bot) return interaction.error("misc:BOT_USER", null, { ephemeral: true });
const int = interaction.options.getInteger("int"); const int = interaction.options.getInteger("int");
if (member.user.bot) return interaction.error("owner/debug:BOT", { ephemeral: true });
switch (type) { switch (type) {
case "level": { case "level": {
data.memberData.level += int; data.memberData.level += int;
await data.memberData.save(); await data.memberData.save();
return interaction.success("owner/debug:SUCCESS_" + type.toUpperCase(), { return interaction.success("owner/debug:SUCCESS_" + type.toUpperCase(), {
username: member.user.tag, username: member.toString(),
amount: int amount: int
}, { ephemeral: true }); }, { ephemeral: true });
} }
@ -143,7 +143,7 @@ class Debug extends BaseCommand {
data.memberData.exp += int; data.memberData.exp += int;
await data.memberData.save(); await data.memberData.save();
return interaction.success("owner/debug:SUCCESS_" + type.toUpperCase(), { return interaction.success("owner/debug:SUCCESS_" + type.toUpperCase(), {
username: member.user.tag, username: member.toString(),
amount: int amount: int
}, { ephemeral: true }); }, { ephemeral: true });
} }
@ -152,7 +152,7 @@ class Debug extends BaseCommand {
data.memberData.money += int; data.memberData.money += int;
await data.memberData.save(); await data.memberData.save();
return interaction.success("owner/debug:SUCCESS_" + type.toUpperCase(), { return interaction.success("owner/debug:SUCCESS_" + type.toUpperCase(), {
username: member.user.tag, username: member.toString(),
amount: int amount: int
}, { ephemeral: true }); }, { ephemeral: true });
} }
@ -161,7 +161,7 @@ class Debug extends BaseCommand {
data.memberData.bankSold += int; data.memberData.bankSold += int;
await data.memberData.save(); await data.memberData.save();
return interaction.success("owner/debug:SUCCESS_" + type.toUpperCase(), { return interaction.success("owner/debug:SUCCESS_" + type.toUpperCase(), {
username: member.user.tag, username: member.toString(),
amount: int amount: int
}, { ephemeral: true }); }, { ephemeral: true });
} }
@ -170,7 +170,7 @@ class Debug extends BaseCommand {
data.memberData.rep += int; data.memberData.rep += int;
await data.memberData.save(); await data.memberData.save();
return interaction.success("owner/debug:SUCCESS_" + type.toUpperCase(), { return interaction.success("owner/debug:SUCCESS_" + type.toUpperCase(), {
username: member.user.tag, username: member.toString(),
amount: int amount: int
}, { ephemeral: true }); }, { ephemeral: true });
} }

View file

@ -1,3 +1,12 @@
### JaBa v4.0pre5
* Добавлено
* Перенесена категория *Administration*.
* Исправления
* Изменён способ получения музыки. На данный момент не работает Spotify, в будущих обновлениях постораюсь вернуть, но это не точно.
* Панель управления снова работает.
* Множество мелких правок.
### JaBa v4.0pre4 ### JaBa v4.0pre4
* Добавлено * Добавлено
* Перенесена категория *Moderation*. * Перенесена категория *Moderation*.

View file

@ -1,3 +1,4 @@
const { ChannelType } = require("discord.js");
const express = require("express"), const express = require("express"),
utils = require("../utils"), utils = require("../utils"),
CheckAuth = require("../auth/CheckAuth"), CheckAuth = require("../auth/CheckAuth"),
@ -23,6 +24,7 @@ router.get("/:serverID", CheckAuth, async(req, res) => {
user: req.userInfos, user: req.userInfos,
memberData: memberData, memberData: memberData,
translate: req.translate, translate: req.translate,
ChannelType,
bot: req.client, bot: req.client,
currentURL: `${req.client.config.dashboard.baseURL}${req.originalUrl}` currentURL: `${req.client.config.dashboard.baseURL}${req.originalUrl}`
}); });
@ -54,7 +56,7 @@ router.post("/:serverID", CheckAuth, async(req, res) => {
const welcome = { const welcome = {
enabled: true, enabled: true,
message: data.message, message: data.message,
channel: guild.channels.cache.find((ch) => "#" + ch.name === data.channel).id, channel: guild.channels.cache.find(ch => "#" + ch.name === data.channel).id,
withImage: data.withImage === "on" withImage: data.withImage === "on"
}; };
guildData.plugins.welcome = welcome; guildData.plugins.welcome = welcome;
@ -78,7 +80,7 @@ router.post("/:serverID", CheckAuth, async(req, res) => {
const goodbye = { const goodbye = {
enabled: true, enabled: true,
message: data.message, message: data.message,
channel: guild.channels.cache.find((ch) => "#" + ch.name === data.channel).id, channel: guild.channels.cache.find(ch => "#" + ch.name === data.channel).id,
withImage: data.withImage === "on" withImage: data.withImage === "on"
}; };
guildData.plugins.goodbye = goodbye; guildData.plugins.goodbye = goodbye;
@ -101,7 +103,7 @@ router.post("/:serverID", CheckAuth, async(req, res) => {
if (Object.prototype.hasOwnProperty.call(data, "autoroleEnable") || Object.prototype.hasOwnProperty.call(data, "autoroleUpdate")) { if (Object.prototype.hasOwnProperty.call(data, "autoroleEnable") || Object.prototype.hasOwnProperty.call(data, "autoroleUpdate")) {
const autorole = { const autorole = {
enabled: true, enabled: true,
role: guild.roles.cache.find((r) => "@" + r.name === data.role).id role: guild.roles.cache.find(r => "@" + r.name === data.role).id
}; };
guildData.plugins.autorole = autorole; guildData.plugins.autorole = autorole;
guildData.markModified("plugins.autorole"); guildData.markModified("plugins.autorole");
@ -119,17 +121,20 @@ router.post("/:serverID", CheckAuth, async(req, res) => {
} }
if (Object.prototype.hasOwnProperty.call(data, "suggestions")) { if (Object.prototype.hasOwnProperty.call(data, "suggestions")) {
if (data.suggestions === req.translate("common:NO_CHANNEL")) guildData.plugins.suggestions = false; if (data.suggestions === req.translate("dashboard:NO_CHANNEL")) guildData.plugins.suggestions = false;
else guildData.plugins.suggestions = guild.channels.cache.find((ch) => "#" + ch.name === data.suggestions).id; else guildData.plugins.suggestions = guild.channels.cache.find(ch => "#" + ch.name === data.suggestions).id;
if (data.modlogs === req.translate("common:NO_CHANNEL")) guildData.plugins.modlogs = false; if (data.modlogs === req.translate("dashboard:NO_CHANNEL")) guildData.plugins.modlogs = false;
else guildData.plugins.modlogs = guild.channels.cache.find((ch) => "#" + ch.name === data.modlogs).id; else guildData.plugins.modlogs = guild.channels.cache.find(ch => "#" + ch.name === data.modlogs).id;
if (data.reports === req.translate("common:NO_CHANNEL")) guildData.plugins.reports = false; if (data.reports === req.translate("dashboard:NO_CHANNEL")) guildData.plugins.reports = false;
else guildData.plugins.reports = guild.channels.cache.find((ch) => "#" + ch.name === data.reports).id; else guildData.plugins.reports = guild.channels.cache.find(ch => "#" + ch.name === data.reports).id;
if (data.birthdays === req.translate("common:NO_CHANNEL")) guildData.plugins.birthdays = false; if (data.birthdays === req.translate("dashboard:NO_CHANNEL")) guildData.plugins.birthdays = false;
else guildData.plugins.birthdays = guild.channels.cache.find((ch) => "#" + ch.name === data.birthdays).id; else guildData.plugins.birthdays = guild.channels.cache.find(ch => "#" + ch.name === data.birthdays).id;
if (data.news === req.translate("dashboard:NO_CHANNEL")) guildData.plugins.news = false;
else guildData.plugins.news = guild.channels.cache.find(ch => "#" + ch.name === data.news).id;
guildData.markModified("plugins"); guildData.markModified("plugins");
} }

View file

@ -130,72 +130,90 @@
<div class="box-body"> <div class="box-body">
<!-- select --> <!-- select -->
<div class="form-group"> <div class="form-group">
<label><%= translate("common:SUGGESTIONS") %></label> <label><%= translate("dashboard:NEWS") %></label>
<select class="form-control" name="news">
<% if (guild.plugins.news && bot.channels.cache.has(guild.plugins.news)) { %>
<option selected="selected">
#<%= bot.channels.cache.get(guild.plugins.news).name %></option>
<% guild.channels.cache.filter(ch => ch.type === ChannelType.GuildText && ch.id !== guild.plugins.news).forEach(ch => { %>
<option>#<%= ch.name %></option>
<% }); %>
<option><%= translate("dashboard:NO_CHANNEL") %></option>
<% } else { %>
<option selected="selected"><%= translate("dashboard:NO_CHANNEL") %></option>
<% guild.channels.cache.filter(ch => ch.type === ChannelType.GuildText).forEach(ch => { %>
<option>#<%= ch.name %></option>
<% }); %>
<% } %>
</select>
</div>
<div class="form-group">
<label><%= translate("dashboard:SUGGESTIONS") %></label>
<select class="form-control" name="suggestions"> <select class="form-control" name="suggestions">
<% if (guild.plugins.suggestions && bot.channels.cache.has(guild.plugins.suggestions)) { %> <% if (guild.plugins.suggestions && bot.channels.cache.has(guild.plugins.suggestions)) { %>
<option selected="selected"> <option selected="selected">
#<%= bot.channels.cache.get(guild.plugins.suggestions).name %></option> #<%= bot.channels.cache.get(guild.plugins.suggestions).name %></option>
<% guild.channels.cache.filter((ch) => ch.type === "GUILD_TEXT" && ch.id !== guild.plugins.suggestions).forEach((ch) => { %> <% guild.channels.cache.filter(ch => ch.type === ChannelType.GuildText && ch.id !== guild.plugins.suggestions).forEach(ch => { %>
<option>#<%= ch.name %></option> <option>#<%= ch.name %></option>
<% }); %> <% }); %>
<option><%= translate("common:NO_CHANNEL") %></option> <option><%= translate("dashboard:NO_CHANNEL") %></option>
<% } else { %> <% } else { %>
<option selected="selected"><%= translate("common:NO_CHANNEL") %></option> <option selected="selected"><%= translate("dashboard:NO_CHANNEL") %></option>
<% guild.channels.cache.filter((ch) => ch.type === "GUILD_TEXT").forEach((ch) => { %> <% guild.channels.cache.filter(ch => ch.type === ChannelType.GuildText).forEach(ch => { %>
<option>#<%= ch.name %></option> <option>#<%= ch.name %></option>
<% }); %> <% }); %>
<% } %> <% } %>
</select> </select>
</div> </div>
<div class="form-group"> <div class="form-group">
<label><%= translate("common:REPORTS") %></label> <label><%= translate("dashboard:REPORTS") %></label>
<select class="form-control" name="reports"> <select class="form-control" name="reports">
<% if (guild.plugins.reports && bot.channels.cache.has(guild.plugins.reports)) { %> <% if (guild.plugins.reports && bot.channels.cache.has(guild.plugins.reports)) { %>
<option selected="selected"> <option selected="selected">
#<%= bot.channels.cache.get(guild.plugins.reports).name %></option> #<%= bot.channels.cache.get(guild.plugins.reports).name %></option>
<% guild.channels.cache.filter((ch) => ch.type === "GUILD_TEXT" && ch.id !== guild.plugins.reports).forEach((ch) => { %> <% guild.channels.cache.filter(ch => ch.type === ChannelType.GuildText && ch.id !== guild.plugins.reports).forEach(ch => { %>
<option>#<%= ch.name %></option> <option>#<%= ch.name %></option>
<% }); %> <% }); %>
<option><%= translate("common:NO_CHANNEL") %></option> <option><%= translate("dashboard:NO_CHANNEL") %></option>
<% } else { %> <% } else { %>
<option selected="selected"><%= translate("common:NO_CHANNEL") %></option> <option selected="selected"><%= translate("dashboard:NO_CHANNEL") %></option>
<% guild.channels.cache.filter((ch) => ch.type === "GUILD_TEXT").forEach((ch) => { %> <% guild.channels.cache.filter(ch => ch.type === ChannelType.GuildText).forEach(ch => { %>
<option>#<%= ch.name %></option> <option>#<%= ch.name %></option>
<% }); %> <% }); %>
<% } %> <% } %>
</select> </select>
</div> </div>
<div class="form-group"> <div class="form-group">
<label><%= translate("common:MODLOGS") %></label> <label><%= translate("dashboard:MODLOGS") %></label>
<select class="form-control" name="modlogs"> <select class="form-control" name="modlogs">
<% if (guild.plugins.modlogs && bot.channels.cache.has(guild.plugins.modlogs)) { %> <% if (guild.plugins.modlogs && bot.channels.cache.has(guild.plugins.modlogs)) { %>
<option selected="selected"> <option selected="selected">
#<%= bot.channels.cache.get(guild.plugins.modlogs).name %></option> #<%= bot.channels.cache.get(guild.plugins.modlogs).name %></option>
<% guild.channels.cache.filter((ch) => ch.type === "GUILD_TEXT" && ch.id !== guild.plugins.modlogs).forEach((ch) => { %> <% guild.channels.cache.filter(ch => ch.type === ChannelType.GuildText && ch.id !== guild.plugins.modlogs).forEach(ch => { %>
<option>#<%= ch.name %></option> <option>#<%= ch.name %></option>
<% }); %> <% }); %>
<option><%= translate("common:NO_CHANNEL") %></option> <option><%= translate("dashboard:NO_CHANNEL") %></option>
<% } else { %> <% } else { %>
<option selected="selected"><%= translate("common:NO_CHANNEL")%></option> <option selected="selected"><%= translate("dashboard:NO_CHANNEL")%></option>
<% guild.channels.cache.filter((ch) => ch.type === "GUILD_TEXT").forEach((ch) => { %> <% guild.channels.cache.filter(ch => ch.type === ChannelType.GuildText).forEach(ch => { %>
<option>#<%= ch.name %></option> <option>#<%= ch.name %></option>
<% }); %> <% }); %>
<% } %> <% } %>
</select> </select>
</div> </div>
<div class="form-group"> <div class="form-group">
<label><%= translate("common:BIRTHDAYS") %></label> <label><%= translate("dashboard:BIRTHDAYS") %></label>
<select class="form-control" name="birthdays"> <select class="form-control" name="birthdays">
<% if (guild.plugins.birthdays && bot.channels.cache.has(guild.plugins.birthdays)) { %> <% if (guild.plugins.birthdays && bot.channels.cache.has(guild.plugins.birthdays)) { %>
<option selected="selected"> <option selected="selected">
#<%= bot.channels.cache.get(guild.plugins.birthdays).name %></option> #<%= bot.channels.cache.get(guild.plugins.birthdays).name %></option>
<% guild.channels.cache.filter((ch) => ch.type === "GUILD_TEXT" && ch.id !== guild.plugins.birthdays).forEach((ch) => { %> <% guild.channels.cache.filter(ch => ch.type === ChannelType.GuildText && ch.id !== guild.plugins.birthdays).forEach(ch => { %>
<option>#<%= ch.name %></option> <option>#<%= ch.name %></option>
<% }); %> <% }); %>
<option><%= translate("common:NO_CHANNEL") %></option> <option><%= translate("dashboard:NO_CHANNEL") %></option>
<% } else { %> <% } else { %>
<option selected="selected"><%= translate("common:NO_CHANNEL") %></option> <option selected="selected"><%= translate("dashboard:NO_CHANNEL") %></option>
<% guild.channels.cache.filter((ch) => ch.type === "GUILD_TEXT").forEach((ch) => { %> <% guild.channels.cache.filter(ch => ch.type === ChannelType.GuildText).forEach(ch => { %>
<option>#<%= ch.name %></option> <option>#<%= ch.name %></option>
<% }); %> <% }); %>
<% } %> <% } %>
@ -234,13 +252,13 @@
<option selected="selected"> <option selected="selected">
#<%= bot.channels.cache.get(guild.plugins.welcome.channel).name %> #<%= bot.channels.cache.get(guild.plugins.welcome.channel).name %>
</option> </option>
<% guild.channels.cache.filter((ch) => ch.id !== guild.plugins.welcome.channel && ch.type === "GUILD_TEXT").forEach((ch) => { %> <% guild.channels.cache.filter(ch => ch.id !== guild.plugins.welcome.channel && ch.type === ChannelType.GuildText).forEach(ch => { %>
<option>#<%= ch.name %></option> <option>#<%= ch.name %></option>
<% }); } else { %> <% }); } else { %>
<option selected="selected"> <option selected="selected">
#<%= guild.channels.cache.filter((ch) => ch.type === "GUILD_TEXT").first().name %> #<%= guild.channels.cache.filter(ch => ch.type === ChannelType.GuildText).first().name %>
</option> </option>
<% guild.channels.cache.filter((ch) => ch.id !== guild.channels.cache.first().id && ch.type === "GUILD_TEXT").forEach((ch) => { %> <% guild.channels.cache.filter(ch => ch.id !== guild.channels.cache.first().id && ch.type === ChannelType.GuildText).forEach(ch => { %>
<option>#<%= ch.name %></option> <option>#<%= ch.name %></option>
<% }); %> <% }); %>
<% } %> <% } %>
@ -297,13 +315,13 @@
<option selected="selected"> <option selected="selected">
#<%= bot.channels.cache.get(guild.plugins.goodbye.channel).name %> #<%= bot.channels.cache.get(guild.plugins.goodbye.channel).name %>
</option> </option>
<% guild.channels.cache.filter((ch) => ch.id !== guild.plugins.goodbye.channel && ch.type === "GUILD_TEXT").forEach((ch) => { %> <% guild.channels.cache.filter(ch => ch.id !== guild.plugins.goodbye.channel && ch.type === ChannelType.GuildText).forEach(ch => { %>
<option>#<%= ch.name %></option> <option>#<%= ch.name %></option>
<% }); } else { %> <% }); } else { %>
<option selected="selected"> <option selected="selected">
#<%= guild.channels.cache.filter((ch) => ch.type === "GUILD_TEXT").first().name %> #<%= guild.channels.cache.filter(ch => ch.type === ChannelType.GuildText).first().name %>
</option> </option>
<% guild.channels.cache.filter((ch) => ch.id !== guild.channels.cache.first().id && ch.type === "GUILD_TEXT").forEach((ch) => { %> <% guild.channels.cache.filter(ch => ch.id !== guild.channels.cache.first().id && ch.type === ChannelType.GuildText).forEach(ch => { %>
<option>#<%= ch.name %></option> <option>#<%= ch.name %></option>
<% }); %> <% }); %>
<% } %> <% } %>

View file

@ -63,8 +63,7 @@ class GuildMemberAdd extends BaseEvent {
const message = guildData.plugins.welcome.message const message = guildData.plugins.welcome.message
.replace(/{user}/g, member) .replace(/{user}/g, member)
.replace(/{server}/g, member.guild.name) .replace(/{server}/g, member.guild.name)
.replace(/{membercount}/g, member.guild.memberCount) .replace(/{membercount}/g, member.guild.memberCount);
.replace(/{createdat}/g, client.printDate(member.user.createdAt));
if (guildData.plugins.welcome.withImage) { if (guildData.plugins.welcome.withImage) {
const canvas = Canvas.createCanvas(1024, 450), const canvas = Canvas.createCanvas(1024, 450),
ctx = canvas.getContext("2d"); ctx = canvas.getContext("2d");

View file

@ -46,8 +46,7 @@ class GuildMemberRemove extends BaseEvent {
const message = guildData.plugins.goodbye.message const message = guildData.plugins.goodbye.message
.replace(/{user}/g, member.user.tag) .replace(/{user}/g, member.user.tag)
.replace(/{server}/g, member.guild.name) .replace(/{server}/g, member.guild.name)
.replace(/{membercount}/g, member.guild.memberCount) .replace(/{membercount}/g, member.guild.memberCount);
.replace(/{createdat}/g, client.printDate(member.user.createdAt));
if (guildData.plugins.goodbye.withImage) { if (guildData.plugins.goodbye.withImage) {
const canvas = Canvas.createCanvas(1024, 450), const canvas = Canvas.createCanvas(1024, 450),
ctx = canvas.getContext("2d"); ctx = canvas.getContext("2d");

View file

@ -31,7 +31,7 @@ class MessageCreate extends BaseEvent {
const guild = await client.findOrCreateGuild({ const guild = await client.findOrCreateGuild({
id: message.guild.id id: message.guild.id
}); });
message.guild.data = data.guild = guild; message.guild.data = data.guildData = guild;
} }
if (message.content.match(new RegExp(`^<@!?${client.user.id}>( |)$`))) return message.replyT("misc:HELLO_SERVER", { username: message.author.username }); if (message.content.match(new RegExp(`^<@!?${client.user.id}>( |)$`))) return message.replyT("misc:HELLO_SERVER", { username: message.author.username });
@ -52,7 +52,7 @@ class MessageCreate extends BaseEvent {
if (message.guild) { if (message.guild) {
await updateXp(client, message, data); await updateXp(client, message, data);
if (data.guild.plugins.automod.enabled && !data.guild.plugins.automod.ignored.includes(message.channel.id)) { if (data.guildData.plugins.automod.enabled && !data.guildData.plugins.automod.ignored.includes(message.channel.id)) {
if (/(discord\.(gg|io|me|li)\/.+|discordapp\.com\/invite\/.+)/i.test(message.content)) { if (/(discord\.(gg|io|me|li)\/.+|discordapp\.com\/invite\/.+)/i.test(message.content)) {
if (!message.channel.permissionsFor(message.member).has(PermissionsBitField.Flags.ManageMessages)) { if (!message.channel.permissionsFor(message.member).has(PermissionsBitField.Flags.ManageMessages)) {
message.delete(); message.delete();

View file

@ -1,4 +1,4 @@
const { PermissionsBitField } = require("discord.js"), const { PermissionsBitField, ChannelType } = require("discord.js"),
langs = require("../languages/language-meta.json").map((l) => l.moment).filter((l) => l !== "en"); langs = require("../languages/language-meta.json").map((l) => l.moment).filter((l) => l !== "en");
langs.forEach((lang) => { langs.forEach((lang) => {
require(`moment/locale/${lang}.js`); require(`moment/locale/${lang}.js`);
@ -8,7 +8,7 @@ module.exports = {
async createInvite(client, guildId) { async createInvite(client, guildId) {
const guild = client.guilds.cache.get(guildId); const guild = client.guilds.cache.get(guildId);
const member = guild.members.me; const member = guild.members.me;
const channel = guild.channels.cache.find((ch) => ch.permissionsFor(member.id).has(PermissionsBitField.Flags.CreateInstantInvite) && ch.type === "GUILD_TEXT" || ch.type === "GUILD_VOICE"); const channel = guild.channels.cache.find(ch => ch.permissionsFor(member.id).has(PermissionsBitField.Flags.CreateInstantInvite) && ch.type === ChannelType.GuildText || ch.type === "GUILD_VOICE");
if (channel) { if (channel) {
const invite = await channel.createInvite(); const invite = await channel.createInvite();

View file

@ -7,15 +7,15 @@ const { EmbedBuilder, ButtonBuilder, ActionRowBuilder, ButtonStyle } = require("
* @param {Array} options * @param {Array} options
*/ */
/** /**
slash => Boolean slash => Boolean
userSlash => String userSlash => String
resultBtn => Boolean resultBtn => Boolean
embedFoot => String embedFoot => String
embedColor => HexColor embedColor => HexColor
timeoutEmbedColor => HexColor timeoutEmbedColor => HexColor
xEmoji => (Emoji ID) String xEmoji => (Emoji ID) String
oEmoji => (Emoji ID) String oEmoji => (Emoji ID) String
idleEmoji => (Emoji ID) String idleEmoji => (Emoji ID) String
*/ */
async function tictactoe(interaction, options = {}) { async function tictactoe(interaction, options = {}) {
// eslint-disable-next-line no-async-promise-executor // eslint-disable-next-line no-async-promise-executor
@ -79,12 +79,12 @@ async function tictactoe(interaction, options = {}) {
.setTimestamp(); .setTimestamp();
const accept = new ButtonBuilder() const accept = new ButtonBuilder()
.setLabel(interaction.translate("economy/tictactoe:ACCEPT")) .setLabel(interaction.translate("common:ACCEPT"))
.setStyle("SUCCESS") .setStyle("SUCCESS")
.setCustomId("acceptttt"); .setCustomId("acceptttt");
const decline = new ButtonBuilder() const decline = new ButtonBuilder()
.setLabel(interaction.translate("economy/tictactoe:DECLINE")) .setLabel(interaction.translate("common:DECLINE"))
.setStyle("DANGER") .setStyle("DANGER")
.setCustomId("declinettt"); .setCustomId("declinettt");

View file

@ -1,10 +0,0 @@
{
"DESCRIPTION": "Добавить эмодзи на сервер!",
"USAGE": "addemoji [ссылка-на-изображение] [название]",
"EXAMPLES": "addemoji https://via.placeholder.com/150 placeholder",
"MISSING_URL": "Укажите ссылку на изображение!",
"MISSING_NAME": "Укажите название эмодзи!",
"INVALID_NAME": "Название эмодзи должно быть от 2 до 32 символов!",
"SUCCESS": "{{emoji}} добавлен!",
"ERROR": "{{emoji}} не был добавлен. Проверьте, есть ли место для добавления эмодзи!"
}

View file

@ -1,10 +1,9 @@
{ {
"DESCRIPTION": "Включить или отключить автоназначение роли при входе на сервер!", "DESCRIPTION": "Включить или отключить автоназначение роли при входе на сервер!",
"USAGE": "autorole [on/off] (@роль)", "USAGE": "autorole [true/false] (@роль)",
"EXAMPLES": "autorole on @новенький\nautorole off", "EXAMPLES": "autorole true @новенький\nautorole false",
"MISSING_STATUS": "Укажите значение `on` или `off`!",
"MISSING_ROLE": "Укажите роль!", "MISSING_ROLE": "Укажите роль!",
"SUCCESS_ENABLED": "Автоназначение роли включено! Новые пользователи будут автоматически получать **{{roleName}}** при входе на сервер.", "SUCCESS_ENABLED": "Автоназначение роли включено!\nНовые пользователи будут автоматически получать **{{roleName}}** при входе на сервер.",
"ALREADY_DISABLED": "**Автоназначение роли уже отключено.**\n\n:arrow_right_hook: *Используйте `autorole on @роль`, чтобы включить!*", "ALREADY_DISABLED": "**Автоназначение роли уже отключено.**\n\n*Используйте `autorole true @роль`, чтобы включить!*",
"SUCCESS_DISABLED": "**Автоназначение роли отключено!**\n\n:arrow_right_hook: *Используйте `configuration`, чтобы увидеть обновлённые настройки!*" "SUCCESS_DISABLED": "**Автоназначение роли отключено!**\n\n*Используйте `config`, чтобы увидеть обновлённые настройки!*"
} }

View file

@ -1,35 +1,30 @@
{ {
"DESCRIPTION": "Показать конфигурацию сервера!", "DESCRIPTION": "Показать конфигурацию сервера",
"USAGE": "configuration", "USAGE": "config",
"EXAMPLES": "configuration", "EXAMPLES": "config",
"PREFIX_TITLE": "Префикс", "PREFIX_TITLE": "Префикс",
"IGNORED_CHANNELS_TITLE": "Игнорируемые каналы",
"NO_IGNORED_CHANNELS": "Нет игнорируемых каналов.",
"AUTOROLE_TITLE": "Автоназначение роли при входе", "AUTOROLE_TITLE": "Автоназначение роли при входе",
"AUTOROLE_CONTENT": "Роль: {{roleName}}",
"AUTOROLE_DISABLED": "Автоназначение роли отключено.", "AUTOROLE_DISABLED": "Автоназначение роли отключено.",
"WELCOME_TITLE": "Приветствие", "WELCOME_TITLE": "Приветствие",
"WELCOME_CONTENT": "Канал: {{channel}}\nКарточка: {{withImage}}", "WELCOME_CONTENT": "Канал: {{channel}}\nКарточка: {{withImage}}",
"WELCOME_DISABLED": "Сообщения отключены.",
"GOODBYE_TITLE": "Прощание", "GOODBYE_TITLE": "Прощание",
"GOODBYE_CONTENT": "Канал: {{channel}}\nКарточка: {{withImage}}", "GOODBYE_CONTENT": "Канал: {{channel}}\nКарточка: {{withImage}}",
"GOODBYE_DISABLED": "Сообщения отключены.",
"SPECIAL_CHANNELS": "Специальные каналы", "SPECIAL_CHANNELS": "Специальные каналы",
"MODLOGS": "Логи модерации: *{{channel}}*", "NEWS": "Новости бота: {{channel}}",
"BIRTHDAYS": "Поздравления с днём рождения: *{{channel}}*", "MODLOGS": "Логи модерации: {{channel}}",
"SUGGESTIONS": "Предложения: *{{channel}}*", "BIRTHDAYS": "Поздравления с днём рождения: {{channel}}",
"SUGGESTIONS": "Предложения: {{channel}}",
"REPORTS": "Жалобы: *{{channel}}*", "REPORTS": "Жалобы: *{{channel}}*",
"AUTOMOD_TITLE": "Автомодерация", "AUTOMOD_TITLE": "Автомодерация",
"AUTOMOD_CONTENT": "Автомодерация включена.\n*Игнорируемые каналы: {{channels}}*", "AUTOMOD_CONTENT": "Автомодерация включена.\n*Игнорируемые каналы: {{channels}}*",
"AUTOMOD_DISABLED": "Автомодерация отключена.",
"AUTODELETEMOD": "Автоудаление команд модерации", "AUTODELETEMOD": "Автоудаление команд модерации",
"AUTODELETEMOD_ENABLED": "Автоудаление команд модерации включено.", "AUTODELETEMOD_ENABLED": "Автоудаление команд модерации включено.",
"AUTODELETEMOD_DISABLED": "Автоудаление команд модерации отключено.", "AUTODELETEMOD_DISABLED": "Автоудаление команд модерации отключено.",
"DASHBOARD_TITLE": "Изменить настройки",
"DASHBOARD_CONTENT": "Нажмите сюда, чтобы перейти в панель управления!",
"AUTO_SANCTIONS": "Автоматические наказания", "AUTO_SANCTIONS": "Автоматические наказания",
"KICK_CONTENT": "Кик: После **{{count}}** предупреждений.", "KICK_CONTENT": "Кик: После **{{count}}** предупреждений.",
"KICK_NOT_DEFINED": "Кик: Не назначено.", "KICK_NOT_DEFINED": "Кик: Не назначено.",
"BAN_CONTENT": "Бан: После **{{count}}** предупреждений.", "BAN_CONTENT": "Бан: После **{{count}}** предупреждений.",
"BAN_NOT_DEFINED": "Бан: Не назначено." "BAN_NOT_DEFINED": "Бан: Не назначено.",
"DASHBOARD_TITLE": "Изменить настройки",
"DASHBOARD_CONTENT": "Нажмите сюда, чтобы перейти в панель управления!"
} }

View file

@ -1,8 +1,7 @@
{ {
"DESCRIPTION": "Включить или отключить автоудаление команд модерации!", "DESCRIPTION": "Включить или отключить автоудаление команд модерации!",
"USAGE": "deletemod [on/off]", "USAGE": "deletemod [true/false]",
"EXAMPLES": "deletemod on", "EXAMPLES": "deletemod on",
"MISSING_STATUS": "Укажите значение `on` или `off`!",
"ENABLED": "Автоудаление команд модерации включено!", "ENABLED": "Автоудаление команд модерации включено!",
"DISABLED": "Автоудаление команд модерации отключено!" "DISABLED": "Автоудаление команд модерации отключено!"
} }

View file

@ -1,16 +1,14 @@
{ {
"DESCRIPTION": "Включить или отключить сообщения при выходе пользователя с сервера!", "DESCRIPTION": "Включить или отключить сообщения при выходе пользователя с сервера!",
"USAGE": "goodbye (edit/off/test)", "USAGE": "goodbye (test)",
"EXAMPLES": "goodbye\ngoodbye test", "EXAMPLES": "goodbye\ngoodbye test",
"MISSING_STATUS": "Выберите действие: `edit`, `off` или `test`!", "TEST": "Проверить",
"DEFAULT_MESSAGE": "Пока, {user}! Нас теперь {membercount} без тебя :'(",
"TEST_SUCCESS": "Тест выполнен!", "TEST_SUCCESS": "Тест выполнен!",
"FORM_1": "**В какой канал будут отправляться сообщения?**\n\n:arrow_right_hook: *Отправьте упоминание канала!*", "CONFIG": "Настроить",
"FORM_2": "**Укажите ваше сообщение.**\n\n**Если необходимо:**\n*-* __Упомянуть пользователя__: {user}\n*-* __Количество участников__: {membercount}\n*-* __Название сервера__: {server}\n\n**Например:**\nПрощай, {user}, мы будем скучать! Теперь нас {membercount}.\n:fast_forward:\nПрощай, {{author}}, мы будем скучать! Теперь нас {{memberCount}}.", "IMAGE": "Добавить карточку к сообщению?",
"FORM_3": "**Вы хотите добавить карточку к сообщению?**\n\n:arrow_right_hook: *Отправьте `да` или `нет`!*", "ENABLED": "**Прощальные сообщения включены в {{channel}}!**\n*Используйте `goodbye test` для предпросмотра вашего сообщения!*",
"FORM_SUCCESS": "**Готово!**\n\n:arrow_right_hook: *Используйте `goodbye test` для предпросмотра вашего сообщения!*", "DISABLED": "Прощальные сообщения отключены!",
"MAX_CHARACT": "Ваше сообщение должно быть не более 1800 символов!", "DEFAULT_MESSAGE": "Пока, {user}! Нас теперь {membercount} без тебя :'(",
"DISABLED": "**Сообщения отключены!**\n\n:arrow_right_hook: *Используйте `configuration`, чтобы увидеть обновлённые настройки!*",
"IMG_GOODBYE": "Вышел с {{server}}!", "IMG_GOODBYE": "Вышел с {{server}}!",
"TITLE": "До встречи!" "TITLE": "До встречи!"
} }

View file

@ -1,13 +1,6 @@
{ {
"DESCRIPTION": "Изменить пользователю опыт, уровень, кредиты или банк!", "DESCRIPTION": "Изменить пользователю опыт, уровень, кредиты или банк",
"USAGE": "set [level/xp/credits/bank] [@пользователь] [значение]", "USAGE": "set [level/xp/credits/bank] [@пользователь] [значение]",
"EXAMPLES": "set level @Jonny_Bro#4226 10", "EXAMPLES": "set level @Jonny_Bro#4226 10",
"INVALID_MEMBER": "Вы должны упомянуть пользователя!", "INVALID_NUMBER": "Значение должно быть больше нуля"
"NO_STATUS": "Выберите значение: `level`, `xp`, `credits` или `bank`!",
"BOT_USER": "Вы не можете изменить статистику бота!",
"INVALID_AMOUNT": "Укажите новое значение!",
"SUCCESS_LEVEL": "Уровень пользователя **{{username}}** изменён на **{{amount}}**!",
"SUCCESS_XP": "XP пользователя **{{username}}** изменён на **{{amount}}**!",
"SUCCESS_CREDITS": "Кредиты пользователя **{{username}}** изменены на **{{amount}}**!",
"SUCCESS_BANK": "Банк пользователя **{{username}}** изменён на **{{amount}}**!"
} }

View file

@ -1,7 +1,7 @@
{ {
"DESCRIPTION": "Установить канал для поздравлений с днём рождения!", "DESCRIPTION": "Установить канал для поздравлений с днём рождения",
"USAGE": "setbirthdays (#канал)", "USAGE": "setbirthdays (#канал)",
"EXAMPLES": "setbirthdays #дни-рождения\nsetbirthdays", "EXAMPLES": "setbirthdays #дни-рождения\nsetbirthdays",
"ENABLED": "Поздравления включены в канале **{{channel}}**!", "ENABLED": "Поздравления включены в канале **{{channel}}**",
"DISABLED": "Поздравления отключены!" "DISABLED": "Поздравления отключены"
} }

View file

@ -2,6 +2,6 @@
"DESCRIPTION": "Установить канал для новостей бота", "DESCRIPTION": "Установить канал для новостей бота",
"USAGE": "setnews (#канал)", "USAGE": "setnews (#канал)",
"EXAMPLES": "setnews #bot-news\nsetnews", "EXAMPLES": "setnews #bot-news\nsetnews",
"ENABLED": "Поздравления включены в канале **{{channel}}**!", "ENABLED": "Новости бота включены в канале **{{channel}}**!",
"DISABLED": "Поздравления отключены!" "DISABLED": "Новости бота отключены!"
} }

View file

@ -1,16 +1,10 @@
{ {
"DESCRIPTION": "Включить или отключить сообщения при входе пользователя на сервер!", "DESCRIPTION": "Включить или отключить сообщения при входе пользователя на сервер!",
"USAGE": "welcome (edit/off/test)", "USAGE": "welcome (test)",
"EXAMPLES": "welcome\nwelcome test", "EXAMPLES": "welcome\nwelcome test",
"MISSING_STATUS": "Выберите действие: `edit`, `off` или `test`!", "ENABLED": "**Приветствующие сообщения включены в {{channel}}!**\n*Используйте `welcome test` для предпросмотра вашего сообщения!*",
"DEFAULT_MESSAGE": "Добро пожаловать в {server}, {user}, теперь нас {membercount}! Ваш аккаунт был создан {createdat}.", "DISABLED": "Приветствующие сообщения отключены!",
"TEST_SUCCESS": "Тест выполнен!", "DEFAULT_MESSAGE": "Добро пожаловать {user}! Нас теперь {membercount}!",
"FORM_1": "**В какой канал будут отправляться сообщения?**\n\n:arrow_right_hook: *Отправьте упоминание канала!*", "IMG_WELCOME": "Добро пожаловать на {{server}}!",
"FORM_2": "**Укажите ваше сообщение.**\n\n**Если необходимо:**\n*-* __Упомянуть пользователя__: {user}\n*-* __Количество участников__: {membercount}\n*-* __Название сервера__: {server}\n\n**Например:**\nДобро пожаловать на сервер {server}, {user}! Теперь нас {membercount}!\n:fast_forward:\nДобро пожаловать на сервер {{guildName}}, {{author}}! Теперь нас {{memberCount}}!",
"FORM_3": "**Вы хотите добавить карточку к сообщению?**\n\n:arrow_right_hook: *Отправьте `да` или `нет`!*",
"FORM_SUCCESS": "**Готово!**\n\n:arrow_right_hook: *Используйте `welcome test` для предпросмотра вашего приветственного сообщения!*",
"MAX_CHARACT": "Ваше сообщение должно быть не более 1800 символов!",
"DISABLED": "**Сообщения отключены!**\n\n:arrow_right_hook: *Используйте `configuration`, чтобы увидеть обновлённые настройки!*",
"IMG_WELCOME": "Добро пожаловать в {{server}}!",
"TITLE": "Добро пожаловать!" "TITLE": "Добро пожаловать!"
} }

View file

@ -3,6 +3,11 @@
"NO": "Нет", "NO": "Нет",
"ACCEPT": "Принять", "ACCEPT": "Принять",
"CANCEL": "Отменить", "CANCEL": "Отменить",
"DECLINE": "Отказаться",
"ENABLE": "Включить",
"DISABLE": "Выключить",
"ENABLED": "Включено",
"DISABLED": "Отключено",
"NOT_DEFINED": "Не установлено", "NOT_DEFINED": "Не установлено",
"AUTHOR": "Автор", "AUTHOR": "Автор",
"DATE": "Дата", "DATE": "Дата",
@ -18,6 +23,7 @@
"OWNER": "Владелец", "OWNER": "Владелец",
"USERNAME": "Имя пользователя", "USERNAME": "Имя пользователя",
"STATS": "Статистика", "STATS": "Статистика",
"STATE": "Состояние",
"ROBOT": "Бот", "ROBOT": "Бот",
"ACTIVITY": "Активность", "ACTIVITY": "Активность",
"STATUS": "Статус", "STATUS": "Статус",
@ -56,12 +62,7 @@
"LANGUAGE": "Язык", "LANGUAGE": "Язык",
"CHANNEL": "Канал", "CHANNEL": "Канал",
"UPDATE": "Обновить", "UPDATE": "Обновить",
"SUGGESTIONS": "Предложения",
"MODLOGS": "Логи модерации",
"NO_CHANNEL": "Канал не выбран",
"REPORTS": "Жалобы",
"UNKNOWN": "Неизвестно", "UNKNOWN": "Неизвестно",
"NOTHING_SELECTED": "Ничего не выбрано", "NOTHING_SELECTED": "Ничего не выбрано",
"AVAILABLE_CATEGORIES": "Доступные категории:", "AVAILABLE_OPTIONS": "Доступные параметры:"
"BIRTHDAYS": "Поздравления с днём рождения"
} }

View file

@ -20,6 +20,12 @@
"DISABLE_MESSAGES": "Отключить", "DISABLE_MESSAGES": "Отключить",
"ENABLE_AUTOROLE": "Включить", "ENABLE_AUTOROLE": "Включить",
"DISABLE_AUTOROLE": "Выключить", "DISABLE_AUTOROLE": "Выключить",
"NO_CHANNEL": "Канал не выбран",
"NEWS": "Новости бота",
"REPORTS": "Жалобы",
"MODLOGS": "Логи модерации",
"SUGGESTIONS": "Предложения",
"BIRTHDAYS": "Поздравления с днём рождения",
"SELECTOR": "Выбор серверов", "SELECTOR": "Выбор серверов",
"STATS": "Статистика", "STATS": "Статистика",
"MANAGE": "Управление", "MANAGE": "Управление",

View file

@ -5,8 +5,6 @@
"NO_USER": "Укажите пользователя!", "NO_USER": "Укажите пользователя!",
"BOT_USER": "Вы не можете играть против бота!", "BOT_USER": "Вы не можете играть против бота!",
"YOURSELF": "Вы не можете играть с самим собой!", "YOURSELF": "Вы не можете играть с самим собой!",
"ACCEPT": "Принять",
"DECLINE": "Отказаться",
"INVITE_USER": "<@{{opponent}}>, вам предложили сыграть в крестики-нолики!", "INVITE_USER": "<@{{opponent}}>, вам предложили сыграть в крестики-нолики!",
"REQUEST_SEND": "Запрос отправлен <@{{opponent}}>", "REQUEST_SEND": "Запрос отправлен <@{{opponent}}>",
"REQUEST_WAIT": "Ожидаю ответа {{user}}", "REQUEST_WAIT": "Ожидаю ответа {{user}}",

View file

@ -4,7 +4,7 @@
"EXAMPLES": "", "EXAMPLES": "",
"YOURSELF": "Вы не можете подать жалобу на себя!", "YOURSELF": "Вы не можете подать жалобу на себя!",
"MODAL_TITLE": "Выдать предупреждение {{nickname}}", "MODAL_TITLE": "Выдать предупреждение {{nickname}}",
"REASON": "Причина предупреждения", "MODAL_REASON": "Причина предупреждения",
"WARNED_DM": "Вы получили предупреждение на сервере **{{server}}** от пользователя **{{moderator}}** по причине **{{reason}}**!", "WARNED_DM": "Вы получили предупреждение на сервере **{{server}}** от пользователя **{{moderator}}** по причине **{{reason}}**!",
"WARNED": "**{{username}}** получил предупреждение по причине **{{reason}}**!", "WARNED": "**{{username}}** получил предупреждение по причине **{{reason}}**!",
"CASE": "Предупрежение | Номер #{{caseNumber}}" "CASE": "Предупрежение | Номер #{{caseNumber}}"

View file

@ -11,7 +11,5 @@
"REPEAT": "Повтор", "REPEAT": "Повтор",
"AUTOPLAY": "Автовоспроизведение", "AUTOPLAY": "Автовоспроизведение",
"QUEUE": "Очереди", "QUEUE": "Очереди",
"TRACK": "Трека", "TRACK": "Трека"
"ENABLED": "Вкл.",
"DISABLED": "Выкл."
} }

View file

@ -6,5 +6,5 @@
"MISSING_ROLE": "Вкажіть роль!", "MISSING_ROLE": "Вкажіть роль!",
"SUCCESS_ENABLED": "Автопризначення ролі увімкнено! Нові користувачі автоматично отримуватимуть **{{roleName}}** під час входу на сервер.", "SUCCESS_ENABLED": "Автопризначення ролі увімкнено! Нові користувачі автоматично отримуватимуть **{{roleName}}** під час входу на сервер.",
"ALREADY_DISABLED": "**Автопризначення ролі вже вимкнено.**\n\n:arrow_right_hook: *Використовуйте `autorole on @роль`, щоб увімкнути!*", "ALREADY_DISABLED": "**Автопризначення ролі вже вимкнено.**\n\n:arrow_right_hook: *Використовуйте `autorole on @роль`, щоб увімкнути!*",
"SUCCESS_DISABLED": "**Автопризначення ролі вимкнено!**\n\n:arrow_right_hook: *Використовуйте `configuration`, щоб побачити оновлені налаштування!*" "SUCCESS_DISABLED": "**Автопризначення ролі вимкнено!**\n\n:arrow_right_hook: *Використовуйте `config`, щоб побачити оновлені налаштування!*"
} }

View file

@ -10,7 +10,7 @@
"FORM_3": "**Ви хочете додати картку до повідомлення?**\n\n:arrow_right_hook: *Надішліть `так` або `ні`!*", "FORM_3": "**Ви хочете додати картку до повідомлення?**\n\n:arrow_right_hook: *Надішліть `так` або `ні`!*",
"FORM_SUCCESS": "**Готово!**\n\n:arrow_right_hook: *Використовуйте `goodbye test` для перегляду вашого повідомлення!*", "FORM_SUCCESS": "**Готово!**\n\n:arrow_right_hook: *Використовуйте `goodbye test` для перегляду вашого повідомлення!*",
"MAX_CHARACT": "Ваше повідомлення не повинно перевищувати 1800 символів!", "MAX_CHARACT": "Ваше повідомлення не повинно перевищувати 1800 символів!",
"DISABLED": "**Повідомлення вимкнено!**\n\n:arrow_right_hook: *Використовуйте `configuration`, щоб побачити оновлені налаштування!*", "DISABLED": "**Повідомлення вимкнено!**\n\n:arrow_right_hook: *Використовуйте `config`, щоб побачити оновлені налаштування!*",
"IMG_GOODBYE": "Вийшов з {{server}}!", "IMG_GOODBYE": "Вийшов з {{server}}!",
"TITLE": "До зустрічі!" "TITLE": "До зустрічі!"
} }

View file

@ -10,7 +10,7 @@
"FORM_3": "**Ви хочете додати картку до повідомлення?**\n\n:arrow_right_hook: *Надішліть `так` або `ні`!*", "FORM_3": "**Ви хочете додати картку до повідомлення?**\n\n:arrow_right_hook: *Надішліть `так` або `ні`!*",
"FORM_SUCCESS": "**Готово!**\n\n:arrow_right_hook: *Використовуйте `welcome test` для перегляду вашого вітального повідомлення!*", "FORM_SUCCESS": "**Готово!**\n\n:arrow_right_hook: *Використовуйте `welcome test` для перегляду вашого вітального повідомлення!*",
"MAX_CHARACT": "Ваше повідомлення не повинно перевищувати 1800 символів!", "MAX_CHARACT": "Ваше повідомлення не повинно перевищувати 1800 символів!",
"DISABLED": "**Повідомлення вимкнено!**\n\n:arrow_right_hook: *Використовуйте `configuration`, щоб побачити оновлені настройки!*", "DISABLED": "**Повідомлення вимкнено!**\n\n:arrow_right_hook: *Використовуйте `config`, щоб побачити оновлені настройки!*",
"IMG_WELCOME": "Ласкаво просимо до {{server}}!", "IMG_WELCOME": "Ласкаво просимо до {{server}}!",
"TITLE": "Ласкаво просимо!" "TITLE": "Ласкаво просимо!"
} }

4
package-lock.json generated
View file

@ -1,12 +1,12 @@
{ {
"name": "jaba", "name": "jaba",
"version": "4.0pre4", "version": "4.0pre5",
"lockfileVersion": 2, "lockfileVersion": 2,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "jaba", "name": "jaba",
"version": "4.0pre4", "version": "4.0pre5",
"license": "ISC", "license": "ISC",
"dependencies": { "dependencies": {
"@discord-player/extractor": "^3.0.2", "@discord-player/extractor": "^3.0.2",

View file

@ -1,6 +1,6 @@
{ {
"name": "jaba", "name": "jaba",
"version": "4.0pre4", "version": "4.0pre5",
"description": "My Discord Bot", "description": "My Discord Bot",
"main": "index.js", "main": "index.js",
"private": true, "private": true,