Перенесена категория General

Удалён мусор и ненужные комментарии
This commit is contained in:
JonnyBro 2022-08-04 19:26:17 +05:00
parent d11a4a9257
commit 5f4c53b072
67 changed files with 1180 additions and 1337 deletions

View file

@ -1,5 +1,4 @@
const Command = require("../../base/Command"),
Resolvers = require("../../helpers/resolvers");
const Command = require("../../base/Command");
class Autorole extends Command {
constructor(client) {

View file

@ -31,10 +31,6 @@ class Configuration extends Command {
});
embed.addFields([
{ // Guild prefix
name: message.translate("administration/configuration:PREFIX_TITLE"),
value: guildData.prefix
},
{ // 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")

View file

@ -1,5 +1,4 @@
const Command = require("../../base/Command"),
Resolvers = require("../../helpers/resolvers");
const Command = require("../../base/Command");
class Goodbye extends Command {
constructor(client) {

View file

@ -1,5 +1,4 @@
const Command = require("../../base/Command"),
Resolvers = require("../../helpers/resolvers");
const Command = require("../../base/Command");
class Setbirthdays extends Command {
constructor(client) {

View file

@ -1,5 +1,4 @@
const Command = require("../../base/Command"),
Resolvers = require("../../helpers/resolvers");
const Command = require("../../base/Command");
class Setmodlogs extends Command {
constructor(client) {

View file

@ -1,33 +0,0 @@
const Command = require("../../base/Command");
class Setprefix extends Command {
constructor(client) {
super(client, {
name: "setprefix",
dirname: __dirname,
enabled: true,
guildOnly: true,
aliases: ["setp"],
memberPermissions: ["MANAGE_GUILD"],
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS"],
nsfw: false,
ownerOnly: false,
cooldown: 1000
});
}
async run(message, args, data) {
const prefix = args[0];
if (!prefix) return message.error("administration/setprefix:MISSING_PREFIX");
if (prefix.length > 5) return message.error("administration/setprefix:TOO_LONG");
data.guild.prefix = prefix;
data.guild.save();
return message.success("administration/setprefix:SUCCESS", {
prefix
});
}
}
module.exports = Setprefix;

View file

@ -1,5 +1,4 @@
const Command = require("../../base/Command"),
Resolvers = require("../../helpers/resolvers");
const Command = require("../../base/Command");
class Setreports extends Command {
constructor(client) {

View file

@ -1,5 +1,4 @@
const Command = require("../../base/Command"),
Resolvers = require("../../helpers/resolvers");
const Command = require("../../base/Command");
class Setsuggests extends Command {
constructor(client) {

View file

@ -1,5 +1,4 @@
const Command = require("../../base/Command"),
Resolvers = require("../../helpers/resolvers");
const Command = require("../../base/Command");
class Welcome extends Command {
constructor(client) {

View file

@ -1,36 +0,0 @@
const Command = require("../../base/Command");
class Avatar extends Command {
constructor(client) {
super(client, {
name: "avatar",
dirname: __dirname,
enabled: true,
guildOnly: false,
aliases: [],
memberPermissions: [],
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS", "ATTACH_FILES"],
nsfw: false,
ownerOnly: false,
cooldown: 3000
});
}
async run(message, args) {
let user = await this.client.resolveUser(args[0]);
if (!user) user = message.author;
const avatarURL = user.displayAvatarURL({
size: 512
});
if (args[0] === "link") return message.reply({ content: `<${avatarURL}>` });
message.reply({
files: [{
attachment: avatarURL
}]
});
}
}
module.exports = Avatar;

View file

@ -1,57 +0,0 @@
const Command = require("../../base/Command"),
{ EmbedBuilder, parseEmoji } = require("discord.js");
class EmojiInfo extends Command {
constructor(client) {
super(client, {
name: "emoji",
dirname: __dirname,
enabled: true,
guildOnly: false,
aliases: ["emi"],
memberPermissions: [],
botPermissions: ["SEND_MESSAGES"],
nsfw: false,
ownerOnly: false,
cooldown: 2000
});
}
async run(message, args, data) {
const rawEmoji = args[0];
if (!rawEmoji) return message.error("administration/stealemoji:MISSING_EMOJI");
const parsedEmoji = parseEmoji(rawEmoji);
const embed = new EmbedBuilder()
.setAuthor({
name: message.translate("general/emoji:TITLE", {
emoji: parsedEmoji.name
})
})
.setColor(data.config.embed.color)
.setFooter({
text: data.config.embed.footer
})
.addFields([
{
name: message.translate("general/emoji:NAME"),
value: parsedEmoji.name
},
{
name: message.translate("general/emoji:ANIMATED"),
value: parsedEmoji.animated ? message.translate("common:YES") : message.translate("common:NO")
},
{
name: message.translate("general/emoji:ID"),
value: parsedEmoji.id ? parsedEmoji.id.toString() : message.translate("general/emoji:STANDART")
}
]);
message.reply({
embeds: [embed]
});
}
}
module.exports = EmojiInfo;

View file

@ -1,105 +0,0 @@
const Command = require("../../base/Command"),
Discord = require("discord.js"),
gamedig = require("gamedig");
class Minecraft extends Command {
constructor(client) {
super(client, {
name: "minecraft",
dirname: __dirname,
enabled: true,
guildOnly: false,
aliases: ["mc"],
memberPermissions: [],
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS"],
nsfw: false,
ownerOnly: false,
cooldown: 1000
});
}
async run(message, args, data) {
const ip = args[0];
if (!ip) return message.error("general/minecraft:MISSING_IP");
const favicon = `https://eu.mc-api.net/v3/server/favicon/${ip}`;
let options = {
type: "minecraft",
host: ip
};
if (ip.split(":").length > 1) {
const ipp = ip.split(":");
options = {
type: "minecraft",
host: ipp[0],
port: ipp[1]
};
}
const m = await message.sendT("misc:PLEASE_WAIT", null, {
prefixEmoji: "loading"
});
let json = null;
await gamedig.query(options).then((res) => {
json = res;
}).catch((err) => {
console.error(err);
});
if (!json) {
options.type = "minecraftpe";
await gamedig.query(options).then((res) => {
json = res;
}).catch((err) => {
console.error(err);
});
}
if (!json) return m.error("general/minecraft:FAILED", null, { edit: true });
const embed = new Discord.EmbedBuilder()
.setAuthor({
name: json.name
})
.addFields([
{
name: message.translate("general/minecraft:FIELD_STATUS"),
value: message.translate("general/minecraft:ONLINE")
},
{
name: message.translate("general/minecraft:FIELD_CONNECTED"),
value: `**${(json.raw.players ? json.raw.players.online : json.players.length)}** ${message.getNoun((json.raw.players ? json.raw.players.online : json.players.length), message.translate("misc:NOUNS:PLAYERS:1"), message.translate("misc:NOUNS:PLAYERS:2"), message.translate("misc:NOUNS:PLAYERS:5"))} / **${(json.raw.players ? json.raw.players.max : json.maxplayers)}** ${message.getNoun((json.raw.players ? json.raw.players.max : json.maxplayers), message.translate("misc:NOUNS:PLAYERS:1"), message.translate("misc:NOUNS:PLAYERS:2"), message.translate("misc:NOUNS:PLAYERS:5"))}`
},
{
name: message.translate("general/minecraft:FIELD_IP"),
value: json.connect,
inline: true
},
{
name: message.translate("general/minecraft:FIELD_VERSION"),
value: json.raw.vanilla.raw.version.name,
inline: true
},
{
name: message.translate("general/minecraft:FIELD_PING"),
value: json.raw.vanilla.ping.toString()
}
])
.setColor(data.config.embed.color)
.setThumbnail(favicon)
.setFooter({
text: data.config.embed.footer
});
m.edit({
content: null,
embeds: [embed]
});
}
}
module.exports = Minecraft;

View file

@ -1,45 +0,0 @@
const Command = require("../../base/Command"),
ms = require("ms");
class Remindme extends Command {
constructor(client) {
super(client, {
name: "remindme",
dirname: __dirname,
enabled: true,
guildOnly: false,
aliases: ["reminder", "remind", "rem"],
memberPermissions: [],
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS"],
nsfw: false,
ownerOnly: false,
cooldown: 1000
});
}
async run(message, args, data) {
const time = args[0];
if (!time || isNaN(ms(time))) return message.error("misc:INVALID_TIME");
const msg = args.slice(1).join(" ");
if (!msg) return message.error("general/remindme:MISSING_MESSAGE");
const rData = {
message: msg,
createdAt: Date.now(),
sendAt: Date.now() + ms(time)
};
if (!data.userData.reminds) data.userData.reminds = [];
data.userData.reminds.push(rData);
data.userData.markModified("reminds");
data.userData.save();
this.client.databaseCache.usersReminds.set(message.author.id, data.userData);
message.success("general/remindme:SAVED");
}
}
module.exports = Remindme;

View file

@ -1,86 +0,0 @@
const Command = require("../../base/Command"),
{ EmbedBuilder, parseEmoji} = require("discord.js");
class Report extends Command {
constructor(client) {
super(client, {
name: "report",
dirname: __dirname,
enabled: true,
guildOnly: true,
aliases: ["repo"],
memberPermissions: [],
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS"],
nsfw: false,
ownerOnly: false,
cooldown: 2000
});
}
async run(message, args, data) {
if (message.author.id === "285109105717280768") return message.reply({ content: "Пошёл нахуй фахон" });
const repChannel = message.guild.channels.cache.get(data.guild.plugins.reports);
if (!repChannel) return message.error("general/report:MISSING_CHANNEL");
const member = await this.client.resolveMember(args[0], message.guild);
if (!member) return message.error("general/report:MISSING_USER");
if (member.id === message.author.id) return message.error("general/report:INVALID_USER");
const rep = args.slice(1).join(" ");
if (!rep) return message.error("general/report:MISSING_REASON");
const embed = new EmbedBuilder()
.setAuthor({
name: message.translate("general/report:TITLE", {
user: member.user.tag
}),
iconURL: message.author.displayAvatarURL({
extension: "png",
size: 512
})
})
.addFields([
{
name: message.translate("common:AUTHOR"),
value: message.author.tag,
inline: true
},
{
name: message.translate("common:DATE"),
value: this.client.printDate(new Date(Date.now())),
inline: true
},
{
name: message.translate("common:REASON"),
value: rep,
inline: true
},
{
name: message.translate("common:USER"),
value: `\`${member.user.tag}\` (${member.user.toString()})`,
inline: true
}
])
.setColor(data.config.embed.color)
.setFooter({
text: data.config.embed.footer
});
const success = parseEmoji(this.client.customEmojis.cool).id;
const error = parseEmoji(this.client.customEmojis.notcool).id;
repChannel.send({
embeds: [embed]
}).then(async (m) => {
await m.react(success);
await m.react(error);
});
message.success("general/report:SUCCESS", {
channel: repChannel.toString()
});
}
}
module.exports = Report;

View file

@ -1,101 +0,0 @@
const Command = require("../../base/Command"),
Discord = require("discord.js");
class Serverinfo extends Command {
constructor(client) {
super(client, {
name: "serverinfo",
dirname: __dirname,
enabled: true,
guildOnly: true,
aliases: ["si"],
memberPermissions: [],
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS"],
nsfw: false,
ownerOnly: false,
cooldown: 1000
});
}
async run(message, args, data) {
let guild = message.guild;
if (args[0]) {
let found = this.client.guilds.cache.get(args[0]);
if (!found) {
found = this.client.guilds.cache.find(g => g.name.includes(args.join(" ")) || g.id === args[0]);
if (found) guild = found;
}
}
await guild.members.fetch();
const owner = await guild.fetchOwner();
const embed = new Discord.EmbedBuilder()
.setAuthor({
name: guild.name,
iconURL: guild.iconURL()
})
.setThumbnail(guild.iconURL())
.addFields([
{
name: this.client.customEmojis.link + " " + message.translate("general/serverinfo:LINK"),
value: `[${message.translate("general/serverinfo:LINK_TEXT")}](${this.client.config.dashboard.baseURL}/stats/${guild.id})`
},
{
name: this.client.customEmojis.title + message.translate("common:NAME"),
value: guild.name,
inline: true
},
{
name: this.client.customEmojis.calendar + message.translate("common:CREATION"),
value: this.client.printDate(guild.createdAt),
inline: true
},
{
name: this.client.customEmojis.users + message.translate("common:MEMBERS"),
value: `${guild.members.cache.filter(m => !m.user.bot).size} ${message.getNoun(guild.members.cache.filter(m => !m.user.bot).size, message.translate("misc:NOUNS:MEMBERS:1"), message.translate("misc:NOUNS:MEMBERS:2"), message.translate("misc:NOUNS:MEMBERS:5"))}` +
"\n" + `${guild.members.cache.filter(m => m.user.bot).size} ${message.getNoun(guild.members.cache.filter(m => m.user.bot).size, message.translate("misc:NOUNS:BOTS:1"), message.translate("misc:NOUNS:BOTS:2"), message.translate("misc:NOUNS:BOTS:5"))}`,
inline: true
},
{
name: this.client.customEmojis.afk + message.translate("general/serverinfo:AFK_CHANNEL"),
value: guild.afkChannel ? guild.afkChannel.toString() : message.translate("general/serverinfo:NO_AFK_CHANNEL"),
inline: true
},
{
name: this.client.customEmojis.id + message.translate("common:ID"),
value: guild.id,
inline: true
},
{
name: this.client.customEmojis.crown + message.translate("common:OWNER"),
value: owner.toString(),
inline: true
},
{
name: this.client.customEmojis.boost + message.translate("general/serverinfo:BOOSTS"),
value: guild.premiumSubscriptionCount.toString() || "0",
inline: true
},
{
name: this.client.customEmojis.channels + message.translate("common:CHANNELS"),
value: `${guild.channels.cache.filter(c => c.type === "GUILD_TEXT").size} ${message.getNoun(guild.channels.cache.filter(c => c.type === "GUILD_TEXT").size, message.translate("misc:NOUNS:TEXT:1"), message.translate("misc:NOUNS:TEXT:2"), message.translate("misc:NOUNS:TEXT:5"))}` +
"\n" + `${guild.channels.cache.filter(c => c.type === "GUILD_VOICE").size} ${message.getNoun(guild.channels.cache.filter(c => c.type === "GUILD_VOICE").size, message.translate("misc:NOUNS:VOICE:1"), message.translate("misc:NOUNS:VOICE:2"), message.translate("misc:NOUNS:VOICE:5"))}` +
"\n" + `${guild.channels.cache.filter(c => c.type === "GUILD_CATEGORY").size} ${message.getNoun(guild.channels.cache.filter(c => c.type === "GUILD_CATEGORY").size, message.translate("misc:NOUNS:CATEGORY:1"), message.translate("misc:NOUNS:CATEGORY:2"), message.translate("misc:NOUNS:CATEGORY:5"))}`,
inline: true
}
])
.setColor(data.config.embed.color)
.setFooter({
text: data.config.embed.footer
});
message.reply({
embeds: [embed]
});
}
}
module.exports = Serverinfo;

View file

@ -1,49 +0,0 @@
const Command = require("../../base/Command");
class Setafk extends Command {
constructor(client) {
super(client, {
name: "setafk",
dirname: __dirname,
enabled: true,
guildOnly: false,
aliases: ["afk"],
memberPermissions: [],
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS"],
nsfw: false,
ownerOnly: false,
cooldown: 2000
});
}
async run(message, args, data) {
const reason = args.join(" ");
if (!reason || reason.length > 250) return message.error("general/setafk:MISSING_REASON");
if (reason === "delete") {
if (data.userData.afk) {
data.userData.afk = null;
data.userData.save();
return message.sendT("general/setafk:DELETED", {
username: message.author.username
});
}
} else {
data.userData.afk = reason;
data.userData.save();
const m = await message.success("general/setafk:SUCCESS", {
reason,
prefix: message.guild ? data.guild.prefix : ""
});
setTimeout(() => {
if (m.deletable) m.delete();
if (message.deletable) message.delete();
}, 10 * 1000);
}
}
}
module.exports = Setafk;

View file

@ -1,42 +0,0 @@
const Command = require("../../base/Command"),
Discord = require("discord.js"),
fetch = require("node-fetch");
class ShortURL extends Command {
constructor(client) {
super(client, {
name: "shorturl",
dirname: __dirname,
enabled: true,
guildOnly: false,
aliases: ["minimize"],
memberPermissions: [],
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS"],
nsfw: false,
ownerOnly: false,
cooldown: 1000
});
}
async run(message, args, data) {
const url = args[0];
if (!url) return message.error("general/shorturl:MISSING_URL");
const res = await fetch(`https://is.gd/create.php?format=simple&url=${encodeURI(url)}`);
const body = await res.text();
if (body === "Error: Please enter a valid URL to shorten") return message.error("general/shorturl:MISSING_URL");
const embed = new Discord.EmbedBuilder()
.setColor(data.config.embed.color)
.setFooter({
text: data.config.embed.footer
})
.setDescription(body);
message.reply({
embeds: [embed]
});
}
}
module.exports = ShortURL;

View file

@ -1,50 +0,0 @@
const Command = require("../../base/Command"),
{ PermissionsBitField, EmbedBuilder } = require("discord.js");
class Staff extends Command {
constructor(client) {
super(client, {
name: "staff",
dirname: __dirname,
enabled: true,
guildOnly: true,
aliases: ["staf"],
memberPermissions: [],
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS"],
nsfw: false,
ownerOnly: false,
cooldown: 1000
});
}
async run(message, args, data) {
await message.guild.members.fetch();
const administrators = message.guild.members.cache.filter((m) => m.permissions.has(PermissionsBitField.Flags.Administrator) && !m.user.bot);
const moderators = message.guild.members.cache.filter((m) => !administrators.has(m.id) && m.permissions.has(PermissionsBitField.Flags.ManageMessages) && !m.user.bot);
const embed = new EmbedBuilder()
.setAuthor({
name: message.translate("general/staff:TITLE", {
guild: message.guild.name
})
})
.addFields([
{
name: message.translate("general/staff:ADMINS"),
value: (administrators.size > 0 ? administrators.map((a) => `${a.presence ? this.client.customEmojis.status[a.presence.status] : this.client.customEmojis.status.offline} | <@${a.user.id}>`).join("\n") : message.translate("general/staff:NO_ADMINS"))
},
{
name: message.translate("general/staff:MODS"),
value: (moderators.size > 0 ? moderators.map((m) => `${m.presence ? this.client.customEmojis.status[m.presence.status] : this.client.customEmojis.status.offline} | <@${m.user.id}>`).join("\n") : message.translate("general/staff:NO_MODS"))
}
])
.setColor(data.config.embed.color)
.setFooter({
text: data.config.embed.footer
});
message.reply({
embeds: [embed]
});
}
}
module.exports = Staff;

View file

@ -1,90 +0,0 @@
const Command = require("../../base/Command"),
{ PermissionsBitField, EmbedBuilder, version } = require("discord.js");
class Stats extends Command {
constructor(client) {
super(client, {
name: "stats",
dirname: __dirname,
enabled: true,
guildOnly: false,
aliases: ["stat"],
memberPermissions: [],
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS"],
nsfw: false,
ownerOnly: false,
cooldown: 1000
});
}
async run(message, args, data) {
const hiddenGuild = await this.client.guilds.fetch("568120814776614924");
const users = this.client.users.cache.size - hiddenGuild.memberCount;
const servers = this.client.guilds.cache.size - 1;
const statsEmbed = new EmbedBuilder()
.setColor(data.config.embed.color)
.setFooter({
text: data.config.embed.footer
})
.setAuthor({
name: message.translate("common:STATS")
})
.setDescription(message.translate("general/stats:MADE"))
.addFields([
{
name: this.client.customEmojis.stats + " " + message.translate("general/stats:COUNTS_TITLE"),
value: message.translate("general/stats:COUNTS_CONTENT", {
servers: servers,
users: users
}),
inline: true
},
{
name: this.client.customEmojis.version + " " + message.translate("general/stats:VERSIONS_TITLE"),
value: `\`Discord.js: v${version}\`\n\`Nodejs: v${process.versions.node}\``,
inline: true
},
{
name: this.client.customEmojis.ram + " " + message.translate("general/stats:RAM_TITLE"),
value: `\`${(process.memoryUsage().heapUsed / 1024 / 1024).toFixed(2)}MB\``,
inline: true
},
{
name: this.client.customEmojis.status.online + " " + message.translate("general/stats:ONLINE_TITLE"),
value: message.translate("general/stats:ONLINE_CONTENT", {
time: this.client.convertTime(Date.now() + this.client.uptime, true, true)
})
},
{
name: this.client.customEmojis.voice + " " + message.translate("general/stats:MUSIC_TITLE"),
value: message.translate("general/stats:MUSIC_CONTENT", {
count: `${this.client.player.voices.collection.size} ${message.getNoun(this.client.player.voices.collection.size, message.translate("misc:NOUNS:SERVERS:1"), message.translate("misc:NOUNS:SERVERS:2"), message.translate("misc:NOUNS:SERVERS:5"))}`
})
},
{
name: message.translate("general/stats:CREDITS_TITLE"),
value: message.translate("general/stats:CREDITS_CONTENT", {
donators: ["**`Добрый Спецназ#8801`** - Тестер, генератор идей"].join("\n"),
translators: ["**`Jonny_Bro#4226`** - :flag_ru:", "**`[ДАННЫЕ УДАЛЕНЫ]#4507`** - :flag_ua: (НЕ ОБНОВЛЕН!)"].join("\n")
})
},
{
name: this.client.customEmojis.link + " " + message.translate("general/stats:LINKS_TITLE"),
value: message.translate("misc:STATS_FOOTER", {
dashboardLink: this.client.config.dashboard.baseURL,
docsLink: `${this.client.config.dashboard.baseURL}/docs/`,
inviteLink: this.client.generateInvite({ scopes: ["bot", "applications.commands"], permissions: [ PermissionsBitField.Flags.Administrator ] }),
donateLink: "https://qiwi.com/n/JONNYBRO/",
owner: data.config.owner.id
})
}
]);
message.reply({
embeds: [statsEmbed]
});
}
}
module.exports = Stats;

View file

@ -1,76 +0,0 @@
const Command = require("../../base/Command"),
{ EmbedBuilder, parseEmoji } = require("discord.js");
class Suggest extends Command {
constructor(client) {
super(client, {
name: "suggest",
dirname: __dirname,
enabled: true,
guildOnly: true,
aliases: ["sugg"],
memberPermissions: [],
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS"],
nsfw: false,
ownerOnly: false,
cooldown: 2000
});
}
async run(message, args, data) {
if (message.author.id === "285109105717280768") return message.reply({ content: "Пошёл нахуй фахон" });
const suggChannel = message.guild.channels.cache.get(data.guild.plugins.suggestions);
if (!suggChannel) return message.error("general/suggest:MISSING_CHANNEL");
const sugg = args.join(" ");
if (!sugg) return message.error("general/suggest:MISSING_CONTENT");
const embed = new EmbedBuilder()
.setAuthor({
name: message.translate("general/suggest:TITLE", {
user: message.author.username
}),
iconURL: message.author.displayAvatarURL({
extension: "png",
size: 512,
})
})
.addFields([
{
name: message.translate("common:AUTHOR"),
value: `\`${message.author.username}#${message.author.discriminator}\``,
inline: true
},
{
name: message.translate("common:DATE"),
value: this.client.printDate(new Date(Date.now())),
inline: true
},
{
name: message.translate("common:CONTENT"),
value: sugg
}
])
.setColor(data.config.embed.color)
.setFooter({
text: data.config.embed.footer
});
const success = parseEmoji(this.client.customEmojis.cool).id;
const error = parseEmoji(this.client.customEmojis.notcool).id;
suggChannel.send({
embeds: [embed]
}).then(async (m) => {
await m.react(success);
await m.react(error);
});
message.success("general/suggest:SUCCESS", {
channel: suggChannel.toString()
});
}
}
module.exports = Suggest;

View file

@ -1,147 +0,0 @@
const Command = require("../../base/Command"),
Discord = require("discord.js");
class Userinfo extends Command {
constructor(client) {
super(client, {
name: "userinfo",
dirname: __dirname,
enabled: true,
guildOnly: false,
aliases: ["ui"],
memberPermissions: [],
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS"],
nsfw: false,
ownerOnly: false,
cooldown: 1000
});
}
async run(message, args, data) {
let displayPresence = true;
const isID = !isNaN(args[0]);
let user;
if (!args[0]) user = message.author;
if (message.mentions.users.first()) user = message.mentions.users.first();
if (isID && !user) {
user = this.client.users.cache.get(args[0]);
if (!user) {
user = await this.client.users.fetch(args[0], true).catch(() => {});
displayPresence = false;
}
}
if (!user) return message.error("general/userinfo:INVALID_USER");
let member = null;
if (message.guild) member = await message.guild.members.fetch(user).catch(() => {});
const embed = new Discord.EmbedBuilder()
.setAuthor({
name: `${user.tag} (${user.id})`,
iconURL: user.displayAvatarURL({
extension: "png",
size: 512
})
})
.setThumbnail(user.displayAvatarURL())
.addFields([
{
name: ":man: " + message.translate("common:USERNAME"),
value: member.nickname || user.username,
inline: true
},
{
name: this.client.customEmojis.discriminator + " " + message.translate("common:DISCRIMINATOR"),
value: user.discriminator,
inline: true
},
{
name: this.client.customEmojis.bot + " " + message.translate("common:ROBOT"),
value: (user.bot ? message.translate("common:YES") : message.translate("common:NO")),
inlinee: true
},
{
name: this.client.customEmojis.calendar + " " + message.translate("common:CREATION"),
value: this.client.printDate(user.createdAt),
inline: true
},
{
name: this.client.customEmojis.avatar + " " + message.translate("common:AVATAR"),
value: member.displayAvatarURL({
extension: "png",
size: 512
})
}
])
.setColor(data.config.embed.color)
.setFooter({
text: data.config.embed.footer
});
if (displayPresence) {
if (member.presence.activities[0].name === "Custom Status") {
embed.addFields([
{
name: this.client.customEmojis.games + " " + message.translate("common:GAME"),
value: (member.presence.activities[0] ? `Пользовательский статус\n${member.presence.activities[0].state || message.translate("common:NOT_DEFINED")}` : message.translate("general/userinfo:NO_GAME")),
inline: true
},
{
name: this.client.customEmojis.status[member.presence.status] + " " + message.translate("common:STATUS"),
value: message.translate("common:STATUS_" + (member.presence.status.toUpperCase())),
inline: true
}
]);
} else {
embed.addFields([
{
name: this.client.customEmojis.games + " " + message.translate("common:GAME"),
value: (member.presence.activities[0] ? `${member.presence.activities[0].name}\n${member.presence.activities[0].details}\n${member.presence.activities[0].state}` : message.translate("general/userinfo:NO_GAME")),
inline: true
},
{
name: this.client.customEmojis.status[member.presence.status] + " " + message.translate("common:STATUS"),
value: message.translate("common:STATUS_" + (member.presence.status.toUpperCase())),
inline: true
}
]);
}
}
if (member) {
embed.addFields([
{
name: this.client.customEmojis.calendar2 + " " + message.translate("common:JOIN"),
value: this.client.printDate(member.joinedAt),
inline: true
},
{
name: this.client.customEmojis.color + " " + message.translate("common:COLOR"),
value: member.displayHexColor,
inline: true
},
{
name: this.client.customEmojis.pencil + " " + message.translate("common:NICKNAME"),
value: (member.nickname ? member.nickname : message.translate("general/userinfo:NO_NICKNAME")),
inline: true
},
{
name: this.client.customEmojis.roles + " " + message.translate("common:ROLES"),
value: (member.roles.size > 10 ? member.roles.cache.map((r) => r).slice(0, 9).join(", ") + " " + message.translate("general/userinfo:MORE_ROLES", {
count: member.roles.cache.size - 10
}) : (member.roles.cache.size < 1) ? message.translate("general/userinfo:NO_ROLE") : member.roles.cache.map((r) => r).join(", "))
}
]);
}
message.reply({
embeds: [embed]
});
}
}
module.exports = Userinfo;

View file

@ -1,73 +0,0 @@
const Command = require("../../base/Command"),
Discord = require("discord.js"),
fetch = require("node-fetch");
class Whois extends Command {
constructor(client) {
super(client, {
name: "whois",
dirname: __dirname,
enabled: true,
guildOnly: false,
aliases: ["ip"],
memberPermissions: [],
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS"],
nsfw: false,
ownerOnly: false,
cooldown: 1000
});
}
async run(message, args, data) {
if (!args[0]) return message.error("general/whois:NO_IP");
const whois = await fetch(`http://ip-api.com/json/${args[0]}?fields=status,message,continent,continentCode,country,countryCode,region,regionName,city,zip,timezone,currency,isp,org,as,mobile,proxy,hosting,query`).then(response => response.json());
if (whois.status === "fail") {
const embed = new Discord.EmbedBuilder()
.setDescription(whois.message)
.setTitle(message.translate("general/whois:ERROR", {
ip: args[0]
}))
.setColor(data.config.embed.color)
.setFooter({
text: data.config.embed.footer
})
.setTimestamp();
return message.reply({
embeds: [embed]
});
}
const embed = new Discord.EmbedBuilder()
.setTitle(message.translate("general/whois:INFO_ABOUT", {
ip: args[0]
}))
.setFooter({
text: data.config.embed.footer
})
.setColor(data.config.embed.color)
.addFields(
{ name: "IP", value: whois.query, inline: true },
{ name: message.translate("general/whois:COUNTRY"), value: `${whois.country || message.translate("common:UNKNOWN")} (${whois.countryCode || message.translate("common:UNKNOWN")})`, inline: true },
{ name: message.translate("general/whois:REGION"), value: `${whois.regionName || message.translate("common:UNKNOWN")} (${whois.region || message.translate("common:UNKNOWN")})`, inline: true },
{ name: message.translate("general/whois:CITY"), value: `${whois.city || message.translate("common:UNKNOWN")}`, inline: true },
{ name: message.translate("general/whois:ZIP"), value: `${whois.zip || message.translate("common:UNKNOWN")}`, inline: true },
{ name: message.translate("general/whois:TIMEZONE"), value: `${whois.timezone || message.translate("common:UNKNOWN")}`, inline: true },
{ name: message.translate("general/whois:CONTINENT"), value: `${whois.continent || message.translate("common:UNKNOWN")} (${whois.continentCode || message.translate("common:UNKNOWN")})`, inline: true },
{ name: message.translate("general/whois:CURRENCY"), value: `${whois.currency || message.translate("common:UNKNOWN")}`, inline: true },
{ name: message.translate("general/whois:ISP"), value: `${whois.isp || message.translate("common:UNKNOWN")}`, inline: true }
)
.setTimestamp();
if (whois.proxy == true) embed.addFields({ name: message.translate("general/whois:INFO"), value: message.translate("general/whois:PROXY") });
else if (whois.mobile == true) embed.addFields({ name: message.translate("general/whois:INFO"), value: message.translate("general/whois:MOBILE") });
else if (whois.hosting == true) embed.addFields({ name: message.translate("general/whois:INFO"), value: message.translate("general/whois:HOSTING") });
message.reply({
embeds: [embed]
});
}
}
module.exports = Whois;

View file

@ -3,51 +3,42 @@ const mongoose = require("mongoose"),
languages = require("../languages/language-meta.json");
module.exports = mongoose.model("Guild", new Schema({
/* REQUIRED */
id: { type: String }, // Discord ID of the guild
id: { type: String },
/* MEMBERSDATA */
membersData: { type: Object, default: {} }, // Members data of the guild
membersData: { type: Object, default: {} },
members: [{ type: Schema.Types.ObjectId, ref: "Member" }],
/* CONFIGURATION */
language: { type: String, default: languages.find((l) => l.default).name }, // Language of the guild
plugins: { type: Object, default: { // Plugins data
// Welcome messages
language: { type: String, default: languages.find((l) => l.default).name },
plugins: { type: Object, default: {
welcome: {
enabled: false, // Whether the welcome messages are enabled
message: null, // The welcome message
channel: null, // The channel to send the welcome messages
withImage: null // Whether the welcome images are enabled
enabled: false,
message: null,
channel: null,
withImage: null
},
// Goodbye messages
goodbye: {
enabled: false, // Whether the goodbye messages are enabled
message: null, // The goodbye message
channel: null, // The channel to send the goodbye messages
withImage: null // Whether the goodbye images are enabled
enabled: false,
message: null,
channel: null,
withImage: null
},
// Autorole
autorole: {
enabled: false, // Whether the autorole is enabled
role: null // The role to add when a member join the server
enabled: false,
role: null
},
// Auto moderation
automod: {
enabled: false, // Whether the auto moderation is enabled
ignored: [] // The channels in which the auto moderation is disabled
enabled: false,
ignored: []
},
// Auto sanctions
warnsSanctions: {
kick: false, // The number of warns required to kick the user
ban: false // The number of warns required to ban the user
kick: false,
ban: false
},
suggestions: false, // the channel in which the suggestions will be sent
modlogs: false, // the channel in which the moderation logs (mute, kick, ban, etc...) will be sent
birthdays: false, // the channel in which birtdays announcements will be sent
reports: false, // the channel in which the reports will be sent
logs: false // the channel in which the logs (message deleted, etc...) will be sent
suggestions: false,
modlogs: false,
birthdays: false,
reports: false
}},
casesCount: { type: Number, default: 0 },
autoDeleteModCommands: { type: Boolean, default: false }, // Whether to auto delete moderation commands
autoDeleteModCommands: { type: Boolean, default: false },
}));

View file

@ -1,8 +1,5 @@
const {/* EmbedBuilder, */Client, Collection, SlashCommandBuilder, ContextMenuCommandBuilder } = require("discord.js"),
const { Client, Collection, SlashCommandBuilder, ContextMenuCommandBuilder } = require("discord.js"),
{ GiveawaysManager } = require("discord-giveaways"),
// { SoundCloudPlugin } = require("@distube/soundcloud"),
// { SpotifyPlugin } = require("@distube/spotify"),
// { YtDlpPlugin } = require("@distube/yt-dlp"),
{ Player } = require("discord-player"),
{ REST } = require("@discordjs/rest"),
{ Routes } = require("discord-api-types/v10");
@ -14,11 +11,10 @@ const BaseEvent = require("./BaseEvent.js"),
path = require("path"),
fs = require("fs").promises,
mongoose = require("mongoose"),
// DisTube = require("distube"),
moment = require("moment");
moment.relativeTimeThreshold("s", 60);
moment.relativeTimeThreshold("ss", 5);
moment.relativeTimeThreshold("s", 60);
moment.relativeTimeThreshold("m", 60);
moment.relativeTimeThreshold("h", 60);
moment.relativeTimeThreshold("d", 24);
@ -28,18 +24,18 @@ moment.relativeTimeThreshold("M", 12);
class JaBa extends Client {
constructor(options) {
super(options);
this.config = require("../config"); // Load the config file
this.customEmojis = require("../emojis"); // load the bot's emojis
this.languages = require("../languages/language-meta"); // Load the bot's languages
this.commands = new Collection(); // Creates new commands collection
this.logger = require("../helpers/logger"); // Load the logger file
this.wait = require("node:timers/promises").setTimeout; // client.wait(1000) - Wait 1 second
this.functions = require("../helpers/functions"); // Load the functions file
this.guildsData = require("../base/Guild"); // Guild mongoose model
this.usersData = require("../base/User"); // User mongoose model
this.membersData = require("../base/Member"); // Member mongoose model
this.dashboard = require("../dashboard/app"); // Dashboard app
this.states = {}; // Used for the dashboard
this.config = require("../config");
this.customEmojis = require("../emojis");
this.languages = require("../languages/language-meta");
this.commands = new Collection();
this.logger = require("../helpers/logger");
this.wait = require("node:timers/promises").setTimeout;
this.functions = require("../helpers/functions");
this.guildsData = require("../base/Guild");
this.usersData = require("../base/User");
this.membersData = require("../base/Member");
this.dashboard = require("../dashboard/app");
this.states = {};
this.knownGuilds = [];
this.databaseCache = {};

View file

@ -1,30 +1,25 @@
const mongoose = require("mongoose");
module.exports = mongoose.model("Member", new mongoose.Schema({
/* REQUIRED */
id: { type: String }, // Discord ID of the user
guildID: { type: String }, // ID of the guild to which the member is connected
id: { type: String },
guildID: { type: String },
/* SERVER ECONOMY */
money: { type: Number, default: 0 }, // Money of the user
workStreak: { type: Number, default: 0 }, // work streak of the user
bankSold: { type: Number, default: 0 }, // Bank sold of the user
exp: { type: Number, default: 0 }, // Exp points of the user
level: { type: Number, default: 0 }, // Level of the user
transactions: { type: Array, default: [] }, // Transactions of the user
money: { type: Number, default: 0 },
workStreak: { type: Number, default: 0 },
bankSold: { type: Number, default: 0 },
exp: { type: Number, default: 0 },
level: { type: Number, default: 0 },
transactions: { type: Array, default: [] },
/* STATS */
registeredAt: { type: Number, default: Date.now() }, // Registered date of the member
registeredAt: { type: Number, default: Date.now() },
/* COOLDOWN */
cooldowns: { type: Object, default: {
work: 0,
rob: 0
}},
/* OTHER INFORMATIONS */
sanctions: { type: Array, default: [] }, // Array of the member sanctions (mute, ban, kick, etc...)
mute: { type: Object, default: { // The member mute infos
sanctions: { type: Array, default: [] },
mute: { type: Object, default: {
muted: false,
case: null,
endDate: null

View file

@ -11,19 +11,15 @@ const genToken = () => {
};
const userSchema = new mongoose.Schema({
/* REQUIRED */
id: { type: String }, // Discord ID of the user
id: { type: String },
/* ECONOMY (GLOBAL) */
rep: { type: Number, default: 0 }, // Reputation points of the user
bio: { type: String }, // Biography of the user
birthdate: { type: Number }, // Birthdate of the user (the timestamp)
lover: { type: String }, // The person with whom the user is in a relationship
rep: { type: Number, default: 0 },
bio: { type: String },
birthdate: { type: Number },
lover: { type: String },
/* STATS */
registeredAt: { type: Number, default: Date.now() }, // Registered date of the user
registeredAt: { type: Number, default: Date.now() },
/* ACHIEVEMENTS */
achievements: { type: Object, default: {
married: {
achieved: false,
@ -76,16 +72,14 @@ const userSchema = new mongoose.Schema({
}
}},
/* COOLDOWN */
cooldowns: { type: Object, default: {
rep: 0
}},
/* OTHER INFORMATIONS */
afk: { type: String, default: null }, // The AFK reason (if any)
reminds: { type: Array, default: [] }, // The reminds of the user
logged: { type: Boolean, default: false }, // If the user is logged to the dashboard
apiToken: { type: String, default: genToken() } // The API token of the user
afk: { type: String, default: null },
reminds: { type: Array, default: [] },
logged: { type: Boolean, default: false },
apiToken: { type: String, default: genToken() }
});
userSchema.method("getAchievements", async function() {

48
commands/General/afk.js Normal file
View file

@ -0,0 +1,48 @@
const { SlashCommandBuilder } = require("discord.js");
const BaseCommand = require("../../base/BaseCommand");
class Afk extends BaseCommand {
/**
*
* @param {import("../base/JaBa")} client
*/
constructor(client) {
super({
command: new SlashCommandBuilder()
.setName("afk")
.setDescription(client.translate("general/afk:DESCRIPTION"))
.addStringOption(option => option.setName("message")
.setDescription(client.translate("common:MESSAGE"))
.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 reason = interaction.options.getString("message");
data.userData.afk = reason;
data.userData.save();
interaction.success("general/afk:SUCCESS", {
reason
}, { ephemeral: true });
}
}
module.exports = Afk;

View file

@ -0,0 +1,49 @@
const { SlashCommandBuilder } = require("discord.js");
const BaseCommand = require("../../base/BaseCommand");
class Avatar extends BaseCommand {
/**
*
* @param {import("../base/JaBa")} client
*/
constructor(client) {
super({
command: new SlashCommandBuilder()
.setName("avatar")
.setDescription(client.translate("general/avatar:DESCRIPTION"))
.addUserOption(option => option.setName("user")
.setDescription(client.translate("common:USER"))),
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) {
const user = interaction.options.getUser("user") || interaction.user;
const avatarURL = user.displayAvatarURL({
size: 512
});
interaction.reply({
files: [{
attachment: avatarURL
}]
});
}
}
module.exports = Avatar;

71
commands/General/emoji.js Normal file
View file

@ -0,0 +1,71 @@
const { SlashCommandBuilder, EmbedBuilder, parseEmoji } = require("discord.js");
const BaseCommand = require("../../base/BaseCommand");
class Emoji extends BaseCommand {
/**
*
* @param {import("../base/JaBa")} client
*/
constructor(client) {
super({
command: new SlashCommandBuilder()
.setName("emoji")
.setDescription(client.translate("general/emoji:DESCRIPTION"))
.addStringOption(option => option.setName("emoji")
.setDescription(client.translate("common:EMOJI"))
.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) {
const rawEmoji = interaction.options.getString("emoji");
const parsedEmoji = parseEmoji(rawEmoji);
const embed = new EmbedBuilder()
.setAuthor({
name: interaction.translate("general/emoji:TITLE", {
emoji: parsedEmoji.name
})
})
.setColor(client.config.embed.color)
.setFooter({
text: client.config.embed.footer
})
.addFields([
{
name: interaction.translate("general/emoji:NAME"),
value: parsedEmoji.name
},
{
name: interaction.translate("general/emoji:ANIMATED"),
value: parsedEmoji.animated ? interaction.translate("common:YES") : interaction.translate("common:NO")
},
{
name: interaction.translate("general/emoji:ID"),
value: parsedEmoji.id?.toString() || interaction.translate("general/emoji:STANDART")
}
]);
interaction.reply({
embeds: [embed]
});
}
}
module.exports = Emoji;

View file

@ -0,0 +1,102 @@
const { SlashCommandBuilder, EmbedBuilder } = require("discord.js");
const BaseCommand = require("../../base/BaseCommand"),
gamedig = require("gamedig");
class Minecraft extends BaseCommand {
/**
*
* @param {import("../base/JaBa")} client
*/
constructor(client) {
super({
command: new SlashCommandBuilder()
.setName("minecraft")
.setDescription(client.translate("general/minecraft:DESCRIPTION"))
.addStringOption(option => option.setName("ip")
.setDescription(client.translate("common:IP"))
.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) {
await interaction.deferReply();
const ip = interaction.options.getString("ip");
const options = {
type: "minecraft",
host: ip
};
if (ip.split(":").length > 1) {
const splitIp = ip.split(":");
options.host = splitIp[0];
options.port = splitIp[1];
}
var res = await gamedig.query(options).catch(() => {});
if (!res) {
options.type = "minecraftpe";
res = await gamedig.query(options).catch(() => {});
}
if (!res) return interaction.error("general/minecraft:FAILED", null, { edit: true });
const embed = new EmbedBuilder()
.setAuthor({
name: res.name
})
.addFields([
{
name: interaction.translate("general/minecraft:FIELD_STATUS"),
value: interaction.translate("general/minecraft:ONLINE")
},
{
name: interaction.translate("general/minecraft:FIELD_CONNECTED"),
value: `**${(res.raw.players ? res.raw.players.online : res.players.length)}** ${client.getNoun((res.raw.players ? res.raw.players.online : res.players.length), interaction.translate("misc:NOUNS:PLAYERS:1"), interaction.translate("misc:NOUNS:PLAYERS:2"), interaction.translate("misc:NOUNS:PLAYERS:5"))} / **${(res.raw.players ? res.raw.players.max : res.maxplayers)}** ${client.getNoun((res.raw.players ? res.raw.players.max : res.maxplayers), interaction.translate("misc:NOUNS:PLAYERS:1"), interaction.translate("misc:NOUNS:PLAYERS:2"), interaction.translate("misc:NOUNS:PLAYERS:5"))}`
},
{
name: interaction.translate("general/minecraft:FIELD_IP"),
value: res.connect,
inline: true
},
{
name: interaction.translate("general/minecraft:FIELD_VERSION"),
value: res.raw.vanilla.raw.version.name,
inline: true
},
{
name: interaction.translate("general/minecraft:FIELD_PING"),
value: res.raw.vanilla.ping.toString()
}
])
.setColor(client.config.embed.color)
.setThumbnail(`https://eu.mc-api.net/v3/server/favicon/${ip}`)
.setFooter({
text: client.config.embed.footer
});
interaction.editReply({
embeds: [embed]
});
}
}
module.exports = Minecraft;

View file

@ -0,0 +1,61 @@
const { SlashCommandBuilder } = require("discord.js");
const BaseCommand = require("../../base/BaseCommand"),
ms = require("ms");
class Remindme extends BaseCommand {
/**
*
* @param {import("../base/JaBa")} client
*/
constructor(client) {
super({
command: new SlashCommandBuilder()
.setName("remindme")
.setDescription(client.translate("general/remindme:DESCRIPTION"))
.addStringOption(option => option.setName("time")
.setDescription(client.translate("owner/remindme:TIME"))
.setRequired(true))
.addStringOption(option => option.setName("message")
.setDescription(client.translate("common:MESSAGE"))
.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 time = interaction.options.getString("time");
const message = interaction.options.getString("message");
const dateNow = Date.now();
if (!data.userData.reminds) data.userData.reminds = [];
const rData = {
message: message,
createdAt: dateNow,
sendAt: dateNow + ms(time)
};
data.userData.reminds.push(rData);
data.userData.markModified("reminds");
data.userData.save();
client.databaseCache.usersReminds.set(message.author.id, data.userData);
interaction.success("general/remindme:SAVED");
}
}
module.exports = Remindme;

View file

@ -0,0 +1,99 @@
const { SlashCommandBuilder, EmbedBuilder, parseEmoji } = require("discord.js");
const BaseCommand = require("../../base/BaseCommand");
class Report extends BaseCommand {
/**
*
* @param {import("../base/JaBa")} client
*/
constructor(client) {
super({
command: new SlashCommandBuilder()
.setName("report")
.setDescription(client.translate("general/report:DESCRIPTION"))
.addUserOption(option => option.setName("user")
.setDescription(client.translate("common:USER"))
.setRequired(true))
.addStringOption(option => option.setName("message")
.setDescription(client.translate("common:MESSAGE"))
.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) {
if (interaction.user.id === "285109105717280768") return interaction.reply({ content: "Пошёл нахуй фахон" });
const repChannel = interaction.guild.channels.cache.get(interaction.guild.data.plugins.reports);
if (!repChannel) return interaction.error("general/report:MISSING_CHANNEL");
const member = interaction.options.getMember("user");
if (member.id === interaction.user.id) return interaction.error("general/report:INVALID_USER");
const rep = interaction.options.getString("message");
const embed = new EmbedBuilder()
.setAuthor({
name: interaction.translate("general/report:TITLE", {
user: member.user.tag
}),
iconURL: interaction.user.displayAvatarURL({
extension: "png",
size: 512
})
})
.addFields([
{
name: interaction.translate("common:DATE"),
value: client.printDate(new Date(Date.now()))
},
{
name: interaction.translate("common:AUTHOR"),
value: interaction.user.toString(),
inline: true
},
{
name: interaction.translate("common:USER"),
value: member.user.toString(),
inline: true
},
{
name: interaction.translate("common:REASON"),
value: rep,
inline: true
}
])
.setColor(client.config.embed.color)
.setFooter({
text: client.config.embed.footer
});
const success = parseEmoji(client.customEmojis.cool).id;
const error = parseEmoji(client.customEmojis.notcool).id;
repChannel.send({
embeds: [embed]
}).then(async (m) => {
await m.react(success);
await m.react(error);
});
interaction.success("general/report:SUCCESS", {
channel: repChannel.toString()
});
}
}
module.exports = Report;

View file

@ -0,0 +1,106 @@
const { SlashCommandBuilder, EmbedBuilder } = require("discord.js");
const BaseCommand = require("../../base/BaseCommand");
class Serverinfo extends BaseCommand {
/**
*
* @param {import("../base/JaBa")} client
*/
constructor(client) {
super({
command: new SlashCommandBuilder()
.setName("serverinfo")
.setDescription(client.translate("general/serverinfo:DESCRIPTION")),
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) {
const guild = interaction.guild;
await guild.members.fetch();
const owner = await guild.fetchOwner();
const embed = new EmbedBuilder()
.setAuthor({
name: guild.name,
iconURL: guild.iconURL()
})
.setThumbnail(guild.iconURL())
.addFields([
{
name: client.customEmojis.link + " " + interaction.translate("general/serverinfo:LINK"),
value: `[${interaction.translate("general/serverinfo:LINK_TEXT")}](${client.config.dashboard.baseURL}/stats/${guild.id})`
},
{
name: client.customEmojis.title + interaction.translate("common:NAME"),
value: guild.name,
inline: true
},
{
name: client.customEmojis.calendar + interaction.translate("common:CREATION"),
value: client.printDate(guild.createdAt),
inline: true
},
{
name: client.customEmojis.users + interaction.translate("common:MEMBERS"),
value: `${guild.members.cache.filter(m => !m.user.bot).size} ${client.getNoun(guild.members.cache.filter(m => !m.user.bot).size, interaction.translate("misc:NOUNS:MEMBERS:1"), interaction.translate("misc:NOUNS:MEMBERS:2"), interaction.translate("misc:NOUNS:MEMBERS:5"))}` +
"\n" + `${guild.members.cache.filter(m => m.user.bot).size} ${client.getNoun(guild.members.cache.filter(m => m.user.bot).size, interaction.translate("misc:NOUNS:BOTS:1"), interaction.translate("misc:NOUNS:BOTS:2"), interaction.translate("misc:NOUNS:BOTS:5"))}`,
inline: true
},
{
name: client.customEmojis.afk + interaction.translate("general/serverinfo:AFK_CHANNEL"),
value: guild.afkChannel?.toString() || interaction.translate("common:MISSING"),
inline: true
},
{
name: client.customEmojis.id + interaction.translate("common:ID"),
value: guild.id,
inline: true
},
{
name: client.customEmojis.crown + interaction.translate("common:OWNER"),
value: owner.toString(),
inline: true
},
{
name: client.customEmojis.boost + interaction.translate("general/serverinfo:BOOSTS"),
value: guild.premiumSubscriptionCount?.toString() || "0",
inline: true
},
{
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"))}` +
"\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 === "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"))}`,
inline: true
}
])
.setColor(client.config.embed.color)
.setFooter({
text: client.config.embed.footer
});
interaction.reply({
embeds: [embed]
});
}
}
module.exports = Serverinfo;

View file

@ -0,0 +1,48 @@
const { SlashCommandBuilder } = require("discord.js");
const BaseCommand = require("../../base/BaseCommand"),
fetch = require("node-fetch");
class Shorturl extends BaseCommand {
/**
*
* @param {import("../base/JaBa")} client
*/
constructor(client) {
super({
command: new SlashCommandBuilder()
.setName("shorturl")
.setDescription(client.translate("general/shorturl:DESCRIPTION"))
.addStringOption(option => option.setName("url")
.setDescription(client.translate("general/shorturl:URL"))
.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) {
const url = interaction.options.getString("url");
const res = await fetch(`https://is.gd/create.php?format=simple&url=${encodeURI(url)}`).then(res => res.text());
interaction.reply({
content: `<${res}>`,
ephemeral: true
});
}
}
module.exports = Shorturl;

64
commands/General/staff.js Normal file
View file

@ -0,0 +1,64 @@
const { SlashCommandBuilder, EmbedBuilder, PermissionsBitField } = require("discord.js");
const BaseCommand = require("../../base/BaseCommand");
class Staff extends BaseCommand {
/**
*
* @param {import("../base/JaBa")} client
*/
constructor(client) {
super({
command: new SlashCommandBuilder()
.setName("staff")
.setDescription(client.translate("general/staff:DESCRIPTION")),
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) {
await interaction.guild.members.fetch();
const administrators = interaction.guild.members.cache.filter((m) => m.permissions.has(PermissionsBitField.Flags.Administrator) && !m.user.bot);
const moderators = interaction.guild.members.cache.filter((m) => !administrators.has(m.id) && m.permissions.has(PermissionsBitField.Flags.ManageMessages) && !m.user.bot);
const embed = new EmbedBuilder()
.setAuthor({
name: interaction.translate("general/staff:TITLE", {
guild: interaction.guild.name
})
})
.addFields([
{
name: interaction.translate("general/staff:ADMINS"),
value: (administrators.size > 0 ? administrators.map((a) => `${a.presence ? client.customEmojis.status[a.presence.status] : client.customEmojis.status.offline} | <@${a.user.id}>`).join("\n") : interaction.translate("general/staff:NO_ADMINS"))
},
{
name: interaction.translate("general/staff:MODS"),
value: (moderators.size > 0 ? moderators.map((m) => `${m.presence ? client.customEmojis.status[m.presence.status] : client.customEmojis.status.offline} | <@${m.user.id}>`).join("\n") : interaction.translate("general/staff:NO_MODS"))
}
])
.setColor(client.config.embed.color)
.setFooter({
text: client.config.embed.footer
});
interaction.reply({
embeds: [embed]
});
}
}
module.exports = Staff;

104
commands/General/stats.js Normal file
View file

@ -0,0 +1,104 @@
const { SlashCommandBuilder, EmbedBuilder, PermissionsBitField, version } = require("discord.js");
const BaseCommand = require("../../base/BaseCommand");
class Stats extends BaseCommand {
/**
*
* @param {import("../base/JaBa")} client
*/
constructor(client) {
super({
command: new SlashCommandBuilder()
.setName("stats")
.setDescription(client.translate("general/stats:DESCRIPTION")),
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) {
const hiddenGuild = await client.guilds.fetch("568120814776614924");
const users = client.users.cache.size - hiddenGuild.memberCount;
const servers = client.guilds.cache.size - 1;
const statsEmbed = new EmbedBuilder()
.setColor(client.config.embed.color)
.setFooter({
text: client.config.embed.footer
})
.setAuthor({
name: interaction.translate("common:STATS")
})
.setDescription(interaction.translate("general/stats:MADE"))
.addFields([
{
name: client.customEmojis.stats + " " + interaction.translate("general/stats:COUNTS_TITLE"),
value: interaction.translate("general/stats:COUNTS_CONTENT", {
servers: servers,
users: users
}),
inline: true
},
{
name: client.customEmojis.version + " " + interaction.translate("general/stats:VERSIONS_TITLE"),
value: `\`Discord.js: v${version}\`\n\`Nodejs: v${process.versions.node}\``,
inline: true
},
{
name: client.customEmojis.ram + " " + interaction.translate("general/stats:RAM_TITLE"),
value: `\`${(process.memoryUsage().heapUsed / 1024 / 1024).toFixed(2)}MB\``,
inline: true
},
{
name: client.customEmojis.status.online + " " + interaction.translate("general/stats:ONLINE_TITLE"),
value: interaction.translate("general/stats:ONLINE_CONTENT", {
time: client.convertTime(Date.now() + client.uptime, true, true)
})
},
{
name: client.customEmojis.voice + " " + interaction.translate("general/stats:MUSIC_TITLE"),
value: interaction.translate("general/stats:MUSIC_CONTENT", {
count: `${client.player.queues.size} ${client.getNoun(client.player.queues.size, interaction.translate("misc:NOUNS:SERVERS:1"), interaction.translate("misc:NOUNS:SERVERS:2"), interaction.translate("misc:NOUNS:SERVERS:5"))}`
})
},
{
name: interaction.translate("general/stats:CREDITS_TITLE"),
value: interaction.translate("general/stats:CREDITS_CONTENT", {
donators: ["**`Добрый Спецназ#8801`** - Тестер, генератор идей"].join("\n"),
translators: ["**`[ДАННЫЕ УДАЛЕНЫ]#4507`** - :flag_ua: (НЕ ОБНОВЛЕН!)"].join("\n")
})
},
{
name: client.customEmojis.link + " " + interaction.translate("general/stats:LINKS_TITLE"),
value: interaction.translate("misc:STATS_FOOTER", {
dashboardLink: client.config.dashboard.baseURL,
docsLink: `${client.config.dashboard.baseURL}/docs/`,
inviteLink: client.generateInvite({ scopes: ["bot", "applications.commands"], permissions: [ PermissionsBitField.Flags.Administrator ] }),
donateLink: "https://qiwi.com/n/JONNYBRO/",
owner: client.config.owner.id
})
}
]);
interaction.reply({
embeds: [statsEmbed]
});
}
}
module.exports = Stats;

View file

@ -0,0 +1,88 @@
const { SlashCommandBuilder, EmbedBuilder, parseEmoji } = require("discord.js");
const BaseCommand = require("../../base/BaseCommand");
class Suggest extends BaseCommand {
/**
*
* @param {import("../base/JaBa")} client
*/
constructor(client) {
super({
command: new SlashCommandBuilder()
.setName("suggest")
.setDescription(client.translate("general/suggest:DESCRIPTION"))
.addStringOption(option => option.setName("message")
.setDescription(client.translate("common:MESSAGE"))
.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) {
if (interaction.user.id === "285109105717280768") return interaction.reply({ content: "Пошёл нахуй фахон" });
const suggChannel = interaction.guild.channels.cache.get(interaction.guild.data.plugins.suggestions);
if (!suggChannel) return interaction.error("general/suggest:MISSING_CHANNEL");
const suggestion = interaction.options.getString("message");
const embed = new EmbedBuilder()
.setAuthor({
name: interaction.translate("general/suggest:TITLE", {
user: interaction.user.tag
}),
iconURL: interaction.member.displayAvatarURL({
size: 512
})
})
.addFields([
{
name: interaction.translate("common:DATE"),
value: client.printDate(new Date(Date.now()))
},
{
name: interaction.translate("common:AUTHOR"),
value: interaction.user.toString(),
inline: true
},
{
name: interaction.translate("common:CONTENT"),
value: suggestion,
inline: true
}
])
.setColor(client.config.embed.color)
.setFooter({
text: client.config.embed.footer
});
const success = parseEmoji(client.customEmojis.cool).id;
const error = parseEmoji(client.customEmojis.notcool).id;
suggChannel.send({
embeds: [embed]
}).then(async (m) => {
await m.react(success);
await m.react(error);
});
interaction.success("general/suggest:SUCCESS", {
channel: suggChannel.toString()
});
}
}
module.exports = Suggest;

View file

@ -0,0 +1,120 @@
const { SlashCommandBuilder, EmbedBuilder } = require("discord.js");
const BaseCommand = require("../../base/BaseCommand");
class Userinfo extends BaseCommand {
/**
*
* @param {import("../base/JaBa")} client
*/
constructor(client) {
super({
command: new SlashCommandBuilder()
.setName("userinfo")
.setDescription(client.translate("general/userinfo:DESCRIPTION"))
.addUserOption(option => option.setName("user")
.setDescription(client.translate("common:USER"))),
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) {
const member = interaction.options.getMember("user") || interaction.member;
const embed = new EmbedBuilder()
.setAuthor({
name: `${member.user.tag} (${member.id})`,
iconURL: member.displayAvatarURL({
size: 512
})
})
.setThumbnail(member.displayAvatarURL({
size: 512
}))
.addFields([
{
name: ":man: " + interaction.translate("common:USERNAME"),
value: member.user.tag,
inline: true
},
{
name: client.customEmojis.pencil + " " + interaction.translate("common:NICKNAME"),
value: member.nickname || interaction.translate("general/userinfo:NO_NICKNAME"),
inline: true
},
{
name: client.customEmojis.status[member.presence.status] + " " + interaction.translate("common:STATUS"),
value: interaction.translate(`common:STATUS_${member.presence.status.toUpperCase()}`),
inline: true
},
{
name: client.customEmojis.bot + " " + interaction.translate("common:ROBOT"),
value: member.user.bot ? interaction.translate("common:YES") : interaction.translate("common:NO"),
inline: true
},
{
name: client.customEmojis.calendar + " " + interaction.translate("common:CREATION"),
value: client.printDate(member.user.createdAt),
inline: true
},
{
name: client.customEmojis.calendar2 + " " + interaction.translate("common:JOIN"),
value: client.printDate(member.joinedAt),
inline: true
},
{
name: client.customEmojis.color + " " + interaction.translate("common:COLOR"),
value: member.displayHexColor,
inline: true
},
{
name: client.customEmojis.roles + " " + interaction.translate("common:ROLES"),
value: (member.roles.size > 10 ? member.roles.cache.map((r) => r).slice(0, 10).join(", ") + " " + interaction.translate("general/userinfo:MORE_ROLES", {
count: member.roles.cache.size - 10
}) : (member.roles.cache.size < 1) ? interaction.translate("general/userinfo:NO_ROLE") : member.roles.cache.map((r) => r).join(", ")),
inline: true
}
])
.setColor(client.config.embed.color)
.setFooter({
text: client.config.embed.footer
});
if (member.presence.activities[0].name === "Custom Status") {
embed.addFields([
{
name: client.customEmojis.games + " " + interaction.translate("common:ACTIVITY"),
value: member.presence.activities[0] ? `${interaction.translate("general/userinfo:CUSTOM")}\n${member.presence.activities[0].state || interaction.translate("common:NOT_DEFINED")}` : interaction.translate("general/userinfo:NO_ACTIVITY"),
inline: true
}
]);
} else {
embed.addFields([
{
name: client.customEmojis.games + " " + interaction.translate("common:ACTIVITY"),
value: member.presence.activities[0] ? `${member.presence.activities[0].name}\n${member.presence.activities[0].details}\n${member.presence.activities[0].state}` : interaction.translate("general/userinfo:NO_GAME"),
inline: true
}
]);
}
interaction.reply({
embeds: [embed]
});
}
}
module.exports = Userinfo;

73
commands/General/whois.js Normal file
View file

@ -0,0 +1,73 @@
const { SlashCommandBuilder, EmbedBuilder } = require("discord.js");
const BaseCommand = require("../../base/BaseCommand"),
fetch = require("node-fetch");
class Whois extends BaseCommand {
/**
*
* @param {import("../base/JaBa")} client
*/
constructor(client) {
super({
command: new SlashCommandBuilder()
.setName("whois")
.setDescription(client.translate("general/whois:DESCRIPTION"))
.addStringOption(option => option.setName("ip")
.setDescription(client.translate("common:IP"))
.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) {
await interaction.deferReply();
const ip = interaction.options.getString("ip");
const whois = await fetch(`http://ip-api.com/json/${ip}?fields=status,message,continent,continentCode,country,countryCode,region,regionName,city,zip,timezone,currency,isp,org,as,mobile,proxy,hosting,query`).then(response => response.json());
if (whois.status === "fail") return interaction.reply({ content: interaction.translate("general/whois:ERROR", { ip }) });
const embed = new EmbedBuilder()
.setTitle(interaction.translate("general/whois:INFO_ABOUT", {
ip
}))
.setFooter({
text: client.config.embed.footer
})
.setColor(client.config.embed.color)
.addFields(
{ name: interaction.translate("common:IP"), value: whois.query, inline: true },
{ name: interaction.translate("general/whois:COUNTRY"), value: `${whois.country || interaction.translate("common:UNKNOWN")} (${whois.countryCode || interaction.translate("common:UNKNOWN")})`, inline: true },
{ name: interaction.translate("general/whois:REGION"), value: `${whois.regionName || interaction.translate("common:UNKNOWN")} (${whois.region || interaction.translate("common:UNKNOWN")})`, inline: true },
{ name: interaction.translate("general/whois:CITY"), value: `${whois.city || interaction.translate("common:UNKNOWN")}`, inline: true },
{ name: interaction.translate("general/whois:ZIP"), value: `${whois.zip || interaction.translate("common:UNKNOWN")}`, inline: true },
{ name: interaction.translate("general/whois:TIMEZONE"), value: `${whois.timezone || interaction.translate("common:UNKNOWN")}`, inline: true },
{ name: interaction.translate("general/whois:CONTINENT"), value: `${whois.continent || interaction.translate("common:UNKNOWN")} (${whois.continentCode || interaction.translate("common:UNKNOWN")})`, inline: true },
{ name: interaction.translate("general/whois:CURRENCY"), value: `${whois.currency || interaction.translate("common:UNKNOWN")}`, inline: true },
{ name: interaction.translate("general/whois:ISP"), value: `${whois.isp || interaction.translate("common:UNKNOWN")}`, inline: true }
)
.setTimestamp();
if (whois.proxy) embed.addFields({ name: interaction.translate("general/whois:INFO"), value: interaction.translate("general/whois:PROXY") });
else if (whois.mobile) embed.addFields({ name: interaction.translate("general/whois:INFO"), value: interaction.translate("general/whois:MOBILE") });
else if (whois.hosting) embed.addFields({ name: interaction.translate("general/whois:INFO"), value: interaction.translate("general/whois:HOSTING") });
interaction.editReply({
embeds: [embed]
});
}
}
module.exports = Whois;

View file

@ -35,8 +35,8 @@ class Queue extends BaseCommand {
if (!queue) return interaction.error("music/play:NOT_PLAYING");
const currentTrack = queue.current;
const tracks = queue.tracks.slice(0, 10).map((t, i) => {
return `${i}. [${t.title}](${t.url})\n> ${interaction.translate("music/queue:ADDED")} ${t.requestedBy}`;
const tracks = queue.tracks.slice(0, 10).map(track => {
return `${queue.tracks.indexOf(track)}. [${track.title}](${track.url})\n> ${interaction.translate("music/queue:ADDED")} ${track.requestedBy}`;
});
const embed = new EmbedBuilder()

View file

@ -11,9 +11,8 @@ class Announcement extends BaseCommand {
command: new SlashCommandBuilder()
.setName("announcement")
.setDescription(client.translate("owner/announcement:DESCRIPTION"))
.addStringOption(option =>
option.setName("message")
.setDescription(client.translate("owner/say:MESSAGE"))
.addStringOption(option => option.setName("message")
.setDescription(client.translate("common:MESSAGE"))
.setRequired(true)),
aliases: [],
dirname: __dirname,

View file

@ -11,11 +11,9 @@ class Debug extends BaseCommand {
command: new SlashCommandBuilder()
.setName("debug")
.setDescription(client.translate("owner/debug:DESCRIPTION"))
.addSubcommand(subcommand =>
subcommand.setName("set")
.addSubcommand(subcommand => subcommand.setName("set")
.setDescription(client.translate("owner/debug:SET"))
.addStringOption(option =>
option.setName("type")
.addStringOption(option => option.setName("type")
.setDescription(client.translate("owner/debug:TYPE"))
.setRequired(true)
.addChoices(
@ -25,20 +23,16 @@ class Debug extends BaseCommand {
{ name: client.translate("economy/transactions:BANK"), value: "bank" },
{ name: client.translate("common:REP"), value: "rep" },
))
.addUserOption(option =>
option.setName("target")
.addUserOption(option => option.setName("target")
.setDescription(client.translate("owner/debug:TARGET"))
.setRequired(true))
.addIntegerOption(option =>
option.setName("int")
.addIntegerOption(option => option.setName("int")
.setDescription(client.translate("owner/debug:INT"))
.setRequired(true))
)
.addSubcommand(subcommand =>
subcommand.setName("add")
.addSubcommand(subcommand => subcommand.setName("add")
.setDescription(client.translate("owner/debug:ADD"))
.addStringOption(option =>
option.setName("type")
.addStringOption(option => option.setName("type")
.setDescription(client.translate("owner/debug:TYPE"))
.setRequired(true)
.addChoices(
@ -48,12 +42,10 @@ class Debug extends BaseCommand {
{ name: client.translate("economy/transactions:BANK"), value: "bank" },
{ name: client.translate("common:REP"), value: "rep" },
))
.addUserOption(option =>
option.setName("user")
.addUserOption(option => option.setName("user")
.setDescription(client.translate("common:USER"))
.setRequired(true))
.addIntegerOption(option =>
option.setName("int")
.addIntegerOption(option => option.setName("int")
.setDescription(client.translate("owner/debug:INT"))
.setRequired(true))
),

View file

@ -11,8 +11,7 @@ class Eval extends BaseCommand {
command: new SlashCommandBuilder()
.setName("eval")
.setDescription(client.translate("owner/eval:DESCRIPTION"))
.addStringOption(option =>
option.setName("code")
.addStringOption(option => option.setName("code")
.setDescription(client.translate("owner/eval:CODE"))
.setRequired(true)),
aliases: [],

View file

@ -13,8 +13,7 @@ class Reload extends BaseCommand {
command: new SlashCommandBuilder()
.setName("reload")
.setDescription(client.translate("owner/reload:DESCRIPTION"))
.addStringOption(option =>
option.setName("command")
.addStringOption(option => option.setName("command")
.setDescription(client.translate("owner/reload:COMMAND"))
.setRequired(true)),
aliases: [],

View file

@ -11,13 +11,11 @@ class Say extends BaseCommand {
command: new SlashCommandBuilder()
.setName("say")
.setDescription(client.translate("owner/say:DESCRIPTION"))
.addStringOption(option =>
option.setName("message")
.setDescription(client.translate("owner/say:MESSAGE"))
.addStringOption(option => option.setName("message")
.setDescription(client.translate("common:MESSAGE"))
.setRequired(true))
.addChannelOption(option =>
option.setName("channel")
.setDescription(client.translate("owner/say:CHANNEL"))),
.addChannelOption(option => option.setName("channel")
.setDescription(client.translate("common:CHANNEL"))),
aliases: [],
dirname: __dirname,
guildOnly: true,

View file

@ -98,17 +98,11 @@
<form role="form" action="/manage/<%= guild.id %>/" method="POST">
<!-- /.box-header -->
<div class="box-body">
<!-- text input -->
<div class="form-group">
<label><%= translate("common:PREFIX") %></label>
<input type="text" name="prefix" class="form-control"
placeholder="<%= guild.prefix %>">
</div>
<!-- select -->
<div class="form-group">
<label><%= translate("common:LANGUAGE") %></label>
<select class="form-control" name="language">
<% bot.languages.forEach((language) => { %>
<% bot.languages.forEach(language => { %>
<% if (guild.language === language.name) { %>
<option selected="selected"><%= language.nativeName %></option>
<% } else { %>

View file

@ -68,7 +68,7 @@ class MessageCreate extends BaseEvent {
if (afkReason) {
data.userData.afk = null;
await data.userData.save();
message.replyT("general/setafk:DELETED", {
message.replyT("general/afk:DELETED", {
username: message.author.username
});
}
@ -77,7 +77,7 @@ class MessageCreate extends BaseEvent {
const userData = await client.findOrCreateUser({
id: u.id
});
if (userData.afk) message.error("general/setafk:IS_AFK", { user: u.tag, reason: userData.afk });
if (userData.afk) message.error("general/afk:IS_AFK", { user: u.tag, reason: userData.afk });
});
}
return;

View file

@ -1,100 +0,0 @@
/**
*
* @param {import("discord.js").Guild} guild
* @param {String} search
* @param {String} channelType
* @returns
*/
const resolveChannel = async ({ guild, search, channelType }) => {
if (!search || typeof search !== "string") return;
// Try by parsing the search
if (search.match(/^<#([0-9]{18})>/)) {
const [, channelId] = search.match(/^<#([0-9]{18})>/);
const channelFound = guild.channels.cache.get(channelId);
if (channelFound && channelType && channelFound.type === channelType) return channelFound;
}
// Try with ID
if (guild.channels.cache.has(search)) {
const channelFound = guild.channels.cache.get(search);
if (channelFound && channelType && channelFound.type === channelType) return channelFound;
}
// Try with name with #
if (guild.channels.cache.some(channel => `#${channel.name}` === search || channel.name === search)) {
const channelFound = guild.channels.cache.find(channel => `#${channel.name}` === search || channel.name === search);
if (channelFound && channelType && channelFound.type === channelType) return channelFound;
}
return;
};
/**
*
* @param {import("discord.js").Guild} guild
* @param {String} search
* @returns
*/
const resolveMember = async ({ guild, search }) => {
if (!search || typeof search !== "string") return;
// Try by parsing the search
if (search.match(/^<@!?(\d+)>$/)) {
const [, userId] = search.match(/^<@!?(\d+)>$/);
const memberFound = await guild.members.fetch(userId).catch(() => {});
if (memberFound) return memberFound;
}
// Try with ID
if (await guild.members.fetch(search).catch(() => {})) {
const memberFound = await guild.members.fetch(search);
if (memberFound) return memberFound;
}
// Try with name with @
await guild.members.fetch({
query: search
});
if (guild.members.cache.some(member => member.user.tag === search || member.user.username === search)) {
const memberFound = guild.members.cache.find(member => member.user.tag === search || member.user.username === search);
if (memberFound) return memberFound;
}
return;
};
/**
*
* @param {import("discord.js").Guild} guild
* @param {String} search
* @returns
*/
const resolveRole = async ({ guild, search }) => {
if (!search || typeof search !== "string") return;
// Try by parsing the search
if (search.match(/^<@&([0-9]{18})>/)) {
const [, roleId] = search.match(/^<@&([0-9]{18})>/);
const roleFound = guild.roles.cache.get(roleId);
if (roleFound)
return roleFound;
}
// Try with ID
if (guild.roles.cache.has(search)) {
const roleFound = guild.roles.cache.get(search);
if (roleFound) return roleFound;
}
// Try with name with @
if (guild.roles.cache.some(role => `@${role.name}` === search || role.name === search)) {
const roleFound = guild.roles.cache.find(role => `@${role.name}` === search || role.name === search);
if (roleFound) return roleFound;
}
return;
};
module.exports = { resolveChannel, resolveMember, resolveRole };

View file

@ -15,10 +15,8 @@
"ID": "ID",
"OWNER": "Owner",
"USERNAME": "Username",
"DISCRIMINATOR": "Discriminator",
"STATS": "Stats",
"ROBOT": "Robot",
"AVATAR": "Avatar",
"GAME": "Game",
"STATUS": "Status",
"STATUS_ONLINE": "Online",
@ -49,7 +47,6 @@
"MESSAGE": "Message",
"PROFILE": "Profile",
"CONFIGURATION": "Configuration",
"PREFIX": "Prefix",
"LANGUAGE": "Language",
"CHANNEL": "Channel",
"UPDATE": "Update",

View file

@ -1,8 +0,0 @@
{
"DESCRIPTION": "Установить префикс на сервере!",
"USAGE": "setprefix [префикс]",
"EXAMPLES": "setprefix $",
"MISSING_PREFIX": "Укажите префикс!",
"TOO_LONG": "Префикс не может быть длиннее 5 символов!",
"SUCCESS": "Префикс бота изменён на ``!"
}

View file

@ -2,7 +2,6 @@
"DESCRIPTION": "Украсть эмодзи на данный сервер с другого!",
"USAGE": "stealemoji [эмодзи]",
"EXAMPLES": "stealemoji :coolstorybob:",
"MISSING_EMOJI": "Укажите эмодзи!",
"SUCCESS": "{{emoji}} добавлен!",
"ERROR": "{{emoji}} не был добавлен. Проверьте, есть ли место для добавления эмодзи!"
}

View file

@ -5,6 +5,7 @@
"AND_MORE": "И т.д...",
"AUTHOR": "Автор",
"DATE": "Дата",
"MISSING": "Отсутствует",
"CONTENT": "Содержимое",
"REASON": "Причина",
"USER": "Пользователь",
@ -15,11 +16,9 @@
"ID": "ID сервера",
"OWNER": "Владелец",
"USERNAME": "Имя пользователя",
"DISCRIMINATOR": "Тег",
"STATS": "Статистика",
"ROBOT": "Бот",
"AVATAR": "Аватар",
"GAME": "Активность",
"ACTIVITY": "Активность",
"STATUS": "Статус",
"STATUS_ONLINE": "В сети",
"STATUS_OFFLINE": "Не в сети",
@ -29,7 +28,7 @@
"ROLES": "Роли",
"JOIN": "Присоеденился",
"COLOR": "Цвет",
"NICKNAME": "Ник",
"NICKNAME": "Ник на сервере",
"DESCRIPTION": "Описание",
"WEBSITE": "Сайт",
"INVITE": "Пригласить",
@ -50,7 +49,8 @@
"MESSAGE": "Сообщение",
"PROFILE": "Профиль",
"CONFIGURATION": "Настройки",
"PREFIX": "Префикс",
"EMOJI": "Эмодзи",
"IP": "IP адрес",
"LANGUAGE": "Язык",
"CHANNEL": "Канал",
"UPDATE": "Обновить",

View file

@ -1,9 +1,9 @@
{
"FIRST_LOGIN": "{{user}} авторизовался в панели управления в первый раз! :tada:",
"NOT_FOUND": "Упс! Страница не найдена.",
"NOT_FOUND_CONTENT": "Я не нашёл то, что вы искали. А пока вы можете вернуться в панель управления или попробовать использовать форму поиска.",
"NOT_FOUND_CONTENT": "Я не нашёл то, что вы искали. А пока вы можете вернуться в панель управления.",
"ERR_OCCURRED": "Упс! Что-то пошло не так.",
"ERR_OCCURRED_CONTENT": "Мы постараемся исправить это как можно скорее (можете сообщить владельцу о проблеме). А пока вы можете вернуться в панель управления или попробовать использовать форму поиска.",
"ERR_OCCURRED_CONTENT": "Я постараюсь исправить это как можно скорее (можете сообщить владельцу о проблеме). А пока вы можете вернуться в панель управления.",
"SEARCH": "Поиск по серверам...",
"SERVERS_LIST": "Список серверов",
"SERVERS_MANAGEMENT": "Управление серверами",

View file

@ -1,9 +1,8 @@
{
"DESCRIPTION": "Установить AFK статус (пользователь который упомянет вас получит сообщение)",
"USAGE": "setafk [причина/delete]",
"EXAMPLES": "setafk Сру =)",
"MISSING_REASON": "Укажите причину AFK! (не больше 250 символов)",
"SUCCESS": "Теперь вы AFK по причине: **{{reason}}**\nНапишите afk delete, чтобы принудительно отключить AFK",
"USAGE": "afk [причина]",
"EXAMPLES": "afk Сру =)",
"SUCCESS": "Теперь вы AFK по причине: **{{reason}}**",
"DELETED": "**{{username}}**, ваш AFK статус удалён!",
"IS_AFK": "**{{user}}** сейчас AFK, причина:\n**`{{reason}}`**"
}

View file

@ -2,7 +2,6 @@
"DESCRIPTION": "Показать информацию о Minecraft сервере",
"USAGE": "minecraft [IP]",
"EXAMPLES": "minecraft mc.hypixel.net",
"MISSING_IP": "Укажите IP сервера!",
"FAILED": "Сервер недоступен или доступ запрещён!",
"ONLINE": "Онлайн",
"OFFLINE": "Оффлайн",

View file

@ -2,7 +2,7 @@
"DESCRIPTION": "Создать напоминание",
"USAGE": "remindme [время] [сообщение]",
"EXAMPLES": "remindme 24h Использовать команду work\nremindme 3m Достать курицу из морозилки!",
"MISSING_MESSAGE": "Введите сообщение!",
"TIME": "Время (Например: 10s, 5m, 2h, 1d, 3w)",
"SAVED": "Напоминание сохранено!",
"TITLE": "Напоминание от JaBa",
"CREATED": "Сообщение создано {{time}}"

View file

@ -3,8 +3,6 @@
"USAGE": "report [@пользователь] (причина)",
"EXAMPLES": "report @Jonny_Bro#4226 Нарушение правил",
"MISSING_CHANNEL": "Канал для жалоб не настроен!",
"MISSING_REASON": "Введите причину!",
"MISSING_USER": "Вы должны упомянуть пользователя!",
"INVALID_USER": "Вы не можете пожаловаться на себя",
"SUCCESS": "Ваша жалоба отправлена в {{channel}}!",
"TITLE": "Жалоба - {{user}}"

View file

@ -1,9 +1,8 @@
{
"DESCRIPTION": "Показать информацию о сервере",
"USAGE": "serverinfo [ID/название]",
"EXAMPLES": "serverinfo кык\nserverinfo",
"USAGE": "serverinfo",
"EXAMPLES": "serverinfo",
"AFK_CHANNEL": "AFK канал",
"NO_AFK_CHANNEL": "Нет AFK канала",
"BOOSTS": "Кол-во бустов",
"LINK": "Статистика сервера",
"LINK_TEXT": "Нажмите сюда, чтобы открыть статистику сервера!"

View file

@ -2,5 +2,5 @@
"DESCRIPTION": "Укоротить ссылку",
"USAGE": "shorturl [URL]",
"EXAMPLES": "shorturl https://google.com",
"MISSING_URL": "Введите ссылку!"
"URL": "Ссылка"
}

View file

@ -4,14 +4,14 @@
"EXAMPLES": "stats",
"COUNTS_TITLE": "• __Статистика__",
"COUNTS_CONTENT": "`Сервера: {{servers}}`\n`Пользователи: {{users}}`",
"VERSIONS_TITLE": "• __Использует__",
"VERSIONS_TITLE": "• __Используется__",
"RAM_TITLE": "• __Использование ОЗУ__",
"ONLINE_TITLE": "• __Онлайн__",
"ONLINE_CONTENT": "Работает {{time}}",
"ONLINE_CONTENT": "Работаю уже {{time}}",
"MUSIC_TITLE": "• __Музыка__",
"MUSIC_CONTENT": "Играет музыку на {{count}}",
"CREDITS_TITLE": ":heart: • __Доп. информация и ссылки__",
"CREDITS_CONTENT": "Спасибо [Icons8](https://icons8.com/) за эмодзи!\n__**Поддержавшие**__:\n{{donators}}\n__**Переводчики**__:\n{{translators}}",
"MUSIC_CONTENT": "Играю музыку на {{count}}",
"CREDITS_TITLE": ":heart: • __Доп. информация__",
"CREDITS_CONTENT": "__**Поддержавшие**__:\n{{donators}}\n__**Переводчики**__:\n{{translators}}",
"LINKS_TITLE": "• __Ссылки__",
"MADE": "Бот создан Jonny_Bro#4226!"
}

View file

@ -1,9 +1,9 @@
{
"DESCRIPTION": "Показать информацию о пользователе",
"USAGE": "userinfo (@пользователь/ID)",
"EXAMPLES": "userinfo\nuserinfo @Jonny_Bro#4226\nuserinfo 281361531411890186",
"INVALID_USER": "Пользователь с ID `{{search}}` не найден!",
"NO_GAME": "Не играет",
"USAGE": "userinfo (@пользователь)",
"EXAMPLES": "userinfo\nuserinfo @Jonny_Bro#4226",
"CUSTOM": "Пользовательский статус",
"NO_ACTIVITY": "Не играет",
"NO_ROLE": "Нет роли",
"ROLE": "Высшая роль",
"NO_NICKNAME": "Нет никнейма",

View file

@ -1,8 +1,7 @@
{
"DESCRIPTION": "Получить информацию об IP адресе",
"USAGE": "whois (IP)",
"EXAMPLES": "whois 1.1.1.1",
"NO_IP": "Укажите IP адрес!",
"EXAMPLES": "whois 8.8.8.8",
"ERROR": "Произошла ошибка при получении данных об {{ip}}",
"INFO_ABOUT": "Информация об {{ip}}",
"COUNTRY": "Страна",

View file

@ -1,29 +1,14 @@
{
"ERR_OCCURRED": "Что-то пошло не так... Попробуйте позже!",
"COMMAND_DISABLED": "Эта команда на данный момент отключена!",
"CLICK_HERE": "Нажмите сюда, чтобы начать {{activity}} в {{channel}}",
"TIMES_UP": "Время вышло! Используйте команду снова!",
"INVALID_YES_NO": "Отправьте `да` или `нет` (регистр не важен)!",
"INVALID_CHANNEL": "Укажите существующий канал!",
"INVALID_TIME": "Укажите действительное время! Доступные единицы: `s`, `m`, `h` или `d`.",
"INVALID_NUMBER": "Укажите число!",
"INVALID_NUMBER_RANGE": "Укажите число от **{{min}}** до **{{max}}**!",
"FORCE_STOP": "Игра принудительно окончена {{user}}, никто не победил!",
"STATS_FOOTER": "● [Панель управления]({{dashboardLink}})\n● [Документация]({{docsLink}})\n● [Пригласить JaBa на свой сервер]({{inviteLink}})\n● [Поддержать]({{donateLink}}) (укажите ваш Discord тэг для выдачи ачивки, для других способов поддержки пишите в ЛС <@{{owner}}>)",
"BOT_USER": "Вы не можете сделать это с ботом!",
"NO_PERMS": "Недостаточно прав для выполнения данного действия!",
"NO_REASON_PROVIDED": "Причина не указана",
"NO_USER_FOUND_ID": "Пользователя с ID `{{id}}` не существует!",
"HELLO_SERVER": "Привет, **{{username}}**! Все мои команды доступны через **/** Используйте `/help`, чтобы получить список команд!",
"GUILD_ONLY": "Данную команду можно использовать только на сервере!",
"MISSING_BOT_PERMS": "Мне необходимы следующие права для выполнения данной команды: {{list}}",
"MISSING_MEMBER_PERMS": "Вам необходимы следующие права для выполнения данной команды: {{list}}",
"RESTRICTED_CHANNEL": "Использование команд в {{channel}} запрещено!",
"EVERYONE_MENTION": "Вы не имеете прав для упоминания here и everyone.",
"NSFW_COMMAND": "Данную команду можно использовать только в NSFW канале!",
"OWNER_ONLY": "Данную команду может использовать только владелец бота!",
"COOLDOWNED": "Подождите **{{seconds}}**, чтобы снова использовать эту команду!",
"CANNOT_DM": "Я не могу отправить вам личное сообщение... Проверьте свои настройки конфиденциальности!",
"PERMISSIONS": {
"CreateInstantInvite": "Создание приглашения",

View file

@ -2,7 +2,5 @@
"DESCRIPTION": "Написать сообщение от имени бота",
"USAGE": "[текст] (#канал)",
"EXAMPLES": "say Hello World!\nsay Hello World! #новости",
"DONE": "Сообщение `{{message}}` отправлено в {{channel}}!",
"MESSAGE": "Сообщение",
"CHANNEL": "Канал"
"DONE": "Сообщение `{{message}}` отправлено в {{channel}}!"
}

View file

@ -1,8 +0,0 @@
{
"DESCRIPTION": "Встановити префікс на сервері!",
"USAGE": "setprefix [префікс]",
"EXAMPLES": "setprefix $",
"MISSING_PREFIX": "Вкажіть префікс!",
"TOO_LONG": "Префікс не може бути довшим за 5 символів!",
"SUCCESS": "Префікс бота змінено на ``!"
}

View file

@ -15,10 +15,8 @@
"ID": "ID серверу",
"OWNER": "Власник",
"USERNAME": "Ім'я користувача",
"DISCRIMINATOR": "Тег",
"STATS": "Статистика",
"ROBOT": "Бот",
"AVATAR": "Аватар",
"GAME": "Активність",
"STATUS": "Статус",
"STATUS_ONLINE": "В мережі",
@ -49,7 +47,6 @@
"MESSAGE": "Повідомлення",
"PROFILE": "Профіль",
"CONFIGURATION": "Налаштування",
"PREFIX": "Префікс",
"LANGUAGE": "Мова",
"CHANNEL": "Канал",
"UPDATE": "Обоновити",

View file

@ -1,9 +1,9 @@
{
"FIRST_LOGIN": "{{user}} авторизувався в панелі керування вперше! :tada:",
"NOT_FOUND": "Йой! Сторінку не знайдено.",
"NOT_FOUND_CONTENT": "Я не знайшов, що ви шукали. А поки що, ви можете повернутися в панель керування або спробувати використати форму пошуку.",
"NOT_FOUND_CONTENT": "Я не знайшов, що ви шукали. А поки що, ви можете повернутися в панель керування.",
"ERR_OCCURRED": "Йой! Щось пішло не так.",
"ERR_OCCURRED_CONTENT": "Ми постараємося виправити це якнайшвидше (можете повідомити розробника про проблему). А поки що, ви можете повернутися в панель керування або спробувати використати форму пошуку.",
"ERR_OCCURRED_CONTENT": "Ми постараємося виправити це якнайшвидше (можете повідомити розробника про проблему). А поки що, ви можете повернутися в панель керування.",
"SEARCH": "Пошук по серверам...",
"SERVERS_LIST": "Список серверів",
"SERVERS_MANAGEMENT": "Управлління серверами",