Новые правила линтера и изменения под правила

This commit is contained in:
JonnyBro 2022-12-15 21:02:38 +05:00
parent d75cf0ae32
commit e31297120c
110 changed files with 984 additions and 1009 deletions

View file

@ -14,31 +14,31 @@ module.exports = mongoose.model("Guild", new Schema({
enabled: false,
message: null,
channel: null,
withImage: null
withImage: null,
},
goodbye: {
enabled: false,
message: null,
channel: null,
withImage: null
withImage: null,
},
autorole: {
enabled: false,
role: null
role: null,
},
automod: {
enabled: false,
ignored: []
ignored: [],
},
warnsSanctions: {
kick: false,
ban: false
ban: false,
},
news: false,
suggestions: false,
modlogs: false,
birthdays: false,
reports: false
}},
reports: false,
} },
casesCount: { type: Number, default: 0 },
}));

View file

@ -50,21 +50,20 @@ class JaBa extends Client {
playdl.getFreeClientID().then(id => playdl.setToken({
soundcloud: {
client_id: id
}
client_id: id,
},
}));
this.player.on("trackStart", async (queue, track) => {
const m = await queue.metadata.channel.send({ content: this.translate("music/play:NOW_PLAYING", { songName: track.title }, queue.metadata.channel.guild.data.language) });
if (track.durationMS > 1) {
if (track.durationMS > 1)
setTimeout(() => {
if (m.deletable) m.delete();
}, track.durationMS);
} else {
else
setTimeout(() => {
if (m.deletable) m.delete();
}, (10 * 60 * 1000)); // m * s * ms
}
});
this.player.on("queueEnd", queue => queue.metadata.channel.send(this.translate("music/play:QUEUE_ENDED", null, queue.metadata.channel.guild.data.language)));
this.player.on("channelEmpty", queue => queue.metadata.channel.send(this.translate("music/play:STOP_EMPTY", null, queue.metadata.channel.guild.data.language)));
@ -83,8 +82,8 @@ class JaBa extends Client {
botsCanWin: false,
embedColor: this.config.embed.color,
embedColorEnd: "#FF0000",
reaction: "🎉"
}
reaction: "🎉",
},
});
}
@ -96,7 +95,7 @@ class JaBa extends Client {
mongoose.connect(this.config.mongoDB, {
useNewUrlParser: true,
useUnifiedTopology: true
useUnifiedTopology: true,
}).then(() => {
this.logger.log("Connected to the Mongodb database.", "log");
}).catch((err) => {
@ -114,7 +113,11 @@ class JaBa extends Client {
*/
async loadCommands(dir) {
const filePath = path.join(__dirname, dir);
var folders = await fs.readdir(filePath); folders = folders.map(file => path.join(filePath, file)).filter(async (path) => { path = await fs.lstat(path); path.isDirectory(); });
let folders = await fs.readdir(filePath);
folders = folders
.map(file => path.join(filePath, file))
.filter(async path => { path = await fs.lstat(path); path.isDirectory(); });
const rest = new REST().setToken(this.config.token);
const commands = [];
for (let index = 0; index < folders.length; index++) {
@ -130,14 +133,13 @@ class JaBa extends Client {
const command = new Command(this);
this.commands.set(command.command.name, command);
const aliases = [];
if (command.aliases && Array.isArray(command.aliases) && command.aliases.length > 0) {
if (command.aliases && Array.isArray(command.aliases) && command.aliases.length > 0)
command.aliases.forEach((alias) => {
const command_alias = (command.command instanceof SlashCommandBuilder || command.command instanceof ContextMenuCommandBuilder) ? { ...command.command.toJSON() } : { ...command.command };
command_alias.name = alias;
aliases.push(command_alias);
this.commands.set(alias, command);
});
}
commands.push((command.command instanceof SlashCommandBuilder || command.command instanceof ContextMenuCommandBuilder) ? command.command.toJSON() : command.command, ...aliases);
@ -149,19 +151,18 @@ class JaBa extends Client {
}
try {
if (this.config.production) {
if (this.config.production)
await rest.put(
Routes.applicationCommands(this.config.user), {
body: commands
}
body: commands,
},
);
} else {
else
await rest.put(
Routes.applicationGuildCommands(this.config.user, this.config.support.id), {
body: commands
}
body: commands,
},
);
}
this.logger.log("Successfully registered application commands.");
} catch (err) {
@ -180,14 +181,13 @@ class JaBa extends Client {
const command = new Command(this);
this.commands.set(command.command.name, command);
const aliases = [];
if (command.aliases && Array.isArray(command.aliases) && command.aliases.length > 0) {
if (command.aliases && Array.isArray(command.aliases) && command.aliases.length > 0)
command.aliases.forEach((alias) => {
const command_alias = command.command instanceof SlashCommandBuilder ? { ...command.command.toJSON() } : { ...command.command };
command_alias.name = alias;
aliases.push(command_alias);
this.commands.set(alias, command);
});
}
if (command.onLoad || typeof command.onLoad === "function") await command.onLoad(this);
this.logger.log(`Successfully loaded "${file}" command file. (Command: ${command.command.name})`);
@ -312,9 +312,9 @@ class JaBa extends Client {
if (this.databaseCache.users.get(userID)) return isLean ? this.databaseCache.users.get(userID).toJSON() : this.databaseCache.users.get(userID);
else {
let userData = (isLean ? await this.usersData.findOne({
id: userID
id: userID,
}).lean() : await this.usersData.findOne({
id: userID
id: userID,
}));
if (userData) {
if (!isLean) this.databaseCache.users.set(userID, userData);
@ -322,7 +322,7 @@ class JaBa extends Client {
return userData;
} else {
userData = new this.usersData({
id: userID
id: userID,
});
await userData.save();
this.databaseCache.users.set(userID, userData);
@ -343,10 +343,10 @@ class JaBa extends Client {
else {
let memberData = (isLean ? await this.membersData.findOne({
guildID: guildId,
id: memberID
id: memberID,
}).lean() : await this.membersData.findOne({
guildID: guildId,
id: memberID
id: memberID,
}));
if (memberData) {
if (!isLean) this.databaseCache.members.set(`${memberID}${guildId}`, memberData);
@ -355,11 +355,11 @@ class JaBa extends Client {
} else {
memberData = new this.membersData({
id: memberID,
guildID: guildId
guildID: guildId,
});
await memberData.save();
const guild = await this.findOrCreateGuild({
id: guildId
id: guildId,
});
if (guild) {
guild.members.push(memberData._id);
@ -382,9 +382,9 @@ class JaBa extends Client {
if (this.databaseCache.guilds.get(guildId)) return isLean ? this.databaseCache.guilds.get(guildId).toJSON() : this.databaseCache.guilds.get(guildId);
else {
let guildData = (isLean ? await this.guildsData.findOne({
id: guildId
id: guildId,
}).populate("members").lean() : await this.guildsData.findOne({
id: guildId
id: guildId,
}).populate("members"));
if (guildData) {
if (!isLean) this.databaseCache.guilds.set(guildId, guildData);
@ -392,7 +392,7 @@ class JaBa extends Client {
return guildData;
} else {
guildData = new this.guildsData({
id: guildId
id: guildId,
});
await guildData.save();
this.databaseCache.guilds.set(guildId, guildData);

View file

@ -15,13 +15,13 @@ module.exports = mongoose.model("Member", new mongoose.Schema({
cooldowns: { type: Object, default: {
work: 0,
rob: 0
}},
rob: 0,
} },
sanctions: { type: Array, default: [] },
mute: { type: Object, default: {
muted: false,
case: null,
endDate: null
}},
endDate: null,
} },
}));

View file

@ -4,9 +4,9 @@ const mongoose = require("mongoose"),
const genToken = () => {
let token = "";
const characters = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwzy0123456789.-_";
for (let i = 0; i < 32; i++) {
for (let i = 0; i < 32; i++)
token += characters.charAt(Math.floor(Math.random() * characters.length));
}
return token;
};
@ -25,61 +25,61 @@ const userSchema = new mongoose.Schema({
achieved: false,
progress: {
now: 0,
total: 1
}
total: 1,
},
},
work: {
achieved: false,
progress: {
now: 0,
total: 10
}
total: 10,
},
},
firstCommand: {
achieved: false,
progress: {
now: 0,
total: 1
}
total: 1,
},
},
slots: {
achieved: false,
progress: {
now: 0,
total: 3
}
total: 3,
},
},
tip: {
achieved: false,
progress: {
now: 0,
total: 1
}
total: 1,
},
},
rep: {
achieved: false,
progress: {
now: 0,
total: 20
total: 20,
},
},
invite: {
achieved: false,
progress: {
now: 0,
total: 1
}
}
}},
total: 1,
},
},
} },
cooldowns: { type: Object, default: {
rep: 0
}},
rep: 0,
} },
afk: { type: String, default: null },
reminds: { type: Array, default: [] },
logged: { type: Boolean, default: false },
apiToken: { type: String, default: genToken() }
apiToken: { type: String, default: genToken() },
});
userSchema.method("getAchievements", async function() {
@ -93,7 +93,7 @@ userSchema.method("getAchievements", async function() {
await Canvas.loadImage(`./assets/img/achievements/achievement${this.achievements.slots.achieved ? "_colored" : ""}4.png`),
await Canvas.loadImage(`./assets/img/achievements/achievement${this.achievements.tip.achieved ? "_colored" : ""}5.png`),
await Canvas.loadImage(`./assets/img/achievements/achievement${this.achievements.rep.achieved ? "_colored" : ""}6.png`),
await Canvas.loadImage(`./assets/img/achievements/achievement${this.achievements.invite.achieved ? "_colored" : ""}7.png`)
await Canvas.loadImage(`./assets/img/achievements/achievement${this.achievements.invite.achieved ? "_colored" : ""}7.png`),
];
let dim = 0;

View file

@ -21,7 +21,7 @@ class Automod extends BaseCommand {
.addChannelTypes(ChannelType.GuildText)),
aliases: [],
dirname: __dirname,
ownerOnly: false
ownerOnly: false,
});
}
/**
@ -44,7 +44,7 @@ class Automod extends BaseCommand {
if (state) {
data.guildData.plugins.automod = {
enabled: true,
ignored: []
ignored: [],
};
data.guildData.markModified("plugins.automod");
await data.guildData.save();
@ -55,12 +55,12 @@ class Automod extends BaseCommand {
data.guildData.markModified("plugins.automod");
await data.guildData.save();
interaction.success("administration/automod:DISABLED_CHANNEL", {
channel: channel.toString()
channel: channel.toString(),
});
} else {
data.guildData.plugins.automod = {
enabled: false,
ignored: []
ignored: [],
};
data.guildData.markModified("plugins.automod");
await data.guildData.save();

View file

@ -20,7 +20,7 @@ class Autorole extends BaseCommand {
.setDescription(client.translate("common:ROLE"))),
aliases: [],
dirname: __dirname,
ownerOnly: false
ownerOnly: false,
});
}
/**
@ -45,18 +45,18 @@ class Autorole extends BaseCommand {
data.guildData.plugins.autorole = {
enabled: true,
role: role.id
role: role.id,
};
data.guildData.markModified("plugins.autorole");
await data.guildData.save();
interaction.success("administration/autorole:SUCCESS_ENABLED", {
role: role.toString()
role: role.toString(),
});
} else {
data.guildData.plugins.autorole = {
enabled: false,
role: null
role: null,
};
data.guildData.markModified("plugins.autorole");
await data.guildData.save();

View file

@ -14,7 +14,7 @@ class Config extends BaseCommand {
.setDMPermission(false)
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator)
.addSubcommand(subcommand => subcommand.setName("list")
.setDescription(client.translate("administration/config:LIST"))
.setDescription(client.translate("administration/config:LIST")),
)
.addSubcommand(subcommand => subcommand.setName("set")
.setDescription(client.translate("administration/config:SET"))
@ -25,18 +25,18 @@ class Config extends BaseCommand {
{ name: client.translate("administration/config:MODLOGS"), value: "modlogs" },
{ name: client.translate("administration/config:NEWS"), value: "news" },
{ name: client.translate("administration/config:REPORTS"), value: "reports" },
{ name: client.translate("administration/config:SUGGESTIONS"), value: "suggestions" }
{ name: client.translate("administration/config:SUGGESTIONS"), value: "suggestions" },
)
.setRequired(true))
.addBooleanOption(option => option.setName("state")
.setDescription(client.translate("common:STATE"))
.setRequired(true))
.addChannelOption(option => option.setName("channel")
.setDescription(client.translate("common:CHANNEL")))
.setDescription(client.translate("common:CHANNEL"))),
),
aliases: [],
dirname: __dirname,
ownerOnly: false
ownerOnly: false,
});
}
/**
@ -61,65 +61,65 @@ class Config extends BaseCommand {
const embed = new EmbedBuilder()
.setAuthor({
name: interaction.guild.name,
iconURL: interaction.guild.iconURL()
iconURL: interaction.guild.iconURL(),
})
.setColor(client.config.embed.color)
.setFooter({
text: client.config.embed.footer
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")
withImage: guildData.plugins.welcome.withImage ? interaction.translate("common:YES") : interaction.translate("common:NO"),
}) : interaction.translate("common:DISABLED"),
inline: true
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")
withImage: guildData.plugins.goodbye.withImage ? interaction.translate("common:YES") : interaction.translate("common:NO"),
}) : interaction.translate("common:DISABLED"),
inline: true
inline: true,
},
{
name: interaction.translate("administration/config:AUTOROLE_TITLE"),
value: guildData.plugins.autorole.enabled ? `<@&${guildData.plugins.autorole.role}>`
: interaction.translate("common:DISABLED")
: 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
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"))
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")
channels: guildData.plugins.automod.ignored.map(ch => ` ${ch}`),
}) : interaction.translate("common:DISABLED"),
},
{
name: interaction.translate("administration/config:SPECIAL_CHANNELS"),
value: interaction.translate("administration/config:NEWS_LIST", {
channel: guildData.plugins.news ? `<#${guildData.plugins.news}>` : `*${interaction.translate("common:NOT_DEFINED")}*`
channel: guildData.plugins.news ? `<#${guildData.plugins.news}>` : `*${interaction.translate("common:NOT_DEFINED")}*`,
}) + "\n" +
interaction.translate("administration/config:SUGGESTIONS_LIST", {
channel: guildData.plugins.suggestions ? `<#${guildData.plugins.suggestions}>` : `*${interaction.translate("common:NOT_DEFINED")}*`
channel: guildData.plugins.suggestions ? `<#${guildData.plugins.suggestions}>` : `*${interaction.translate("common:NOT_DEFINED")}*`,
}) + "\n" +
interaction.translate("administration/config:REPORTS_LIST", {
channel: guildData.plugins.reports ? `<#${guildData.plugins.reports}>` : `*${interaction.translate("common:NOT_DEFINED")}*`
channel: guildData.plugins.reports ? `<#${guildData.plugins.reports}>` : `*${interaction.translate("common:NOT_DEFINED")}*`,
}) + "\n" +
interaction.translate("administration/config:MODLOGS_LIST", {
channel: guildData.plugins.modlogs ? `<#${guildData.plugins.modlogs}>` : `*${interaction.translate("common:NOT_DEFINED")}*`
channel: guildData.plugins.modlogs ? `<#${guildData.plugins.modlogs}>` : `*${interaction.translate("common:NOT_DEFINED")}*`,
}) + "\n" +
interaction.translate("administration/config:BIRTHDAYS_LIST", {
channel: guildData.plugins.birthdays ? `<#${guildData.plugins.birthdays}>` : `*${interaction.translate("common:NOT_DEFINED")}*`
})
channel: guildData.plugins.birthdays ? `<#${guildData.plugins.birthdays}>` : `*${interaction.translate("common:NOT_DEFINED")}*`,
}),
},
// {
// name: interaction.translate("administration/config:DASHBOARD_TITLE"),
@ -129,7 +129,7 @@ class Config extends BaseCommand {
interaction.reply({
embeds: [embed],
ephemeral: true
ephemeral: true,
});
} else {
const setting = interaction.options.getString("setting");
@ -156,7 +156,7 @@ async function changeSetting(interaction, setting, state, channel) {
await interaction.guild.data.save();
return interaction.reply({
content: `${interaction.translate(`administration/config:${setting.toUpperCase()}`)}: **${interaction.translate("common:DISABLED")}**`,
ephemeral: true
ephemeral: true,
});
} else {
if (channel) {
@ -165,12 +165,13 @@ async function changeSetting(interaction, setting, state, channel) {
await interaction.guild.data.save();
return interaction.reply({
content: `${interaction.translate(`administration/config:${setting.toUpperCase()}`)}: **${interaction.translate("common:ENABLED")}** (${channel.toString()})`,
ephemeral: true
ephemeral: true,
});
} else
return interaction.reply({
content: `${interaction.translate(`administration/config:${setting.toUpperCase()}`)}: ${interaction.guild.data.plugins[setting] ? `**${interaction.translate("common:ENABLED")}** (<#${interaction.guild.data.plugins[setting]}>)` : `**${interaction.translate("common:DISABLED")}**`}`,
ephemeral: true,
});
} else return interaction.reply({
content: `${interaction.translate(`administration/config:${setting.toUpperCase()}`)}: ${interaction.guild.data.plugins[setting] ? `**${interaction.translate("common:ENABLED")}** (<#${interaction.guild.data.plugins[setting]}>)` : `**${interaction.translate("common:DISABLED")}**`}`,
ephemeral: true
});
}
}

View file

@ -14,7 +14,7 @@ class Goodbye extends BaseCommand {
.setDMPermission(false)
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator)
.addSubcommand(subcommand => subcommand.setName("test")
.setDescription(client.translate("administration/goodbye:TEST"))
.setDescription(client.translate("administration/goodbye:TEST")),
)
.addSubcommand(subcommand => subcommand.setName("config")
.setDescription(client.translate("administration/goodbye:CONFIG"))
@ -26,11 +26,11 @@ class Goodbye extends BaseCommand {
.addStringOption(option => option.setName("message")
.setDescription(client.translate("common:MESSAGE")))
.addBooleanOption(option => option.setName("image")
.setDescription(client.translate("administration/goodbye:IMAGE")))
.setDescription(client.translate("administration/goodbye:IMAGE"))),
),
aliases: [],
dirname: __dirname,
ownerOnly: false
ownerOnly: false,
});
}
/**
@ -60,7 +60,7 @@ class Goodbye extends BaseCommand {
enabled: false,
message: null,
channelID: null,
withImage: null
withImage: null,
};
data.guildData.markModified("plugins.goodbye");
await data.guildData.save();
@ -81,7 +81,7 @@ class Goodbye extends BaseCommand {
await data.guildData.save();
interaction.success("administration/goodbye:ENABLED", {
channel: `<#${data.guildData.plugins.goodbye.channel}>`
channel: `<#${data.guildData.plugins.goodbye.channel}>`,
}, { ephemeral: true });
}
}

View file

@ -17,7 +17,7 @@ class Selectroles extends BaseCommand {
.setDescription(client.translate("administration/selectroles:MESSAGE"))
.addStringOption(option => option.setName("text")
.setDescription(client.translate("common:MESSAGE"))
.setRequired(true))
.setRequired(true)),
)
.addSubcommand(subcommand => subcommand.setName("addrole")
.setDescription(client.translate("administration/selectroles:ADDROLE"))
@ -29,11 +29,11 @@ class Selectroles extends BaseCommand {
.setRequired(true))
.addRoleOption(option => option.setName("role")
.setDescription(client.translate("common:ROLE"))
.setRequired(true))
.setRequired(true)),
),
aliases: [],
dirname: __dirname,
ownerOnly: false
ownerOnly: false,
});
}
/**
@ -59,7 +59,7 @@ class Selectroles extends BaseCommand {
interaction.reply({
content: interaction.translate("administration/selectroles:ROLES_UPDATED", null, { ephemeral: true }),
ephemeral: true
ephemeral: true,
});
}
});
@ -81,7 +81,7 @@ class Selectroles extends BaseCommand {
interaction.channel.send(text).then(message => {
interaction.success("administration/selectroles:MESSAGE_SENT", {
channel: interaction.channel.toString(),
message_id: message.id
message_id: message.id,
}, { edit: true });
});
} else if (command === "addrole") {
@ -96,7 +96,7 @@ class Selectroles extends BaseCommand {
const option = [{
label: role.name,
value: role.id
value: role.id,
}];
const menu = row.components[0];
@ -110,7 +110,7 @@ class Selectroles extends BaseCommand {
SelectMenuBuilder.from(menu)
.setMinValues(0)
.setMaxValues(menu.options.length + 1)
.addOptions(option)
.addOptions(option),
);
} else {
row.addComponents(
@ -119,19 +119,19 @@ class Selectroles extends BaseCommand {
.setMinValues(0)
.setMaxValues(1)
.setPlaceholder(interaction.translate("common:AVAILABLE_OPTIONS"))
.addOptions(option)
.addOptions(option),
);
}
message.edit({
components: [row]
components: [row],
});
interaction.followUp({
content: interaction.translate("administration/selectroles:SUCCESS_ADDED", {
role: role.name
role: role.name,
}),
ephemeral: true
ephemeral: true,
});
}
}

View file

@ -20,7 +20,7 @@ class Set extends BaseCommand {
{ 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("economy/transactions:BANK"), value: "bank" },
))
.addUserOption(option => option.setName("user")
.setDescription(client.translate("common:USER"))
@ -30,7 +30,7 @@ class Set extends BaseCommand {
.setRequired(true)),
aliases: [],
dirname: __dirname,
ownerOnly: false
ownerOnly: false,
});
}
/**
@ -53,7 +53,7 @@ class Set extends BaseCommand {
const memberData = await client.findOrCreateMember({
id: member.id,
guildId: interaction.guildId
guildId: interaction.guildId,
});
const int = interaction.options.getInteger("int");
if (int < 0) return interaction.error("administration/set:INVALID_NUMBER", null, { ephemeral: true });
@ -64,7 +64,7 @@ class Set extends BaseCommand {
await memberData.save();
return interaction.success(`owner/debug:SUCCESS_${type.toUpperCase()}`, {
username: member.toString(),
amount: int
amount: int,
}, { ephemeral: true });
}
@ -73,7 +73,7 @@ class Set extends BaseCommand {
await memberData.save();
return interaction.success(`owner/debug:SUCCESS_${type.toUpperCase()}`, {
username: member.toString(),
amount: int
amount: int,
}, { ephemeral: true });
}
@ -82,7 +82,7 @@ class Set extends BaseCommand {
await memberData.save();
return interaction.success(`owner/debug:SUCCESS_${type.toUpperCase()}`, {
username: member.toString(),
amount: int
amount: int,
}, { ephemeral: true });
}
@ -91,7 +91,7 @@ class Set extends BaseCommand {
await memberData.save();
return interaction.success(`owner/debug:SUCCESS_${type.toUpperCase()}`, {
username: member.toString(),
amount: int
amount: int,
}, { ephemeral: true });
}
}

View file

@ -18,11 +18,11 @@ class Setlang extends BaseCommand {
.setRequired(true)
.addChoices(
{ name: "Русский", value: "ru-RU" },
{ name: "Українська", value: "uk-UA" }
{ name: "Українська", value: "uk-UA" },
)),
aliases: [],
dirname: __dirname,
ownerOnly: false
ownerOnly: false,
});
}
/**
@ -46,7 +46,7 @@ class Setlang extends BaseCommand {
await data.guildData.save();
return interaction.success("administration/setlang:SUCCESS", {
lang: language.nativeName
lang: language.nativeName,
});
}
}

View file

@ -18,7 +18,7 @@ class Stealemoji extends BaseCommand {
.setRequired(true)),
aliases: [],
dirname: __dirname,
ownerOnly: false
ownerOnly: false,
});
}
/**
@ -41,15 +41,15 @@ class Stealemoji extends BaseCommand {
interaction.guild.emojis
.create({
name: parsedEmoji.name,
attachment: `https://cdn.discordapp.com/emojis/${parsedEmoji.id}.${ext}`
attachment: `https://cdn.discordapp.com/emojis/${parsedEmoji.id}.${ext}`,
})
.then(emoji => interaction.success("administration/stealemoji:SUCCESS", {
emoji: emoji.name
emoji: emoji.name,
}, { ephemeral: true }))
.catch(e => {
interaction.error("administration/stealemoji:ERROR", {
emoji: parsedEmoji.name,
e
e,
}, { ephemeral: true });
});
}

View file

@ -14,7 +14,7 @@ class Welcome extends BaseCommand {
.setDMPermission(false)
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator)
.addSubcommand(subcommand => subcommand.setName("test")
.setDescription(client.translate("administration/goodbye:TEST"))
.setDescription(client.translate("administration/goodbye:TEST")),
)
.addSubcommand(subcommand => subcommand.setName("config")
.setDescription(client.translate("administration/goodbye:CONFIG"))
@ -26,11 +26,11 @@ class Welcome extends BaseCommand {
.addStringOption(option => option.setName("message")
.setDescription(client.translate("common:MESSAGE")))
.addBooleanOption(option => option.setName("image")
.setDescription(client.translate("administration/goodbye:IMAGE")))
.setDescription(client.translate("administration/goodbye:IMAGE"))),
),
aliases: [],
dirname: __dirname,
ownerOnly: false
ownerOnly: false,
});
}
/**
@ -60,7 +60,7 @@ class Welcome extends BaseCommand {
enabled: false,
message: null,
channelID: null,
withImage: null
withImage: null,
};
data.guildData.markModified("plugins.welcome");
await data.guildData.save();
@ -81,7 +81,7 @@ class Welcome extends BaseCommand {
await data.guildData.save();
interaction.success("administration/welcome:ENABLED", {
channel: `<#${data.guildData.plugins.welcome.channel}>`
channel: `<#${data.guildData.plugins.welcome.channel}>`,
}, { ephemeral: true });
}
}

View file

@ -16,7 +16,7 @@ class Achievements extends BaseCommand {
.setDescription(client.translate("common:USER"))),
aliases: [],
dirname: __dirname,
ownerOnly: false
ownerOnly: false,
});
}
/**
@ -36,16 +36,16 @@ class Achievements extends BaseCommand {
const user = interaction.options.getUser("user") || interaction.member;
if (user.bot) return interaction.error("economy/profile:BOT_USER");
const userData = (user.id === interaction.user.id ? data.userData : await client.findOrCreateUser({
id: user.id
id: user.id,
}));
const embed = new EmbedBuilder()
.setAuthor({
name: interaction.translate("economy/achievements:TITLE")
name: interaction.translate("economy/achievements:TITLE"),
})
.setColor(client.config.embed.color)
.setFooter({
text: client.config.embed.footer
text: client.config.embed.footer,
});
embed.addFields([
@ -54,61 +54,61 @@ class Achievements extends BaseCommand {
value: interaction.translate("economy/achievements:PROGRESS", {
now: userData.achievements.firstCommand.progress.now,
total: userData.achievements.firstCommand.progress.total,
percent: Math.round(100 * (userData.achievements.firstCommand.progress.now / userData.achievements.firstCommand.progress.total))
})
percent: Math.round(100 * (userData.achievements.firstCommand.progress.now / userData.achievements.firstCommand.progress.total)),
}),
},
{
name: interaction.translate("economy/achievements:CLAIM_SALARY"),
value: interaction.translate("economy/achievements:PROGRESS", {
now: userData.achievements.work.progress.now,
total: userData.achievements.work.progress.total,
percent: Math.round(100 * (userData.achievements.work.progress.now / userData.achievements.work.progress.total))
})
percent: Math.round(100 * (userData.achievements.work.progress.now / userData.achievements.work.progress.total)),
}),
},
{
name: interaction.translate("economy/achievements:MARRY"),
value: interaction.translate("economy/achievements:PROGRESS", {
now: userData.achievements.married.progress.now,
total: userData.achievements.married.progress.total,
percent: Math.round(100 * (userData.achievements.married.progress.now / userData.achievements.married.progress.total))
})
percent: Math.round(100 * (userData.achievements.married.progress.now / userData.achievements.married.progress.total)),
}),
},
{
name: interaction.translate("economy/achievements:SLOTS"),
value: interaction.translate("economy/achievements:PROGRESS", {
now: userData.achievements.slots.progress.now,
total: userData.achievements.slots.progress.total,
percent: Math.round(100 * (userData.achievements.slots.progress.now / userData.achievements.slots.progress.total))
})
percent: Math.round(100 * (userData.achievements.slots.progress.now / userData.achievements.slots.progress.total)),
}),
},
{
name: interaction.translate("economy/achievements:TIP"),
value: interaction.translate("economy/achievements:PROGRESS", {
now: userData.achievements.tip.progress.now,
total: userData.achievements.tip.progress.total,
percent: Math.round(100 * (userData.achievements.tip.progress.now / userData.achievements.tip.progress.total))
})
percent: Math.round(100 * (userData.achievements.tip.progress.now / userData.achievements.tip.progress.total)),
}),
},
{
name: interaction.translate("economy/achievements:REP"),
value: interaction.translate("economy/achievements:PROGRESS", {
now: userData.achievements.rep.progress.now,
total: userData.achievements.rep.progress.total,
percent: Math.round(100 * (userData.achievements.rep.progress.now / userData.achievements.rep.progress.total))
})
percent: Math.round(100 * (userData.achievements.rep.progress.now / userData.achievements.rep.progress.total)),
}),
},
{
name: interaction.translate("economy/achievements:INVITE"),
value: interaction.translate("economy/achievements:PROGRESS", {
now: userData.achievements.invite.progress.now,
total: userData.achievements.invite.progress.total,
percent: Math.round(100 * (userData.achievements.invite.progress.now / userData.achievements.invite.progress.total))
})
}
percent: Math.round(100 * (userData.achievements.invite.progress.now / userData.achievements.invite.progress.total)),
}),
},
]);
interaction.reply({
embeds: [embed]
embeds: [embed],
});
}
}

View file

@ -17,14 +17,14 @@ class Bank extends BaseCommand {
.setRequired(true)
.addChoices(
{ name: client.translate("economy/bank:DEPOSIT"), value: "deposit" },
{ name: client.translate("economy/bank:WITHDRAW"), value: "withdraw" }
{ name: client.translate("economy/bank:WITHDRAW"), value: "withdraw" },
))
.addStringOption(option => option.setName("credits")
.setDescription(client.translate("moderation/clear:OPTION"))
.setRequired(true)),
aliases: [],
dirname: __dirname,
ownerOnly: false
ownerOnly: false,
});
}
/**
@ -56,12 +56,12 @@ class Bank extends BaseCommand {
user: interaction.translate("economy/transactions:BANK"),
amount: credits,
date: Date.now(),
type: "send"
type: "send",
};
data.memberData.transactions.push(info);
interaction.success("economy/bank:SUCCESS_DEP", {
money: `**${credits}** ${client.getNoun(credits, interaction.translate("misc:NOUNS:CREDIT:1"), interaction.translate("misc:NOUNS:CREDIT:2"), interaction.translate("misc:NOUNS:CREDIT:5"))}`
money: `**${credits}** ${client.getNoun(credits, interaction.translate("misc:NOUNS:CREDIT:1"), interaction.translate("misc:NOUNS:CREDIT:2"), interaction.translate("misc:NOUNS:CREDIT:5"))}`,
});
} else {
const credits = interaction.options.getString("credits") === "all" ? data.memberData.bankSold : interaction.options.getString("credits");
@ -72,7 +72,7 @@ class Bank extends BaseCommand {
user: interaction.translate("economy/transactions:BANK"),
amount: credits,
date: Date.now(),
type: "got"
type: "got",
};
data.memberData.transactions.push(info);
@ -82,7 +82,7 @@ class Bank extends BaseCommand {
await data.memberData.save();
interaction.success("economy/bank:SUCCESS_WD", {
money: `**${credits}** ${client.getNoun(credits, interaction.translate("misc:NOUNS:CREDIT:1"), interaction.translate("misc:NOUNS:CREDIT:2"), interaction.translate("misc:NOUNS:CREDIT:5"))}`
money: `**${credits}** ${client.getNoun(credits, interaction.translate("misc:NOUNS:CREDIT:1"), interaction.translate("misc:NOUNS:CREDIT:2"), interaction.translate("misc:NOUNS:CREDIT:5"))}`,
});
}
}

View file

@ -30,14 +30,14 @@ class Birthdate extends BaseCommand {
{ name: "Сентябрь", value: 9 },
{ name: "Октябрь", value: 10 },
{ name: "Ноябрь", value: 11 },
{ name: "Декабрь", value: 12 }
{ name: "Декабрь", value: 12 },
))
.addIntegerOption(option => option.setName("year")
.setDescription(client.translate("economy/birthdate:YEAR"))
.setRequired(true)),
aliases: [],
dirname: __dirname,
ownerOnly: false
ownerOnly: false,
});
}
/**
@ -67,7 +67,7 @@ class Birthdate extends BaseCommand {
await data.userData.save();
interaction.success("economy/birthdate:SUCCESS", {
date: client.printDate(d)
date: client.printDate(d),
});
}
}

View file

@ -14,7 +14,7 @@ class Divorce extends BaseCommand {
.setDMPermission(false),
aliases: [],
dirname: __dirname,
ownerOnly: false
ownerOnly: false,
});
}
/**
@ -38,19 +38,19 @@ class Divorce extends BaseCommand {
await data.userData.save();
const oldLover = await client.findOrCreateUser({
id: user.id
id: user.id,
});
oldLover.lover = null;
await oldLover.save();
interaction.success("economy/divorce:DIVORCED", {
user: user.toString()
user: user.toString(),
});
user.send({
content: interaction.translate("economy/divorce:DIVORCED_U", {
user: interaction.member.toString()
})
user: interaction.member.toString(),
}),
});
}
}

View file

@ -15,7 +15,7 @@ class ImportMee6 extends BaseCommand {
.setDMPermission(false),
aliases: [],
dirname: __dirname,
ownerOnly: false
ownerOnly: false,
});
}
/**
@ -42,8 +42,8 @@ class ImportMee6 extends BaseCommand {
interaction.editReply({
content: interaction.translate("owner/debug:SUCCESS_LEVEL", {
username: interaction.member.toString(),
amount: level
})
amount: level,
}),
});
}
}

View file

@ -26,11 +26,11 @@ class Leaderboard extends BaseCommand {
.addChoices(
{ name: client.translate("economy/leaderboard:LEVEL"), value: "level" },
{ name: client.translate("economy/leaderboard:MONEY"), value: "money" },
{ name: client.translate("economy/leaderboard:REP"), value: "rep" }
{ name: client.translate("economy/leaderboard:REP"), value: "rep" },
)),
aliases: [],
dirname: __dirname,
ownerOnly: false
ownerOnly: false,
});
}
/**
@ -53,7 +53,7 @@ class Leaderboard extends BaseCommand {
const isOnMobile = JSON.stringify(Object.keys(interaction.member.presence.clientStatus)) === JSON.stringify(["mobile"]);
if (isOnMobile) interaction.followUp({
content: interaction.translate("economy/leaderboard:MOBILE"),
ephemeral: true
ephemeral: true,
});
if (type === "money") {
@ -63,7 +63,7 @@ class Leaderboard extends BaseCommand {
await asyncForEach(membersData, async member => {
membersLeaderboard.push({
id: member.id,
money: member.money + member.bankSold
money: member.money + member.bankSold,
});
});
membersLeaderboard.sort((a, b) => b.money - a.money);
@ -81,23 +81,23 @@ class Leaderboard extends BaseCommand {
const embed = new EmbedBuilder()
.setAuthor({
name: interaction.translate("economy/leaderboard:TABLE", {
name: interaction.guild.name
name: interaction.guild.name,
}),
iconURL: interaction.guild.iconURL()
iconURL: interaction.guild.iconURL(),
})
.setColor(client.config.embed.color)
.addFields({
name: interaction.translate("common:USER"),
value: userNames,
inline: true
inline: true,
}, {
name: interaction.translate("common:CREDITS"),
value: money,
inline: true
inline: true,
});
interaction.editReply({
embeds: [embed]
embeds: [embed],
});
} else if (type === "level") {
const membersLeaderboard = [],
@ -107,7 +107,7 @@ class Leaderboard extends BaseCommand {
membersLeaderboard.push({
id: member.id,
level: member.level,
xp: member.exp
xp: member.exp,
});
});
membersLeaderboard.sort((a, b) => b.level - a.level);
@ -127,31 +127,31 @@ class Leaderboard extends BaseCommand {
const embed = new EmbedBuilder()
.setAuthor({
name: interaction.translate("economy/leaderboard:TABLE", {
name: interaction.guild.name
name: interaction.guild.name,
}),
iconURL: interaction.guild.iconURL()
iconURL: interaction.guild.iconURL(),
})
.setColor(client.config.embed.color)
.addFields([
{
name: interaction.translate("common:USER"),
value: userNames.join("\n"),
inline: true
inline: true,
},
{
name: interaction.translate("common:LEVEL"),
value: level.join("\n"),
inline: true
inline: true,
},
{
name: interaction.translate("common:XP"),
value: xp.join("\n"),
inline: true
}
inline: true,
},
]);
interaction.editReply({
embeds: [embed]
embeds: [embed],
});
} else if (type === "rep") {
const usersLeaderboard = [],
@ -160,7 +160,7 @@ class Leaderboard extends BaseCommand {
await asyncForEach(usersData, async user => {
usersLeaderboard.push({
id: user.id,
rep: user.rep
rep: user.rep,
});
});
usersLeaderboard.sort((a, b) => b.rep - a.rep);
@ -178,23 +178,23 @@ class Leaderboard extends BaseCommand {
const embed = new EmbedBuilder()
.setAuthor({
name: interaction.translate("economy/leaderboard:TABLE", {
name: interaction.guild.name
name: interaction.guild.name,
}),
iconURL: interaction.guild.iconURL()
iconURL: interaction.guild.iconURL(),
})
.setColor(client.config.embed.color)
.addFields({
name: interaction.translate("common:USER"),
value: userNames,
inline: true
inline: true,
}, {
name: interaction.translate("common:REP"),
value: rep,
inline: true
inline: true,
});
interaction.editReply({
embeds: [embed]
embeds: [embed],
});
}
}

View file

@ -18,7 +18,7 @@ class Marry extends BaseCommand {
.setRequired(true)),
aliases: [],
dirname: __dirname,
ownerOnly: false
ownerOnly: false,
});
}
/**
@ -40,7 +40,7 @@ class Marry extends BaseCommand {
if (member.user.bot) return interaction.error("economy/marry:BOT_USER");
if (member.id === interaction.member.id) return interaction.error("economy/marry:YOURSELF");
const userData = await client.findOrCreateUser({
id: member.id
id: member.id,
});
if (userData.lover) return interaction.error("economy/marry:ALREADY_MARRIED_USER", { user: member.toString() });
@ -50,24 +50,24 @@ class Marry extends BaseCommand {
if (requester === interaction.author.id) {
const user = client.users.cache.get(receiver) || await client.users.fetch(receiver);
return interaction.error("economy/marry:REQUEST_AUTHOR_TO_AMEMBER", {
user: user.toString
user: user.toString,
});
} else if (receiver === interaction.member.id) {
const user = client.users.cache.get(requester) || await client.users.fetch(requester);
return interaction.error("economy/marry:REQUEST_AMEMBER_TO_AUTHOR", {
user: user.toString()
user: user.toString(),
});
} else if (requester === member.id) {
const user = client.users.cache.get(receiver) || await client.users.fetch(receiver);
return interaction.error("economy/marry:REQUEST_AMEMBER_TO_MEMBER", {
firstUser: member.toString(),
secondUser: user.toString()
secondUser: user.toString(),
});
} else if (receiver === member.id) {
const user = client.users.cache.get(requester) || await client.users.fetch(requester);
return interaction.error("economy/marry:REQUEST_MEMBER_TO_AMEMBER", {
firstUser: member.toString(),
secondUser: user.toString()
secondUser: user.toString(),
});
}
}
@ -89,9 +89,9 @@ class Marry extends BaseCommand {
await interaction.reply({
content: interaction.translate("economy/marry:REQUEST", {
to: member.toString(),
from: interaction.member.toString()
from: interaction.member.toString(),
}),
components: [row]
components: [row],
});
const filter = i => i.user.id === member.id;
@ -112,7 +112,7 @@ class Marry extends BaseCommand {
});
return interaction.editReply({
components: [row]
components: [row],
});
}
@ -126,8 +126,8 @@ class Marry extends BaseCommand {
content: `${member.toString()} :heart: ${interaction.member.toString()}`,
files: [{
name: "achievement_unlocked3.png",
attachment: "./assets/img/achievements/achievement_unlocked3.png"
}]
attachment: "./assets/img/achievements/achievement_unlocked3.png",
}],
};
let sent = false;
@ -151,17 +151,17 @@ class Marry extends BaseCommand {
return interaction.editReply({
content: interaction.translate("economy/marry:SUCCESS", {
creator: interaction.member.toString(),
partner: member.toString()
partner: member.toString(),
}),
components: []
components: [],
});
} else {
return interaction.editReply({
content: interaction.translate("economy/marry:DENIED", {
creator: interaction.member.toString(),
partner: member.toString()
partner: member.toString(),
}),
components: []
components: [],
});
}
});

View file

@ -24,7 +24,7 @@ class Money extends BaseCommand {
.setDescription(client.translate("common:USER"))),
aliases: [],
dirname: __dirname,
ownerOnly: false
ownerOnly: false,
});
}
/**
@ -48,7 +48,7 @@ class Money extends BaseCommand {
const memberData = member.id === interaction.user.id ? data.memberData : await client.findOrCreateMember({
id: member.id,
guildId: interaction.guildId
guildId: interaction.guildId,
});
const guilds = client.guilds.cache.filter(g => g.members.cache.find(m => m.id === member.id));
@ -56,7 +56,7 @@ class Money extends BaseCommand {
await asyncForEach(guilds, async guild => {
const data = await client.findOrCreateMember({
id: member.id,
guildId: guild.id
guildId: guild.id,
});
globalMoney += data.money + data.bankSold;
});
@ -64,33 +64,33 @@ class Money extends BaseCommand {
const embed = new EmbedBuilder()
.setAuthor({
name: interaction.translate("economy/money:TITLE", {
username: member.user.tag
username: member.user.tag,
}),
iconURL: member.user.displayAvatarURL()
iconURL: member.user.displayAvatarURL(),
})
.addFields([
{
name: interaction.translate("economy/profile:CASH"),
value: `**${memberData.money}** ${client.getNoun(memberData.money, interaction.translate("misc:NOUNS:CREDIT:1"), interaction.translate("misc:NOUNS:CREDIT:2"), interaction.translate("misc:NOUNS:CREDIT:5"))}`,
inline: true
inline: true,
},
{
name: interaction.translate("economy/profile:BANK"),
value: `**${memberData.bankSold}** ${client.getNoun(memberData.bankSold, interaction.translate("misc:NOUNS:CREDIT:1"), interaction.translate("misc:NOUNS:CREDIT:2"), interaction.translate("misc:NOUNS:CREDIT:5"))}`,
inline: true
inline: true,
},
{
name: interaction.translate("economy/profile:GLOBAL"),
value: `**${globalMoney}** ${client.getNoun(globalMoney, interaction.translate("misc:NOUNS:CREDIT:1"), interaction.translate("misc:NOUNS:CREDIT:2"), interaction.translate("misc:NOUNS:CREDIT:5"))}`,
inline: true
}
inline: true,
},
])
.setColor(client.config.embed.color)
.setFooter({
text: client.config.embed.footer
text: client.config.embed.footer,
});
interaction.editReply({
embeds: [embed]
embeds: [embed],
});
}
}

View file

@ -15,7 +15,7 @@ class Number extends BaseCommand {
.setDMPermission(false),
aliases: [],
dirname: __dirname,
ownerOnly: false
ownerOnly: false,
});
}
/**
@ -44,7 +44,7 @@ class Number extends BaseCommand {
const filter = m => !m.author.bot;
const collector = new MessageCollector(interaction.channel, {
filter,
time: (5 * 60 * 1000)
time: (5 * 60 * 1000),
});
currentGames[interaction.guildId] = true;
@ -63,8 +63,8 @@ class Number extends BaseCommand {
number,
time,
participantCount: participants.length,
participants: participants.map(p => `<@${p}>`).join(", ")
})
participants: participants.map(p => `<@${p}>`).join(", "),
}),
});
if (participants.length > 1) {
@ -73,13 +73,13 @@ class Number extends BaseCommand {
interaction.channel.send({
content: interaction.translate("economy/number:WON", {
winner: msg.author.username,
credits: `**${won}** ${client.getNoun(won, interaction.translate("misc:NOUNS:CREDIT:1"), interaction.translate("misc:NOUNS:CREDIT:2"), interaction.translate("misc:NOUNS:CREDIT:5"))}`
})
credits: `**${won}** ${client.getNoun(won, interaction.translate("misc:NOUNS:CREDIT:1"), interaction.translate("misc:NOUNS:CREDIT:2"), interaction.translate("misc:NOUNS:CREDIT:5"))}`,
}),
});
const memberData = await client.findOrCreateMember({
id: msg.author.id,
guildId: interaction.guildId
guildId: interaction.guildId,
});
memberData.money += won;
@ -88,7 +88,7 @@ class Number extends BaseCommand {
user: interaction.translate("economy/transactions:NUMBERS"),
amount: won,
date: Date.now(),
type: "got"
type: "got",
};
data.memberData.transactions.push(info);
@ -98,10 +98,10 @@ class Number extends BaseCommand {
}
if (parseInt(msg.content) < number) msg.reply({
content: interaction.translate("economy/number:TOO_BIG", { user: msg.author.toString(), number: parsedNumber })
content: interaction.translate("economy/number:TOO_BIG", { user: msg.author.toString(), number: parsedNumber }),
});
if (parseInt(msg.content) > number) msg.reply({
content: interaction.translate("economy/number:TOO_SMALL", { user: msg.author.toString(), number: parsedNumber })
content: interaction.translate("economy/number:TOO_SMALL", { user: msg.author.toString(), number: parsedNumber }),
});
});

View file

@ -20,7 +20,7 @@ class Pay extends BaseCommand {
.setRequired(true)),
aliases: [],
dirname: __dirname,
ownerOnly: false
ownerOnly: false,
});
}
/**
@ -45,12 +45,12 @@ class Pay extends BaseCommand {
if (amount > data.memberData.money) return interaction.error("economy/pay:ENOUGH_MONEY", {
amount: `**${amount}** ${client.getNoun(amount, interaction.translate("misc:NOUNS:CREDITS:1"), interaction.translate("misc:NOUNS:CREDITS:2"), interaction.translate("misc:NOUNS:CREDITS:5"))}`
amount: `**${amount}** ${client.getNoun(amount, interaction.translate("misc:NOUNS:CREDITS:1"), interaction.translate("misc:NOUNS:CREDITS:2"), interaction.translate("misc:NOUNS:CREDITS:5"))}`,
});
const memberData = await client.findOrCreateMember({
id: member.id,
guildId: interaction.guildId
guildId: interaction.guildId,
});
data.memberData.money -= amount;
@ -63,7 +63,7 @@ class Pay extends BaseCommand {
user: member.user.tag,
amount: amount,
date: Date.now(),
type: "send"
type: "send",
};
data.memberData.transactions.push(info1);
@ -71,13 +71,13 @@ class Pay extends BaseCommand {
user: member.user.tag,
amount: amount,
date: Date.now(),
type: "got"
type: "got",
};
data.memberData.transactions.push(info2);
interaction.success("economy/pay:SUCCESS", {
user: member.toString(),
amount: `**${amount}** ${client.getNoun(amount, interaction.translate("misc:NOUNS:CREDIT:1"), interaction.translate("misc:NOUNS:CREDIT:2"), interaction.translate("misc:NOUNS:CREDIT:5"))}`
amount: `**${amount}** ${client.getNoun(amount, interaction.translate("misc:NOUNS:CREDIT:1"), interaction.translate("misc:NOUNS:CREDIT:2"), interaction.translate("misc:NOUNS:CREDIT:5"))}`,
});
}
}

View file

@ -24,7 +24,7 @@ class Profile extends BaseCommand {
.setDescription(client.translate("common:USER"))),
aliases: [],
dirname: __dirname,
ownerOnly: false
ownerOnly: false,
});
}
/**
@ -48,10 +48,10 @@ class Profile extends BaseCommand {
const memberData = (member.id === interaction.user.id ? data.memberData : await client.findOrCreateMember({
id: member.id,
guildId: interaction.guildId
guildId: interaction.guildId,
}));
const userData = (member.id === interaction.user.id ? data.userData : await client.findOrCreateUser({
id: member.id
id: member.id,
}));
if (userData.lover && !client.users.cache.find(u => u.id === userData.lover)) await client.users.fetch(userData.lover, true);
@ -60,7 +60,7 @@ class Profile extends BaseCommand {
await asyncForEach(guilds, async guild => {
const data = await client.findOrCreateMember({
id: member.id,
guildId: guild.id
guildId: guild.id,
});
globalMoney += data.money + data.bankSold;
});
@ -68,73 +68,73 @@ class Profile extends BaseCommand {
const profileEmbed = new EmbedBuilder()
.setAuthor({
name: interaction.translate("economy/profile:TITLE", {
user: member.nickname
user: member.nickname,
}),
iconURL: member.displayAvatarURL()
iconURL: member.displayAvatarURL(),
})
.setImage("attachment://achievements.png")
.addFields([
{
name: client.customEmojis.link + " " + interaction.translate("economy/profile:LINK"),
value: `[${interaction.translate("economy/profile:LINK_TEXT")}](${client.config.dashboard.baseURL}/user/${member.user.id}/${interaction.guild.id})`
value: `[${interaction.translate("economy/profile:LINK_TEXT")}](${client.config.dashboard.baseURL}/user/${member.user.id}/${interaction.guild.id})`,
},
{
name: interaction.translate("economy/profile:BIO"),
value: userData.bio ? userData.bio : interaction.translate("common:UNKNOWN")
value: userData.bio ? userData.bio : interaction.translate("common:UNKNOWN"),
},
{
name: interaction.translate("economy/profile:CASH"),
value: `**${memberData.money}** ${client.getNoun(memberData.money, interaction.translate("misc:NOUNS:CREDIT:1"), interaction.translate("misc:NOUNS:CREDIT:2"), interaction.translate("misc:NOUNS:CREDIT:5"))}`,
inline: true
inline: true,
},
{
name: interaction.translate("economy/profile:BANK"),
value: `**${memberData.bankSold}** ${client.getNoun(memberData.bankSold, interaction.translate("misc:NOUNS:CREDIT:1"), interaction.translate("misc:NOUNS:CREDIT:2"), interaction.translate("misc:NOUNS:CREDIT:5"))}`,
inline: true
inline: true,
},
{
name: interaction.translate("economy/profile:GLOBAL"),
value: `**${globalMoney}** ${client.getNoun(globalMoney, interaction.translate("misc:NOUNS:CREDIT:1"), interaction.translate("misc:NOUNS:CREDIT:2"), interaction.translate("misc:NOUNS:CREDIT:5"))}`,
inline: true
inline: true,
},
{
name: interaction.translate("economy/profile:REPUTATION"),
value: `**${userData.rep}** ${client.getNoun(userData.rep, interaction.translate("misc:NOUNS:POINTS:1"), interaction.translate("misc:NOUNS:POINTS:2"), interaction.translate("misc:NOUNS:POINTS:5"))}`,
inline: true
inline: true,
},
{
name: interaction.translate("economy/profile:LEVEL"),
value:`**${memberData.level}**`,
inline: true
inline: true,
},
{
name: interaction.translate("economy/profile:XP"),
value: `**${memberData.exp}/${5 * (memberData.level * memberData.level) + 80 * memberData.level + 100}** xp`,
inline: true
inline: true,
},
{
name: interaction.translate("economy/profile:REGISTERED"),
value: client.printDate(new Date(memberData.registeredAt)),
inline: true
inline: true,
},
{
name: interaction.translate("economy/profile:BIRTHDATE"),
value: (!userData.birthdate ? interaction.translate("common:NOT_DEFINED") : client.printDate(new Date(userData.birthdate))),
inline: true
inline: true,
},
{
name: interaction.translate("economy/profile:LOVER"),
value: (!userData.lover ? interaction.translate("common:NOT_DEFINED") : client.users.cache.get(userData.lover).tag),
inline: true
inline: true,
},
{
name: interaction.translate("economy/profile:ACHIEVEMENTS"),
value: interaction.translate("economy/profile:ACHIEVEMENTS_CONTENT")
}
value: interaction.translate("economy/profile:ACHIEVEMENTS_CONTENT"),
},
])
.setColor(client.config.embed.color)
.setFooter({
text: client.config.embed.footer
text: client.config.embed.footer,
})
.setTimestamp();
@ -144,8 +144,8 @@ class Profile extends BaseCommand {
embeds: [profileEmbed],
files: [{
name: "achievements.png",
attachment: buffer
}]
attachment: buffer,
}],
});
}
}

View file

@ -17,7 +17,7 @@ class Rep extends BaseCommand {
.setRequired(true)),
aliases: [],
dirname: __dirname,
ownerOnly: false
ownerOnly: false,
});
}
/**
@ -37,7 +37,7 @@ class Rep extends BaseCommand {
const isInCooldown = data.userData.cooldowns?.rep;
if (isInCooldown) {
if (isInCooldown > Date.now()) return interaction.error("economy/rep:COOLDOWN", {
time: client.convertTime(isInCooldown, true, true, data.guildData.language)
time: client.convertTime(isInCooldown, true, true, data.guildData.language),
});
}
@ -52,7 +52,7 @@ class Rep extends BaseCommand {
await data.userData.save();
const userData = await client.findOrCreateUser({
id: user.id
id: user.id,
});
userData.rep++;
@ -64,8 +64,8 @@ class Rep extends BaseCommand {
content: `${user}`,
files: [{
name: "achievement_unlocked6.png",
attachment: "./assets/img/achievements/achievement_unlocked6.png"
}]
attachment: "./assets/img/achievements/achievement_unlocked6.png",
}],
});
}
userData.markModified("achievements.rep");
@ -73,7 +73,7 @@ class Rep extends BaseCommand {
await userData.save();
interaction.success("economy/rep:SUCCESS", {
user: user.toString()
user: user.toString(),
});
}
}

View file

@ -20,7 +20,7 @@ class Rob extends BaseCommand {
.setRequired(true)),
aliases: [],
dirname: __dirname,
ownerOnly: false
ownerOnly: false,
});
}
/**
@ -45,7 +45,7 @@ class Rob extends BaseCommand {
const memberData = await client.findOrCreateMember({
id: member.id,
guildId: interaction.guildId
guildId: interaction.guildId,
});
if (amount > memberData.money) return interaction.error("economy/rob:NOT_ENOUGH_MEMBER", { user: member.toString() });
@ -57,7 +57,7 @@ class Rob extends BaseCommand {
const potentiallyLose = Math.floor(amount * 1.5);
if (potentiallyLose > data.memberData.money) return interaction.error("economy/rob:NOT_ENOUGH_AUTHOR", {
moneyMin: `**${potentiallyLose}** ${client.getNoun(potentiallyLose, interaction.translate("misc:NOUNS:CREDIT:1"), interaction.translate("misc:NOUNS:CREDIT:2"), interaction.translate("misc:NOUNS:CREDIT:5"))}`,
moneyCurrent: `**${data.memberData.money}** ${client.getNoun(data.memberData.money, interaction.translate("misc:NOUNS:CREDIT:1"), interaction.translate("misc:NOUNS:CREDIT:2"), interaction.translate("misc:NOUNS:CREDIT:5"))}`
moneyCurrent: `**${data.memberData.money}** ${client.getNoun(data.memberData.money, interaction.translate("misc:NOUNS:CREDIT:1"), interaction.translate("misc:NOUNS:CREDIT:2"), interaction.translate("misc:NOUNS:CREDIT:5"))}`,
});
const itsAWon = Math.floor(client.functions.randomNum(0, 100) < 25);
@ -70,7 +70,7 @@ class Rob extends BaseCommand {
const randomNum = client.functions.randomNum(1, 2);
interaction.replyT("economy/rob:ROB_WON_" + randomNum, {
money: `**${amount}** ${client.getNoun(amount, interaction.translate("misc:NOUNS:CREDIT:1"), interaction.translate("misc:NOUNS:CREDIT:2"), interaction.translate("misc:NOUNS:CREDIT:5"))}`,
user: member.toString()
user: member.toString(),
});
data.memberData.money += amount;
memberData.money -= amount;
@ -82,7 +82,7 @@ class Rob extends BaseCommand {
interaction.replyT("economy/rob:ROB_LOSE_" + randomNum, {
fine: `**${potentiallyLose}** ${client.getNoun(potentiallyLose, interaction.translate("misc:NOUNS:CREDIT:1"), interaction.translate("misc:NOUNS:CREDIT:2"), interaction.translate("misc:NOUNS:CREDIT:5"))}`,
offset: `**${won}** ${client.getNoun(won, interaction.translate("misc:NOUNS:CREDIT:1"), interaction.translate("misc:NOUNS:CREDIT:2"), interaction.translate("misc:NOUNS:CREDIT:5"))}`,
user: member.toString()
user: member.toString(),
});
data.memberData.money -= potentiallyLose;
memberData.money += won;

View file

@ -17,7 +17,7 @@ class Setbio extends BaseCommand {
.setRequired(true)),
aliases: [],
dirname: __dirname,
ownerOnly: false
ownerOnly: false,
});
}
/**

View file

@ -17,7 +17,7 @@ class Slots extends BaseCommand {
.setRequired(true)),
aliases: [],
dirname: __dirname,
ownerOnly: false
ownerOnly: false,
});
}
/**
@ -48,7 +48,7 @@ class Slots extends BaseCommand {
const colonnes = [
client.functions.shuffle(fruits),
client.functions.shuffle(fruits),
client.functions.shuffle(fruits)
client.functions.shuffle(fruits),
];
function getCredits(number, isJackpot) {
@ -87,7 +87,7 @@ class Slots extends BaseCommand {
if ((colonnes[0][i2] == colonnes[1][j2]) && (colonnes[1][j2] == colonnes[2][k2])) {
msg += "| : : : **" + (interaction.translate("common:VICTORY").toUpperCase()) + "** : : : |";
await interaction.editReply({
content: msg
content: msg,
});
const credits = getCredits(amount, true);
@ -95,8 +95,8 @@ class Slots extends BaseCommand {
content: "**!! ДЖЕКПОТ !!**\n" + interaction.translate("economy/slots:VICTORY", {
money: `**${amount}** ${client.getNoun(amount, interaction.translate("misc:NOUNS:CREDIT:1"), interaction.translate("misc:NOUNS:CREDIT:2"), interaction.translate("misc:NOUNS:CREDIT:5"))}`,
won: `**${credits}** ${client.getNoun(credits, interaction.translate("misc:NOUNS:CREDIT:1"), interaction.translate("misc:NOUNS:CREDIT:2"), interaction.translate("misc:NOUNS:CREDIT:5"))}`,
user: interaction.member.toString()
})
user: interaction.member.toString(),
}),
});
const toAdd = credits - amount;
@ -107,7 +107,7 @@ class Slots extends BaseCommand {
user: interaction.translate("economy/slots:DESCRIPTION"),
amount: toAdd,
date: Date.now(),
type: "got"
type: "got",
};
data.memberData.transactions.push(info);
@ -118,8 +118,8 @@ class Slots extends BaseCommand {
interaction.followUp({
files: [{
name: "achievement_unlocked4.png",
attachment: "./assets/img/achievements/achievement_unlocked4.png"
}]
attachment: "./assets/img/achievements/achievement_unlocked4.png",
}],
});
}
data.userData.markModified("achievements.slots");
@ -132,7 +132,7 @@ class Slots extends BaseCommand {
if (colonnes[0][i2] == colonnes[1][j2] || colonnes[1][j2] == colonnes[2][k2] || colonnes[0][i2] == colonnes[2][k2]) {
msg += "| : : : **" + (interaction.translate("common:VICTORY").toUpperCase()) + "** : : : |";
await interaction.editReply({
content: msg
content: msg,
});
const credits = getCredits(amount, false);
@ -140,8 +140,8 @@ class Slots extends BaseCommand {
content: interaction.translate("economy/slots:VICTORY", {
money: `**${amount}** ${client.getNoun(amount, interaction.translate("misc:NOUNS:CREDIT:1"), interaction.translate("misc:NOUNS:CREDIT:2"), interaction.translate("misc:NOUNS:CREDIT:5"))}`,
won: `**${credits}** ${client.getNoun(credits, interaction.translate("misc:NOUNS:CREDIT:1"), interaction.translate("misc:NOUNS:CREDIT:2"), interaction.translate("misc:NOUNS:CREDIT:5"))}`,
user: interaction.member.toString()
})
user: interaction.member.toString(),
}),
});
const toAdd = credits - amount;
@ -149,7 +149,7 @@ class Slots extends BaseCommand {
user: interaction.translate("economy/slots:DESCRIPTION"),
amount: toAdd,
date: Date.now(),
type: "got"
type: "got",
};
data.memberData.transactions.push(info);
data.memberData.money += toAdd;
@ -161,8 +161,8 @@ class Slots extends BaseCommand {
interaction.followUp({
files: [{
name: "achievement_unlocked4.png",
attachment: "./assets/img/achievements/achievement_unlocked4.png"
}]
attachment: "./assets/img/achievements/achievement_unlocked4.png",
}],
});
}
data.userData.markModified("achievements.slots");
@ -176,15 +176,15 @@ class Slots extends BaseCommand {
interaction.followUp({
content: interaction.translate("economy/slots:DEFEAT", {
money: `**${amount}** ${client.getNoun(amount, interaction.translate("misc:NOUNS:CREDIT:1"), interaction.translate("misc:NOUNS:CREDIT:2"), interaction.translate("misc:NOUNS:CREDIT:5"))}`,
user: interaction.member.toString()
})
user: interaction.member.toString(),
}),
});
const info = {
user: interaction.translate("economy/slots:DESCRIPTION"),
amount: amount,
date: Date.now(),
type: "send"
type: "send",
};
data.memberData.transactions.push(info);
data.memberData.money -= amount;
@ -216,7 +216,7 @@ class Slots extends BaseCommand {
msg += colonnes[0][i3] + " : " + colonnes[1][j3] + " : " + colonnes[2][k3] + "\n";
await interaction.editReply({
content: msg
content: msg,
});
}
}

View file

@ -18,7 +18,7 @@ class TicTacToe extends BaseCommand {
.setRequired(true)),
aliases: [],
dirname: __dirname,
ownerOnly: false
ownerOnly: false,
});
}
/**
@ -38,11 +38,11 @@ class TicTacToe extends BaseCommand {
tictactoe(interaction, {
resultBtn: true,
embedColor: client.config.embed.color,
embedFoot: client.config.embed.footer
embedFoot: client.config.embed.footer,
}).then(async winner => {
const memberData = await client.findOrCreateMember({
id: winner.id,
guildId: interaction.guildId
guildId: interaction.guildId,
});
memberData.money += 100;
@ -52,7 +52,7 @@ class TicTacToe extends BaseCommand {
user: interaction.translate("economy/transactions:TTT"),
amount: 100,
date: Date.now(),
type: "got"
type: "got",
};
memberData.transactions.push(info);
});

View file

@ -16,7 +16,7 @@ class Transactions extends BaseCommand {
.setDescription(client.translate("economy/transactions:CLEAR"))),
aliases: [],
dirname: __dirname,
ownerOnly: false
ownerOnly: false,
});
}
/**
@ -43,11 +43,11 @@ class Transactions extends BaseCommand {
const embed = new EmbedBuilder()
.setAuthor({
name: interaction.translate("economy/transactions:EMBED_TRANSACTIONS"),
iconURL: interaction.member.displayAvatarURL()
iconURL: interaction.member.displayAvatarURL(),
})
.setColor(client.config.embed.color)
.setFooter({
text: client.config.embed.footer
text: client.config.embed.footer,
});
const transactions = data.memberData.transactions,
@ -65,20 +65,20 @@ class Transactions extends BaseCommand {
{
name: interaction.translate("economy/transactions:T_GOT"),
value: sortedTransactions[0].join("\n"),
inline: true
}
inline: true,
},
]);
if (sortedTransactions[1].length > 0) embed.addFields([
{
name: interaction.translate("economy/transactions:T_SEND"),
value: sortedTransactions[1].join("\n"),
inline: true
}
inline: true,
},
]);
}
interaction.reply({
embeds: [embed]
embeds: [embed],
});
}
}

View file

@ -14,7 +14,7 @@ class Work extends BaseCommand {
.setDMPermission(false),
aliases: [],
dirname: __dirname,
ownerOnly: false
ownerOnly: false,
});
}
/**
@ -34,7 +34,7 @@ class Work extends BaseCommand {
const isInCooldown = data.memberData.cooldowns?.work;
if (isInCooldown) {
if (isInCooldown > Date.now()) return interaction.error("economy/work:COOLDOWN", {
time: client.convertTime(isInCooldown, true, true, data.guildData.language)
time: client.convertTime(isInCooldown, true, true, data.guildData.language),
});
}
if (Date.now() > data.memberData.cooldowns.work + (24 * 60 * 60 * 1000)) data.memberData.workStreak = 0;
@ -49,7 +49,7 @@ class Work extends BaseCommand {
const embed = new EmbedBuilder()
.setFooter({
text: interaction.translate("economy/work:AWARD"),
iconURL: interaction.member.displayAvatarURL()
iconURL: interaction.member.displayAvatarURL(),
})
.setColor(client.config.embed.color);
@ -58,7 +58,7 @@ class Work extends BaseCommand {
client.customEmojis.letters.w,
client.customEmojis.letters.a,
client.customEmojis.letters.r,
client.customEmojis.letters.d
client.customEmojis.letters.d,
];
let won = 200;
@ -68,13 +68,13 @@ class Work extends BaseCommand {
{
name: interaction.translate("economy/work:SALARY"),
value: interaction.translate("economy/work:SALARY_CONTENT", {
won: `**${won}** ${client.getNoun(won, interaction.translate("misc:NOUNS:CREDIT:1"), interaction.translate("misc:NOUNS:CREDIT:2"), interaction.translate("misc:NOUNS:CREDIT:5"))}`
})
won: `**${won}** ${client.getNoun(won, interaction.translate("misc:NOUNS:CREDIT:1"), interaction.translate("misc:NOUNS:CREDIT:2"), interaction.translate("misc:NOUNS:CREDIT:5"))}`,
}),
},
{
name: interaction.translate("economy/work:STREAK"),
value: interaction.translate("economy/work:STREAK_CONTENT")
}
value: interaction.translate("economy/work:STREAK_CONTENT"),
},
]);
data.memberData.workStreak = 0;
} else {
@ -88,13 +88,13 @@ class Work extends BaseCommand {
{
name: interaction.translate("economy/work:SALARY"),
value: interaction.translate("economy/work:SALARY_CONTENT", {
won: `**${won}** ${client.getNoun(won, interaction.translate("misc:NOUNS:CREDIT:1"), interaction.translate("misc:NOUNS:CREDIT:2"), interaction.translate("misc:NOUNS:CREDIT:5"))}`
})
won: `**${won}** ${client.getNoun(won, interaction.translate("misc:NOUNS:CREDIT:1"), interaction.translate("misc:NOUNS:CREDIT:2"), interaction.translate("misc:NOUNS:CREDIT:5"))}`,
}),
},
{
name: interaction.translate("economy/work:STREAK"),
value: award.join("")
}
value: award.join(""),
},
]);
}
@ -105,19 +105,19 @@ class Work extends BaseCommand {
user: interaction.translate("economy/work:SALARY"),
amount: won,
date: Date.now(),
type: "got"
type: "got",
};
data.memberData.transactions.push(info);
const messageOptions = {
embeds: [embed]
embeds: [embed],
};
if (!data.userData.achievements.work.achieved) {
data.userData.achievements.work.progress.now += 1;
if (data.userData.achievements.work.progress.now === data.userData.achievements.work.progress.total) {
messageOptions.files = [{
name: "unlocked.png",
attachment: "./assets/img/achievements/achievement_unlocked1.png"
attachment: "./assets/img/achievements/achievement_unlocked1.png",
}];
data.userData.achievements.work.achieved = true;
}

View file

@ -17,7 +17,7 @@ class Eightball extends BaseCommand {
.setRequired(true)),
aliases: [],
dirname: __dirname,
ownerOnly: false
ownerOnly: false,
});
}
/**
@ -42,7 +42,7 @@ class Eightball extends BaseCommand {
interaction.replyT("fun/8ball:ANSWER", {
question,
answer
answer,
}, { edit: true });
}
}

View file

@ -15,7 +15,7 @@ class Cat extends BaseCommand {
.setDMPermission(true),
aliases: [],
dirname: __dirname,
ownerOnly: false
ownerOnly: false,
});
}
/**
@ -37,7 +37,7 @@ class Cat extends BaseCommand {
const res = await fetch("https://and-here-is-my-code.glitch.me/img/cat").then(response => response.json());
interaction.editReply({
content: res.Link
content: res.Link,
});
}
}

View file

@ -15,7 +15,7 @@ class Crab extends BaseCommand {
.setDMPermission(true),
aliases: [],
dirname: __dirname,
ownerOnly: false
ownerOnly: false,
});
}
/**
@ -37,7 +37,7 @@ class Crab extends BaseCommand {
const res = await fetch("https://and-here-is-my-code.glitch.me/img/crab").then(response => response.json());
interaction.editReply({
content: res.Link
content: res.Link,
});
}
}

View file

@ -15,7 +15,7 @@ class Dog extends BaseCommand {
.setDMPermission(true),
aliases: [],
dirname: __dirname,
ownerOnly: false
ownerOnly: false,
});
}
/**
@ -37,7 +37,7 @@ class Dog extends BaseCommand {
const res = await fetch("https://and-here-is-my-code.glitch.me/img/dog").then(response => response.json());
interaction.editReply({
content: res.Link
content: res.Link,
});
}
}

View file

@ -21,7 +21,7 @@ class LMGTFY extends BaseCommand {
.setRequired(true)),
aliases: [],
dirname: __dirname,
ownerOnly: false
ownerOnly: false,
});
}
/**
@ -47,12 +47,12 @@ class LMGTFY extends BaseCommand {
interaction.reply({
content: `<${res}>`,
ephemeral: true
ephemeral: true,
});
} else {
interaction.reply({
content: `<${url}>`,
ephemeral: true
ephemeral: true,
});
}
}

View file

@ -22,7 +22,7 @@ class Lovecalc extends BaseCommand {
.setDescription(client.translate("common:USER"))),
aliases: [],
dirname: __dirname,
ownerOnly: false
ownerOnly: false,
});
}
/**
@ -53,20 +53,20 @@ class Lovecalc extends BaseCommand {
const embed = new EmbedBuilder()
.setAuthor({
name: `❤️ ${interaction.translate("fun/lovecalc:DESCRIPTION")}`
name: `❤️ ${interaction.translate("fun/lovecalc:DESCRIPTION")}`,
})
.setDescription(interaction.translate("fun/lovecalc:CONTENT", {
percent,
firstMember: firstMember,
secondMember: secondMember
secondMember: secondMember,
}))
.setColor(client.config.embed.color)
.setFooter({
text: client.config.embed.footer
text: client.config.embed.footer,
});
interaction.reply({
embeds: [embed]
embeds: [embed],
});
}
}

View file

@ -15,7 +15,7 @@ class Memes extends BaseCommand {
.setDMPermission(false),
aliases: [],
dirname: __dirname,
ownerOnly: false
ownerOnly: false,
});
}
/**
@ -37,8 +37,8 @@ class Memes extends BaseCommand {
const tags = ["memes", "dankmemes", "me_irl", "wholesomememes"].map(tag =>
JSON.parse(JSON.stringify({
label: tag,
value: tag
}))
value: tag,
})),
);
const row = new ActionRowBuilder()
@ -46,13 +46,13 @@ class Memes extends BaseCommand {
new SelectMenuBuilder()
.setCustomId("memes_select")
.setPlaceholder(client.translate("common:NOTHING_SELECTED"))
.addOptions(tags)
.addOptions(tags),
);
const msg = await interaction.editReply({
content: interaction.translate("common:AVAILABLE_OPTIONS"),
fetchReply: true,
components: [row]
components: [row],
});
const filter = i => i.user.id === interaction.user.id;
@ -68,7 +68,7 @@ class Memes extends BaseCommand {
const embed = new EmbedBuilder()
.setColor(client.config.embed.color)
.setFooter({
text: client.config.embed.footer
text: client.config.embed.footer,
})
.setTitle(res.title)
.setDescription(`${interaction.translate("fun/memes:SUBREDDIT")}: **${res.subreddit}**\n${interaction.translate("common:AUTHOR")}: **${res.author}**\n${interaction.translate("fun/memes:UPS")}: **${res.ups}**`)
@ -76,14 +76,14 @@ class Memes extends BaseCommand {
.setTimestamp();
await interaction.editReply({
embeds: [embed]
embeds: [embed],
});
}
});
collector.on("end", () => {
return interaction.editReply({
components: []
components: [],
});
});
}

View file

@ -15,7 +15,7 @@ class Activity extends BaseCommand {
.setDMPermission(false),
aliases: [],
dirname: __dirname,
ownerOnly: false
ownerOnly: false,
});
}
/**
@ -43,7 +43,7 @@ class Activity extends BaseCommand {
const activities = defaultApplications.map(a => {
return {
label: `${a.name} ${a.premium_tier_level ? `(${interaction.translate("general/activity:BOOST_NEEDED")})` : ""}`,
value: a.id
value: a.id,
};
});
@ -52,12 +52,12 @@ class Activity extends BaseCommand {
new SelectMenuBuilder()
.setCustomId("activity_select")
.setPlaceholder(client.translate("common:NOTHING_SELECTED"))
.addOptions(activities)
.addOptions(activities),
);
await interaction.editReply({
content: interaction.translate("general/activity:AVAILABLE_ACTIVITIES"),
components: [row]
components: [row],
});
const filter = i => i.user.id === interaction.user.id;
@ -73,23 +73,23 @@ class Activity extends BaseCommand {
.setColor(client.config.embed.color)
.setDescription(`**[${interaction.translate("general/activity:CLICK_HERE", {
activity: defaultApplications.find(a => a.id === activity).name,
channel: voice.name
channel: voice.name,
})}](${invite.code})**`)
.setFooter({
text: client.config.embed.footer
text: client.config.embed.footer,
})
.setTimestamp();
await interaction.editReply({
embeds: [embed],
components: []
components: [],
});
}
});
collector.on("end", () => {
return interaction.editReply({
components: []
components: [],
});
});
}

View file

@ -17,7 +17,7 @@ class Afk extends BaseCommand {
.setRequired(true)),
aliases: [],
dirname: __dirname,
ownerOnly: false
ownerOnly: false,
});
}
/**
@ -40,7 +40,7 @@ class Afk extends BaseCommand {
data.userData.save();
interaction.success("general/afk:SUCCESS", {
reason
reason,
}, { ephemeral: true });
}
}

View file

@ -16,7 +16,7 @@ class Avatar extends BaseCommand {
.setDescription(client.translate("common:USER"))),
aliases: [],
dirname: __dirname,
ownerOnly: false
ownerOnly: false,
});
}
/**
@ -35,13 +35,13 @@ class Avatar extends BaseCommand {
async execute(client, interaction) {
const user = interaction.options.getUser("user") || interaction.user;
const avatarURL = user.displayAvatarURL({
size: 512
size: 512,
});
interaction.reply({
files: [{
attachment: avatarURL
}]
attachment: avatarURL,
}],
});
}
}

View file

@ -17,7 +17,7 @@ class Emoji extends BaseCommand {
.setRequired(true)),
aliases: [],
dirname: __dirname,
ownerOnly: false
ownerOnly: false,
});
}
/**
@ -40,34 +40,34 @@ class Emoji extends BaseCommand {
const embed = new EmbedBuilder()
.setAuthor({
name: interaction.translate("general/emoji:TITLE", {
emoji: parsedEmoji.name
})
emoji: parsedEmoji.name,
}),
})
.setColor(client.config.embed.color)
.setFooter({
text: client.config.embed.footer
text: client.config.embed.footer,
})
.addFields([
{
name: interaction.translate("common:NAME"),
value: parsedEmoji.name
value: parsedEmoji.name,
},
{
name: interaction.translate("general/emoji:ANIMATED"),
value: parsedEmoji.animated ? interaction.translate("common:YES") : interaction.translate("common:NO")
value: parsedEmoji.animated ? interaction.translate("common:YES") : interaction.translate("common:NO"),
},
{
name: interaction.translate("common:ID"),
value: parsedEmoji.id?.toString() || interaction.translate("general/emoji:STANDART")
value: parsedEmoji.id?.toString() || interaction.translate("general/emoji:STANDART"),
},
{
name: interaction.translate("general/emoji:LINK"),
value: `https://cdn.discordapp.com/emojis/${parsedEmoji.id}.${parsedEmoji.animated ? "gif" : "png"}`
}
value: `https://cdn.discordapp.com/emojis/${parsedEmoji.id}.${parsedEmoji.animated ? "gif" : "png"}`,
},
]);
interaction.reply({
embeds: [embed]
embeds: [embed],
});
}
}

View file

@ -17,7 +17,7 @@ class Help extends BaseCommand {
.setDescription(client.translate("common:COMMAND"))),
aliases: [],
dirname: __dirname,
ownerOnly: false
ownerOnly: false,
});
}
/**
@ -52,7 +52,7 @@ class Help extends BaseCommand {
const categoriesRows = categories.sort().map(c => {
return {
label: `${c} (${commands.filter(cmd => cmd.category === c).length})`,
value: c
value: c,
};
});
@ -61,13 +61,13 @@ class Help extends BaseCommand {
new SelectMenuBuilder()
.setCustomId("help_category_select")
.setPlaceholder(client.translate("common:NOTHING_SELECTED"))
.addOptions(categoriesRows)
.addOptions(categoriesRows),
);
const msg = await interaction.editReply({
content: interaction.translate("common:AVAILABLE_OPTIONS"),
fetchReply: true,
components: [row]
components: [row],
});
const filter = i => i.user.id === interaction.user.id;
@ -81,36 +81,36 @@ class Help extends BaseCommand {
const categoryCommands = commands.filter(cmd => cmd.category === arg).map(c => {
return {
name: `**${c.command.name}**`,
value: interaction.translate(`${arg.toLowerCase()}/${c.command.name}:DESCRIPTION`)
value: interaction.translate(`${arg.toLowerCase()}/${c.command.name}:DESCRIPTION`),
};
});
const embed = new EmbedBuilder()
.setColor(client.config.embed.color)
.setFooter({
text: client.config.embed.footer
text: client.config.embed.footer,
})
.setAuthor({
name: interaction.translate("general/help:COMMANDS_IN", { category: arg })
name: interaction.translate("general/help:COMMANDS_IN", { category: arg }),
})
.addFields(categoryCommands)
.addFields([
{
name: "\u200B",
value: interaction.translate("general/help:INFO")
}
value: interaction.translate("general/help:INFO"),
},
]);
return interaction.editReply({
content: null,
embeds: [embed]
embeds: [embed],
});
}
});
collector.on("end", () => {
return interaction.editReply({
components: []
components: [],
});
});
}
@ -132,21 +132,21 @@ function generateCommandHelp(interaction, command) {
const embed = new EmbedBuilder()
.setAuthor({
name: interaction.translate("general/help:CMD_TITLE", {
cmd: cmd.command.name
})
cmd: cmd.command.name,
}),
})
.addFields([
{
name: interaction.translate("general/help:FIELD_DESCRIPTION"),
value: interaction.translate(`${cmd.category.toLowerCase()}/${cmd.command.name}:DESCRIPTION`)
value: interaction.translate(`${cmd.category.toLowerCase()}/${cmd.command.name}:DESCRIPTION`),
},
{
name: interaction.translate("general/help:FIELD_USAGE"),
value: `*${cmd.command.dm_permission === false ? interaction.translate("general/help:GUILD_ONLY") : interaction.translate("general/help:NOT_GUILD_ONLY")}*\n\n` + usage
value: `*${cmd.command.dm_permission === false ? interaction.translate("general/help:GUILD_ONLY") : interaction.translate("general/help:NOT_GUILD_ONLY")}*\n\n` + usage,
},
{
name: interaction.translate("general/help:FIELD_EXAMPLES"),
value: interaction.translate(`${cmd.category.toLowerCase()}/${cmd.command.name}:EXAMPLES`)
value: interaction.translate(`${cmd.category.toLowerCase()}/${cmd.command.name}:EXAMPLES`),
},
// {
// name: interaction.translate("general/help:FIELD_ALIASES"),
@ -154,12 +154,12 @@ function generateCommandHelp(interaction, command) {
// },
{
name: interaction.translate("general/help:FIELD_PERMISSIONS"),
value: cmd.command.default_member_permissions > 0 ? interaction.translate(`misc:PERMISSIONS:${getPermName(cmd.command.default_member_permissions)}`) : interaction.translate("general/help:NO_REQUIRED_PERMISSION")
}
value: cmd.command.default_member_permissions > 0 ? interaction.translate(`misc:PERMISSIONS:${getPermName(cmd.command.default_member_permissions)}`) : interaction.translate("general/help:NO_REQUIRED_PERMISSION"),
},
])
.setColor(interaction.client.config.embed.color)
.setFooter({
text: interaction.client.config.embed.footer
text: interaction.client.config.embed.footer,
});
return embed;

View file

@ -18,7 +18,7 @@ class Minecraft extends BaseCommand {
.setRequired(true)),
aliases: [],
dirname: __dirname,
ownerOnly: false
ownerOnly: false,
});
}
/**
@ -40,7 +40,7 @@ class Minecraft extends BaseCommand {
const ip = interaction.options.getString("ip");
const options = {
type: "minecraft",
host: ip
host: ip,
};
if (ip.split(":").length > 1) {
@ -49,7 +49,7 @@ class Minecraft extends BaseCommand {
options.port = splitIp[1];
}
var res = await gamedig.query(options).catch(() => {});
let res = await gamedig.query(options).catch(() => {});
if (!res) {
options.type = "minecraftpe";
@ -60,41 +60,41 @@ class Minecraft extends BaseCommand {
const embed = new EmbedBuilder()
.setAuthor({
name: res.name
name: res.name,
})
.addFields([
{
name: interaction.translate("general/minecraft:FIELD_STATUS"),
value: interaction.translate("general/minecraft:ONLINE")
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"))}`
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
inline: true,
},
{
name: interaction.translate("general/minecraft:FIELD_VERSION"),
value: res.raw.vanilla.raw.version.name,
inline: true
inline: true,
},
{
name: interaction.translate("general/minecraft:FIELD_PING"),
value: res.raw.vanilla.ping.toString()
}
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
text: client.config.embed.footer,
});
interaction.editReply({
embeds: [embed]
embeds: [embed],
});
}
}

View file

@ -14,7 +14,7 @@ class Ping extends BaseCommand {
.setDMPermission(true),
aliases: [],
dirname: __dirname,
ownerOnly: false
ownerOnly: false,
});
}
/**
@ -32,7 +32,7 @@ class Ping extends BaseCommand {
*/
async execute(client, interaction) {
interaction.replyT("general/ping:CONTENT", {
ping: Math.round(client.ws.ping)
ping: Math.round(client.ws.ping),
});
}
}

View file

@ -22,7 +22,7 @@ class Remindme extends BaseCommand {
.setRequired(true)),
aliases: [],
dirname: __dirname,
ownerOnly: false
ownerOnly: false,
});
}
/**
@ -49,7 +49,7 @@ class Remindme extends BaseCommand {
const rData = {
message: message,
createdAt: dateNow,
sendAt: dateNow + ms(time)
sendAt: dateNow + ms(time),
};
data.userData.reminds.push(rData);
@ -59,7 +59,7 @@ class Remindme extends BaseCommand {
interaction.success("general/remindme:SAVED", {
message,
time: moment(rData.createdAt).locale(interaction.guild.data.language).format("dddd, Do MMMM YYYY, HH:mm:ss")
time: moment(rData.createdAt).locale(interaction.guild.data.language).format("dddd, Do MMMM YYYY, HH:mm:ss"),
}, { edit: true });
}
}

View file

@ -20,7 +20,7 @@ class Report extends BaseCommand {
.setRequired(true)),
aliases: [],
dirname: __dirname,
ownerOnly: false
ownerOnly: false,
});
}
/**
@ -46,51 +46,51 @@ class Report extends BaseCommand {
const embed = new EmbedBuilder()
.setAuthor({
name: interaction.translate("general/report:TITLE", {
user: member.user.tag
user: member.user.tag,
}),
iconURL: interaction.user.displayAvatarURL({
extension: "png",
size: 512
})
size: 512,
}),
})
.addFields([
{
name: interaction.translate("common:DATE"),
value: client.printDate(new Date(Date.now()))
value: client.printDate(new Date(Date.now())),
},
{
name: interaction.translate("common:AUTHOR"),
value: interaction.user.toString(),
inline: true
inline: true,
},
{
name: interaction.translate("common:USER"),
value: member.user.toString(),
inline: true
inline: true,
},
{
name: interaction.translate("common:REASON"),
value: rep,
inline: true
}
inline: true,
},
])
.setColor(client.config.embed.color)
.setFooter({
text: client.config.embed.footer
text: client.config.embed.footer,
});
const success = parseEmoji(client.customEmojis.cool).id;
const error = parseEmoji(client.customEmojis.notcool).id;
repChannel.send({
embeds: [embed]
embeds: [embed],
}).then(async m => {
await m.react(success);
await m.react(error);
});
interaction.success("general/report:SUCCESS", {
channel: repChannel.toString()
channel: repChannel.toString(),
});
}
}

View file

@ -14,7 +14,7 @@ class Serverinfo extends BaseCommand {
.setDMPermission(false),
aliases: [],
dirname: __dirname,
ownerOnly: false
ownerOnly: false,
});
}
/**
@ -39,66 +39,66 @@ class Serverinfo extends BaseCommand {
const embed = new EmbedBuilder()
.setAuthor({
name: guild.name,
iconURL: guild.iconURL()
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})`
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
inline: true,
},
{
name: client.customEmojis.calendar + interaction.translate("common:CREATION"),
value: client.printDate(guild.createdAt),
inline: true
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
inline: true,
},
{
name: client.customEmojis.afk + interaction.translate("general/serverinfo:AFK_CHANNEL"),
value: guild.afkChannel?.toString() || interaction.translate("common:MISSING"),
inline: true
inline: true,
},
{
name: client.customEmojis.id + interaction.translate("common:SERVER_ID"),
value: guild.id,
inline: true
inline: true,
},
{
name: client.customEmojis.crown + interaction.translate("common:OWNER"),
value: owner.toString(),
inline: true
inline: true,
},
{
name: client.customEmojis.boost + interaction.translate("general/serverinfo:BOOSTS"),
value: guild.premiumSubscriptionCount?.toString() || "0",
inline: true
inline: true,
},
{
name: client.customEmojis.channels + interaction.translate("common:CHANNELS"),
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 === 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 === 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,
},
])
.setColor(client.config.embed.color)
.setFooter({
text: client.config.embed.footer
text: client.config.embed.footer,
});
interaction.reply({
embeds: [embed]
embeds: [embed],
});
}
}

View file

@ -18,7 +18,7 @@ class Shorturl extends BaseCommand {
.setRequired(true)),
aliases: [],
dirname: __dirname,
ownerOnly: false
ownerOnly: false,
});
}
/**
@ -40,7 +40,7 @@ class Shorturl extends BaseCommand {
interaction.reply({
content: `<${res}>`,
ephemeral: true
ephemeral: true,
});
}
}

View file

@ -14,7 +14,7 @@ class Staff extends BaseCommand {
.setDMPermission(false),
aliases: [],
dirname: __dirname,
ownerOnly: false
ownerOnly: false,
});
}
/**
@ -37,26 +37,26 @@ class Staff extends BaseCommand {
const embed = new EmbedBuilder()
.setAuthor({
name: interaction.translate("general/staff:TITLE", {
guild: interaction.guild.name
})
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"))
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"))
}
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
text: client.config.embed.footer,
});
interaction.reply({
embeds: [embed]
embeds: [embed],
});
}
}

View file

@ -1,4 +1,3 @@
const { SlashCommandBuilder, EmbedBuilder, PermissionsBitField, version } = require("discord.js");
const BaseCommand = require("../../base/BaseCommand");
@ -15,7 +14,7 @@ class Stats extends BaseCommand {
.setDMPermission(true),
aliases: [],
dirname: __dirname,
ownerOnly: false
ownerOnly: false,
});
}
/**
@ -39,10 +38,10 @@ class Stats extends BaseCommand {
const statsEmbed = new EmbedBuilder()
.setColor(client.config.embed.color)
.setFooter({
text: client.config.embed.footer
text: client.config.embed.footer,
})
.setAuthor({
name: interaction.translate("common:STATS")
name: interaction.translate("common:STATS"),
})
.setDescription(interaction.translate("general/stats:MADE"))
.addFields([
@ -50,35 +49,35 @@ class Stats extends BaseCommand {
name: client.customEmojis.stats + " " + interaction.translate("general/stats:COUNTS_TITLE"),
value: interaction.translate("general/stats:COUNTS_CONTENT", {
servers: servers,
users: users
users: users,
}),
inline: true
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
inline: true,
},
{
name: client.customEmojis.ram + " " + interaction.translate("general/stats:RAM_TITLE"),
value: `\`${(process.memoryUsage().heapUsed / 1024 / 1024).toFixed(2)}MB\``,
inline: true
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, data.guildData.language)
})
time: client.convertTime(Date.now() + client.uptime, true, true, data.guildData.language),
}),
},
{
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"))}`
})
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")
value: interaction.translate("general/stats:CREDITS_CONTENT"),
},
{
name: client.customEmojis.link + " " + interaction.translate("general/stats:LINKS_TITLE"),
@ -87,13 +86,13 @@ class Stats extends BaseCommand {
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
})
}
owner: client.config.owner.id,
}),
},
]);
interaction.reply({
embeds: [statsEmbed]
embeds: [statsEmbed],
});
}
}

View file

@ -17,7 +17,7 @@ class Suggest extends BaseCommand {
.setRequired(true)),
aliases: [],
dirname: __dirname,
ownerOnly: false
ownerOnly: false,
});
}
/**
@ -41,43 +41,43 @@ class Suggest extends BaseCommand {
const embed = new EmbedBuilder()
.setAuthor({
name: interaction.translate("general/suggest:TITLE", {
user: interaction.user.tag
user: interaction.user.tag,
}),
iconURL: interaction.member.displayAvatarURL()
iconURL: interaction.member.displayAvatarURL(),
})
.addFields([
{
name: interaction.translate("common:DATE"),
value: client.printDate(new Date(Date.now()))
value: client.printDate(new Date(Date.now())),
},
{
name: interaction.translate("common:AUTHOR"),
value: interaction.user.toString(),
inline: true
inline: true,
},
{
name: interaction.translate("common:CONTENT"),
value: suggestion,
inline: true
}
inline: true,
},
])
.setColor(client.config.embed.color)
.setFooter({
text: client.config.embed.footer
text: client.config.embed.footer,
});
const success = parseEmoji(client.customEmojis.cool).id;
const error = parseEmoji(client.customEmojis.notcool).id;
suggChannel.send({
embeds: [embed]
embeds: [embed],
}).then(async m => {
await m.react(success);
await m.react(error);
});
interaction.success("general/suggest:SUCCESS", {
channel: suggChannel.toString()
channel: suggChannel.toString(),
});
}
}

View file

@ -16,7 +16,7 @@ class Userinfo extends BaseCommand {
.setDescription(client.translate("common:USER"))),
aliases: [],
dirname: __dirname,
ownerOnly: false
ownerOnly: false,
});
}
/**
@ -37,58 +37,58 @@ class Userinfo extends BaseCommand {
const embed = new EmbedBuilder()
.setAuthor({
name: `${member.user.tag} (${member.id})`,
iconURL: member.displayAvatarURL()
iconURL: member.displayAvatarURL(),
})
.setThumbnail(member.displayAvatarURL({
size: 512
size: 512,
}))
.addFields([
{
name: ":man: " + interaction.translate("common:USERNAME"),
value: member.user.tag,
inline: true
inline: true,
},
{
name: client.customEmojis.pencil + " " + interaction.translate("common:NICKNAME"),
value: member.nickname || interaction.translate("general/userinfo:NO_NICKNAME"),
inline: true
inline: true,
},
{
name: client.customEmojis.status[member.presence.status] + " " + interaction.translate("common:STATUS"),
value: interaction.translate(`common:STATUS_${member.presence.status.toUpperCase()}`),
inline: true
inline: true,
},
{
name: client.customEmojis.bot + " " + interaction.translate("common:ROBOT"),
value: member.user.bot ? interaction.translate("common:YES") : interaction.translate("common:NO"),
inline: true
inline: true,
},
{
name: client.customEmojis.calendar + " " + interaction.translate("common:CREATION"),
value: client.printDate(member.user.createdAt),
inline: true
inline: true,
},
{
name: client.customEmojis.calendar2 + " " + interaction.translate("common:JOINED"),
value: client.printDate(member.joinedAt),
inline: true
inline: true,
},
{
name: client.customEmojis.color + " " + interaction.translate("common:COLOR"),
value: member.displayHexColor,
inline: true
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
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
}
inline: true,
},
])
.setColor(client.config.embed.color)
.setFooter({
text: client.config.embed.footer
text: client.config.embed.footer,
});
if (member.presence.activities[0]?.name === "Custom Status") {
@ -96,21 +96,21 @@ class Userinfo extends BaseCommand {
{
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
}
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_ACTIVITY"),
inline: true
}
inline: true,
},
]);
}
interaction.reply({
embeds: [embed]
embeds: [embed],
});
}
}

View file

@ -18,7 +18,7 @@ class Whois extends BaseCommand {
.setRequired(true)),
aliases: [],
dirname: __dirname,
ownerOnly: false
ownerOnly: false,
});
}
/**
@ -42,10 +42,10 @@ class Whois extends BaseCommand {
if (whois.status === "fail") return interaction.editReply({ content: interaction.translate("general/whois:ERROR", { ip }) });
const embed = new EmbedBuilder()
.setTitle(interaction.translate("general/whois:INFO_ABOUT", {
ip
ip,
}))
.setFooter({
text: client.config.embed.footer
text: client.config.embed.footer,
})
.setColor(client.config.embed.color)
.addFields(
@ -57,7 +57,7 @@ class Whois extends BaseCommand {
{ 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 }
{ name: interaction.translate("general/whois:ISP"), value: `${whois.isp || interaction.translate("common:UNKNOWN")}`, inline: true },
)
.setTimestamp();
@ -66,7 +66,7 @@ class Whois extends BaseCommand {
else if (whois.hosting) embed.addFields({ name: interaction.translate("general/whois:INFO"), value: interaction.translate("general/whois:HOSTING") });
interaction.editReply({
embeds: [embed]
embeds: [embed],
});
}
}

View file

@ -20,7 +20,7 @@ class Clear extends BaseCommand {
.setDescription(client.translate("common:USER"))),
aliases: [],
dirname: __dirname,
ownerOnly: false
ownerOnly: false,
});
}
/**
@ -57,7 +57,7 @@ class Clear extends BaseCommand {
await interaction.editReply({
content: interaction.translate("moderation/clear:ALL_CONFIRM"),
components: [row]
components: [row],
});
const filter = i => i.user.id === interaction.user.id;
@ -74,7 +74,7 @@ class Clear extends BaseCommand {
newChannel.setPosition(position);
return newChannel.send({
content: interaction.translate("moderation/clear:CHANNEL_CLEARED")
content: interaction.translate("moderation/clear:CHANNEL_CLEARED"),
});
} else if (i.customId === "clear_confirm_no") {
i.deferUpdate();
@ -91,7 +91,7 @@ class Clear extends BaseCommand {
interaction.editReply({
content: interaction.translate("misc:SELECT_CANCELED"),
components: [row]
components: [row],
});
} else if (reason === "idle") {
row.components.forEach(component => {
@ -99,14 +99,14 @@ class Clear extends BaseCommand {
});
interaction.editReply({
components: [row]
components: [row],
});
}
});
} else {
if (isNaN(option) || parseInt(option) < 1) return interaction.error("misc:OPTION_NAN_ALL", null, { ephemeral: true });
let messages = await interaction.channel.messages.fetch({
limit: option
limit: option,
});
if (member) messages = messages.filter(m => m.author.id === member.id);
if (messages.length > option) messages.length = parseInt(option, 10);
@ -116,11 +116,11 @@ class Clear extends BaseCommand {
if (member) {
interaction.replyT("moderation/clear:CLEARED_MEMBER", {
amount: `**${option}** ${client.getNoun(option, interaction.translate("misc:NOUNS:MESSAGES:1"), interaction.translate("misc:NOUNS:MESSAGES:2"), interaction.translate("misc:NOUNS:MESSAGES:5"))}`,
username: member.user.tag
username: member.user.tag,
}, { ephemeral: true, edit: true });
} else {
interaction.replyT("moderation/clear:CLEARED", {
amount: `**${option}** ${client.getNoun(option, interaction.translate("misc:NOUNS:MESSAGES:1"), interaction.translate("misc:NOUNS:MESSAGES:2"), interaction.translate("misc:NOUNS:MESSAGES:5"))}`
amount: `**${option}** ${client.getNoun(option, interaction.translate("misc:NOUNS:MESSAGES:1"), interaction.translate("misc:NOUNS:MESSAGES:2"), interaction.translate("misc:NOUNS:MESSAGES:5"))}`,
}, { ephemeral: true, edit: true });
}
}

View file

@ -18,7 +18,7 @@ class Clearwarns extends BaseCommand {
.setRequired(true)),
aliases: [],
dirname: __dirname,
ownerOnly: false
ownerOnly: false,
});
}
/**
@ -39,13 +39,13 @@ class Clearwarns extends BaseCommand {
const memberData = await client.findOrCreateMember({
id: member.id,
guildId: interaction.guildId
guildId: interaction.guildId,
});
memberData.sanctions = [];
memberData.save();
interaction.success("moderation/clearwarns:SUCCESS", {
username: member.user.tag
username: member.user.tag,
});
}
}

View file

@ -27,29 +27,29 @@ class Giveaway extends BaseCommand {
.setRequired(true))
.addBooleanOption(option => option.setName("isdrop")
.setDescription(client.translate("moderation/giveaway:ISDROP"))
.setRequired(true))
.setRequired(true)),
)
.addSubcommand(subcommand => subcommand.setName("reroll")
.setDescription(client.translate("moderation/giveaway:REROLL"))
.addStringOption(option => option.setName("giveaway_id")
.setDescription(client.translate("moderation/giveaway:GIVEAWAY_ID"))
.setRequired(true))
.setRequired(true)),
)
.addSubcommand(subcommand => subcommand.setName("end")
.setDescription(client.translate("moderation/giveaway:END"))
.addStringOption(option => option.setName("giveaway_id")
.setDescription(client.translate("moderation/giveaway:GIVEAWAY_ID"))
.setRequired(true))
.setRequired(true)),
)
.addSubcommand(subcommand => subcommand.setName("delete")
.setDescription(client.translate("moderation/giveaway:DELETE"))
.addStringOption(option => option.setName("giveaway_id")
.setDescription(client.translate("moderation/giveaway:GIVEAWAY_ID"))
.setRequired(true))
.setRequired(true)),
),
aliases: [],
dirname: __dirname,
ownerOnly: false
ownerOnly: false,
});
}
/**
@ -99,8 +99,8 @@ class Giveaway extends BaseCommand {
noWinner: interaction.translate("moderation/giveaway:NO_WINNER"),
winners: interaction.translate("moderation/giveaway:WINNERS"),
endedAt: interaction.translate("moderation/giveaway:END_AT"),
hostedBy: interaction.translate("moderation/giveaway:HOSTED_BY")
}
hostedBy: interaction.translate("moderation/giveaway:HOSTED_BY"),
},
}).then(() => {
return interaction.success("moderation/giveaway:GIVEAWAY_CREATED", null, { ephemeral: true });
});
@ -110,13 +110,13 @@ class Giveaway extends BaseCommand {
client.giveawaysManager.reroll(giveaway_id, {
messages: {
congrat: interaction.translate("moderation/giveaway:REROLL_CONGRAT"),
error: interaction.translate("moderation/giveaway:REROLL_ERROR")
}
error: interaction.translate("moderation/giveaway:REROLL_ERROR"),
},
}).then(() => {
return interaction.success("moderation/giveaway:GIVEAWAY_REROLLED");
}).catch(() => {
return interaction.error("moderation/giveaway:NOT_FOUND_ENDED", {
messageId: giveaway_id
messageId: giveaway_id,
}, { ephemeral: true });
});
} else if (command === "end") {
@ -127,7 +127,7 @@ class Giveaway extends BaseCommand {
return interaction.success("moderation/giveaway:GIVEAWAY_ENDED");
} catch (e) {
return interaction.error("moderation/giveaway:NOT_FOUND", {
messageId: giveaway_id
messageId: giveaway_id,
}, { ephemeral: true });
}
} else if (command === "delete") {
@ -137,7 +137,7 @@ class Giveaway extends BaseCommand {
return interaction.success("moderation/giveaway:GIVEAWAY_DELETED");
}).catch(() => {
return interaction.error("moderation/giveaway:NOT_FOUND", {
messageId: giveaway_id
messageId: giveaway_id,
}, { ephemeral: true });
});
}

View file

@ -18,7 +18,7 @@ class Poll extends BaseCommand {
.setRequired(true)),
aliases: [],
dirname: __dirname,
ownerOnly: false
ownerOnly: false,
});
}
/**
@ -61,7 +61,7 @@ class Poll extends BaseCommand {
await interaction.reply({
content: interaction.translate("moderation/poll:SELECT_MENTION"),
ephemeral: true,
components: [row]
components: [row],
});
let mention = null;
@ -74,24 +74,24 @@ class Poll extends BaseCommand {
mention = "||@everyone||";
i.update({
content: interaction.translate("moderation/poll:POLL_SENDED"),
components: []
components: [],
});
} else if (i.customId === "poll_here") {
mention = "||@here||";
i.update({
content: interaction.translate("moderation/poll:POLL_SENDED"),
components: []
components: [],
});
} else if (i.customId === "poll_nothing") {
mention = null;
i.update({
content: interaction.translate("moderation/poll:POLL_SENDED"),
components: []
components: [],
});
} else if (i.customId === "poll_cancel") {
return i.update({
content: interaction.translate("misc:SELECT_CANCELED"),
components: []
components: [],
});
}
@ -100,26 +100,26 @@ class Poll extends BaseCommand {
const embed = new EmbedBuilder()
.setAuthor({
name: interaction.translate("moderation/poll:TITLE")
name: interaction.translate("moderation/poll:TITLE"),
})
.setColor(client.config.embed.color)
.addFields([
{
name: "\u200b",
value: question
value: question,
},
{
name: "\u200b",
value: interaction.translate("moderation/poll:REACT", {
success: cool.toString(),
error: notcool.toString()
})
}
error: notcool.toString(),
}),
},
]);
return interaction.channel.send({
content: mention,
embeds: [embed]
embeds: [embed],
}).then(async m => {
await m.react(cool);
await m.react(notcool);

View file

@ -18,7 +18,7 @@ class Unban extends BaseCommand {
.setRequired(true)),
aliases: [],
dirname: __dirname,
ownerOnly: false
ownerOnly: false,
});
}
/**
@ -42,7 +42,7 @@ class Unban extends BaseCommand {
interaction.guild.bans.remove(id);
interaction.success("moderation/unban:UNBANNED", {
id
id,
});
}
}

View file

@ -15,7 +15,7 @@ class Warn extends BaseCommand {
.setDefaultMemberPermissions(PermissionFlagsBits.ModerateMembers && PermissionFlagsBits.ManageMessages),
aliases: [],
dirname: __dirname,
ownerOnly: false
ownerOnly: false,
});
}
/**
@ -41,7 +41,7 @@ class Warn extends BaseCommand {
const memberData = await client.findOrCreateMember({
id: member.id,
guildId: interaction.guildId
guildId: interaction.guildId,
});
const modal = new ModalBuilder()
@ -77,24 +77,24 @@ class Warn extends BaseCommand {
date: Date.now(),
type: "warn",
case: data.guildData.casesCount,
reason
reason,
};
const embed = new EmbedBuilder()
.addFields([
{
name: interaction.translate("common:USER"),
value: `\`${member.user.tag}\` (${member.user.toString()})`
value: `\`${member.user.tag}\` (${member.user.toString()})`,
},
{
name: interaction.translate("common:MODERATOR"),
value: `\`${interaction.user.tag}\` (${interaction.user.toString()})`
value: `\`${interaction.user.tag}\` (${interaction.user.toString()})`,
},
{
name: interaction.translate("common:REASON"),
value: reason,
inline: true
}
inline: true,
},
]);
if (banCount) {
@ -104,20 +104,20 @@ class Warn extends BaseCommand {
username: member.user,
moderator: interaction.user.tag,
server: interaction.guild.name,
reason
})
reason,
}),
});
caseInfo.type = "ban";
embed.setAuthor({
name: interaction.translate("moderation/ban:CASE", {
count: data.guildData.casesCount
})
count: data.guildData.casesCount,
}),
})
.setColor(client.config.embed.color);
interaction.guild.members.ban(member);
interaction.success("moderation/setwarns:AUTO_BAN", {
username: member.user.tag,
count: `${banCount} ${client.getNoun(banCount, interaction.translate("misc:NOUNS:WARNS:1"), interaction.translate("misc:NOUNS:WARNS:2"), interaction.translate("misc:NOUNS:WARNS:5"))}`
count: `${banCount} ${client.getNoun(banCount, interaction.translate("misc:NOUNS:WARNS:1"), interaction.translate("misc:NOUNS:WARNS:2"), interaction.translate("misc:NOUNS:WARNS:5"))}`,
});
}
}
@ -129,20 +129,20 @@ class Warn extends BaseCommand {
username: member.user,
moderator: interaction.user.tag,
server: interaction.guild.name,
reason
})
reason,
}),
});
caseInfo.type = "kick";
embed.setAuthor({
name: interaction.translate("moderation/kick:CASE", {
count: data.guildData.casesCount
})
count: data.guildData.casesCount,
}),
})
.setColor(client.config.embed.color);
member.kick().catch(() => {});
interaction.success("moderation/setwarns:AUTO_KICK", {
username: member.user.tag,
count: `${kickCount} ${client.getNoun(kickCount, interaction.translate("misc:NOUNS:WARNS:1"), interaction.translate("misc:NOUNS:WARNS:2"), interaction.translate("misc:NOUNS:WARNS:5"))}`
count: `${kickCount} ${client.getNoun(kickCount, interaction.translate("misc:NOUNS:WARNS:1"), interaction.translate("misc:NOUNS:WARNS:2"), interaction.translate("misc:NOUNS:WARNS:5"))}`,
});
}
}
@ -152,22 +152,22 @@ class Warn extends BaseCommand {
username: member.user.tag,
server: interaction.guild.name,
moderator: interaction.user.tag,
reason
})
reason,
}),
});
caseInfo.type = "warn";
embed.setAuthor({
name: interaction.translate("moderation/warn:CASE", {
caseNumber: data.guildData.casesCount
})
caseNumber: data.guildData.casesCount,
}),
}).setColor(client.config.embed.color);
submitted.reply({
content: interaction.translate("moderation/warn:WARNED", {
user: member.toString(),
reason
})
reason,
}),
});
memberData.sanctions.push(caseInfo);
@ -177,7 +177,7 @@ class Warn extends BaseCommand {
const channel = interaction.guild.channels.cache.get(data.guildData.plugins.modlogs);
if (!channel) return;
channel.send({
embeds: [embed]
embeds: [embed],
});
}
}

View file

@ -18,7 +18,7 @@ class Warns extends BaseCommand {
.setRequired(true)),
aliases: [],
dirname: __dirname,
ownerOnly: false
ownerOnly: false,
});
}
/**
@ -40,30 +40,30 @@ class Warns extends BaseCommand {
const memberData = await client.findOrCreateMember({
id: member.id,
guildId: interaction.guildId
guildId: interaction.guildId,
});
const embed = new EmbedBuilder()
.setAuthor({
name: interaction.translate("moderation/warns:SANCTIONS_OF", {
member: member.nickname || member.user.username
member: member.nickname || member.user.username,
}),
iconURL: member.displayAvatarURL({
extension: "png",
size: 512
})
size: 512,
}),
})
.setColor(client.config.embed.color)
.setFooter({
text: client.config.embed.footer
text: client.config.embed.footer,
});
if (memberData.sanctions.length === 0) {
embed.setDescription(interaction.translate("moderation/warns:NO_SANCTIONS", {
member: member.nickname || member.user.username
member: member.nickname || member.user.username,
}));
return interaction.reply({
embeds: [embed]
embeds: [embed],
});
} else {
memberData.sanctions.forEach(sanction => {
@ -71,13 +71,13 @@ class Warns extends BaseCommand {
{
name: sanction.type + " | #" + sanction.case,
value: `${interaction.translate("common:MODERATOR")}: <@${sanction.moderator}>\n${interaction.translate("common:REASON")}: ${sanction.reason}`,
inline: true
}
inline: true,
},
]);
});
}
interaction.reply({
embeds: [embed]
embeds: [embed],
});
}
}

View file

@ -14,7 +14,7 @@ class Back extends BaseCommand {
.setDMPermission(false),
aliases: [],
dirname: __dirname,
ownerOnly: false
ownerOnly: false,
});
}
/**

View file

@ -19,7 +19,7 @@ class Clips extends BaseCommand {
.setRequired(true)),
aliases: [],
dirname: __dirname,
ownerOnly: false
ownerOnly: false,
});
}
/**
@ -43,7 +43,7 @@ class Clips extends BaseCommand {
if (err) {
interaction.editReply({
content: "```js\n" + err + "```"
content: "```js\n" + err + "```",
});
return console.log("Unable to read directory: " + err);
}
@ -76,7 +76,7 @@ class Clips extends BaseCommand {
await interaction.editReply({
content: `${interaction.translate("common:PAGE")}: **${currentPage + 1}**/**${embeds.length}**`,
embeds: [embeds[currentPage]],
components: [row]
components: [row],
});
const filter = i => i.user.id === interaction.user.id;
@ -92,7 +92,7 @@ class Clips extends BaseCommand {
interaction.editReply({
content: `${interaction.translate("common:PAGE")}: **${currentPage + 1}**/**${embeds.length}**`,
embeds: [embeds[currentPage]],
components: [row]
components: [row],
});
}
} else if (i.customId === "clips_next_page") {
@ -103,7 +103,7 @@ class Clips extends BaseCommand {
interaction.editReply({
content: `${interaction.translate("common:PAGE")}: **${currentPage + 1}**/**${embeds.length}**`,
embeds: [embeds[currentPage]],
components: [row]
components: [row],
});
}
} else if (i.customId === "clips_jump_page") {
@ -111,9 +111,9 @@ class Clips extends BaseCommand {
const msg = await interaction.followUp({
content: interaction.translate("misc:JUMP_TO_PAGE", {
length: embeds.length
length: embeds.length,
}),
fetchReply: true
fetchReply: true,
});
const filter = res => {
@ -126,7 +126,7 @@ class Clips extends BaseCommand {
interaction.editReply({
content: `${interaction.translate("common:PAGE")}: **${currentPage + 1}**/**${embeds.length}**`,
embeds: [embeds[currentPage]],
components: [row]
components: [row],
});
if (collected.first().deletable) collected.first().delete();
@ -150,7 +150,7 @@ class Clips extends BaseCommand {
});
return interaction.editReply({
components: [row]
components: [row],
});
});
} else {
@ -165,7 +165,7 @@ class Clips extends BaseCommand {
const connection = joinVoiceChannel({
channelId: voice.id,
guildId: interaction.guild.id,
adapterCreator: interaction.guild.voiceAdapterCreator
adapterCreator: interaction.guild.voiceAdapterCreator,
});
const resource = createAudioResource(fs.createReadStream(`./clips/${query}.mp3`));
@ -187,9 +187,9 @@ class Clips extends BaseCommand {
await interaction.editReply({
content: interaction.translate("music/clips:PLAYING", {
clip: query
clip: query,
}),
components: []
components: [],
});
}
});
@ -215,7 +215,7 @@ function generateClipsEmbeds(interaction, clips) {
const embed = new EmbedBuilder()
.setColor(interaction.client.config.embed.color)
.setFooter({
text: interaction.client.config.embed.footer
text: interaction.client.config.embed.footer,
})
.setTitle(interaction.translate("music/clips:CLIPS_LIST"))
.setDescription(page)

View file

@ -20,11 +20,11 @@ class Loop extends BaseCommand {
{ name: client.translate("music/loop:AUTOPLAY"), value: "3" },
{ name: client.translate("music/loop:QUEUE"), value: "2" },
{ name: client.translate("music/loop:TRACK"), value: "1" },
{ name: client.translate("music/loop:DISABLE"), value: "0" }
{ name: client.translate("music/loop:DISABLE"), value: "0" },
)),
aliases: [],
dirname: __dirname,
ownerOnly: false
ownerOnly: false,
});
}
/**

View file

@ -15,7 +15,7 @@ class Nowplaying extends BaseCommand {
.setDMPermission(false),
aliases: [],
dirname: __dirname,
ownerOnly: false
ownerOnly: false,
});
}
/**
@ -41,34 +41,34 @@ class Nowplaying extends BaseCommand {
const embed = new EmbedBuilder()
.setAuthor({
name: interaction.translate("music/nowplaying:CURRENTLY_PLAYING")
name: interaction.translate("music/nowplaying:CURRENTLY_PLAYING"),
})
.setThumbnail(track.thumbnail)
.addFields([
{
name: interaction.translate("music/nowplaying:T_TITLE"),
value: `[${track.title}](${track.url})`,
inline: true
inline: true,
},
{
name: interaction.translate("music/nowplaying:T_AUTHOR"),
value: track.author || interaction.translate("common:UNKNOWN"),
inline: true
inline: true,
},
{ name: "\u200B", value: "\u200B", inline: true },
{
name: interaction.translate("common:VIEWS"),
value: new Intl.NumberFormat(interaction.client.languages.find(language => language.name === interaction.guild.data.language).moment, { notation: "standard" }).format(track.views),
inline: true
inline: true,
},
{
name: interaction.translate("music/queue:ADDED"),
value: track.requestedBy.toString(),
inline: true
inline: true,
},
{
name: interaction.translate("music/nowplaying:T_DURATION"),
value: progressBar
value: progressBar,
},
{
name: "\u200b",
@ -76,17 +76,17 @@ class Nowplaying extends BaseCommand {
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") : interaction.translate("common:DISABLED")
}\``
}
}\``,
},
])
.setColor(client.config.embed.color)
.setFooter({
text: client.config.embed.footer
text: client.config.embed.footer,
})
.setTimestamp();
interaction.editReply({
embeds: [embed]
embeds: [embed],
});
}
}

View file

@ -17,7 +17,7 @@ class Play extends BaseCommand {
.setRequired(true)),
aliases: [],
dirname: __dirname,
ownerOnly: false
ownerOnly: false,
});
}
/**
@ -43,8 +43,9 @@ class Play extends BaseCommand {
if (!perms.has(PermissionsBitField.Flags.Connect) || !perms.has(PermissionsBitField.Flags.Speak)) return interaction.error("music/play:VOICE_CHANNEL_CONNECT", null, { edit: true });
try {
// eslint-disable-next-line no-var
var searchResult = await client.player.search(query, {
requestedBy: interaction.user
requestedBy: interaction.user,
});
if (!searchResult.tracks[0] || !searchResult)
@ -54,8 +55,8 @@ class Play extends BaseCommand {
return interaction.editReply({
content: interaction.translate("music/play:NO_RESULT", {
query,
error
})
error,
}),
});
}
@ -64,7 +65,7 @@ class Play extends BaseCommand {
autoSelfDeaf: true,
leaveOnEnd: true,
leaveOnStop: true,
bufferingTimeout: 1000
bufferingTimeout: 1000,
});
if (searchResult.searched) {
@ -125,14 +126,14 @@ class Play extends BaseCommand {
const embed = new EmbedBuilder()
.setTitle(interaction.translate("music/play:RESULTS_TITLE", {
query
query,
}))
.setColor(client.config.embed.color)
.setDescription(searchResult.tracks.map(track => {
var views;
let views;
if (track.raw.live) views = "🔴 LIVE";
else views = new Intl.NumberFormat(interaction.client.languages.find(language => language.name === interaction.guild.data.language).moment, {
notation: "compact", compactDisplay: "short"
notation: "compact", compactDisplay: "short",
}).format(track.views);
return `${searchResult.tracks.indexOf(track) + 1}. [${track.title}](${track.url})\n> ${interaction.translate("common:VIEWS")}: **${views}**\n`;
@ -142,7 +143,7 @@ class Play extends BaseCommand {
await interaction.editReply({
content: interaction.translate("music/play:SEARCH_RESULTS"),
embeds: [embed],
components: [row1, row2, row3]
components: [row1, row2, row3],
});
const filter = i => i.user.id === interaction.user.id;
@ -153,7 +154,7 @@ class Play extends BaseCommand {
if (i.customId >= 1 && i.customId <= 10) {
i.deferUpdate();
var selected = searchResult.tracks[i.customId - 1];
const selected = searchResult.tracks[i.customId - 1];
queue.addTrack(selected);
try {
@ -162,10 +163,10 @@ class Play extends BaseCommand {
interaction.editReply({
content: interaction.translate("music/play:ADDED_QUEUE", {
songName: selected.title
songName: selected.title,
}),
components: [],
embeds: []
embeds: [],
});
collector.stop();
@ -175,21 +176,17 @@ class Play extends BaseCommand {
console.log(error);
return interaction.editReply({
content: interaction.translate("music/play:ERR_OCCURRED", {
error
})
error,
}),
});
}
} else if (i.customId === "search_cancel") {
i.deferUpdate();
rows.forEach(row => {
row.components.forEach(component => {
component.setDisabled(true);
});
});
interaction.editReply({
components: [row1, row2, row3]
content: interaction.translate("misc:SELECT_CANCELED"),
embeds: [],
components: [],
});
collector.stop();
@ -207,7 +204,7 @@ class Play extends BaseCommand {
});
return interaction.editReply({
components: [row1, row2, row3]
components: [row1, row2, row3],
});
}
});
@ -223,16 +220,16 @@ class Play extends BaseCommand {
interaction.editReply({
content: interaction.translate("music/play:ADDED_QUEUE", {
songName: searchResult.playlist ? searchResult.playlist.title : searchResult.tracks[0].title
})
songName: searchResult.playlist ? searchResult.playlist.title : searchResult.tracks[0].title,
}),
});
} catch (error) {
client.player.deleteQueue(interaction.guildId);
console.log(error);
return interaction.editReply({
content: interaction.translate("music/play:ERR_OCCURRED", {
error
})
error,
}),
});
}
}

View file

@ -15,7 +15,7 @@ class Queue extends BaseCommand {
.setDMPermission(false),
aliases: [],
dirname: __dirname,
ownerOnly: false
ownerOnly: false,
});
}
/**
@ -65,7 +65,7 @@ class Queue extends BaseCommand {
await interaction.reply({
content: `${interaction.translate("common:PAGE")}: **${currentPage + 1}**/**${embeds.length}**`,
embeds: [embeds[currentPage]],
components: [row]
components: [row],
});
const filter = i => i.user.id === interaction.user.id;
@ -82,7 +82,7 @@ class Queue extends BaseCommand {
interaction.editReply({
content: `${interaction.translate("common:PAGE")}: **${currentPage + 1}**/**${embeds.length}**`,
embeds: [embeds[currentPage]],
components: [row]
components: [row],
});
}
} else if (i.customId === "queue_next_page") {
@ -94,7 +94,7 @@ class Queue extends BaseCommand {
interaction.editReply({
content: `${interaction.translate("common:PAGE")}: **${currentPage + 1}**/**${embeds.length}**`,
embeds: [embeds[currentPage]],
components: [row]
components: [row],
});
}
} else if (i.customId === "queue_jump_page") {
@ -103,9 +103,9 @@ class Queue extends BaseCommand {
const msg = await interaction.followUp({
content: interaction.translate("misc:JUMP_TO_PAGE", {
length: embeds.length
length: embeds.length,
}),
fetchReply: true
fetchReply: true,
});
const filter = res => {
@ -118,7 +118,7 @@ class Queue extends BaseCommand {
interaction.editReply({
content: `${interaction.translate("common:PAGE")}: **${currentPage + 1}**/**${embeds.length}**`,
embeds: [embeds[currentPage]],
components: [row]
components: [row],
});
if (collected.first().deletable) collected.first().delete();
@ -142,7 +142,7 @@ class Queue extends BaseCommand {
});
return interaction.editReply({
components: [row]
components: [row],
});
});
}

View file

@ -16,7 +16,7 @@ class Seek extends BaseCommand {
.setRequired(true)),
aliases: [],
dirname: __dirname,
ownerOnly: false
ownerOnly: false,
});
}
/**
@ -41,7 +41,7 @@ class Seek extends BaseCommand {
queue.seek(time * 1000);
interaction.success("music/seek:SUCCESS", {
time: `**${time}** ${client.getNoun(time, interaction.translate("misc:NOUNS:SECONDS:1"), interaction.translate("misc:NOUNS:SECONDS:2"), interaction.translate("misc:NOUNS:SECONDS:5"))}`
time: `**${time}** ${client.getNoun(time, interaction.translate("misc:NOUNS:SECONDS:1"), interaction.translate("misc:NOUNS:SECONDS:2"), interaction.translate("misc:NOUNS:SECONDS:5"))}`,
});
}
}

View file

@ -14,7 +14,7 @@ class Shuffle extends BaseCommand {
.setDMPermission(false),
aliases: [],
dirname: __dirname,
ownerOnly: false
ownerOnly: false,
});
}
/**

View file

@ -14,7 +14,7 @@ class Skip extends BaseCommand {
.setDMPermission(false),
aliases: [],
dirname: __dirname,
ownerOnly: false
ownerOnly: false,
});
}
/**

View file

@ -17,7 +17,7 @@ class Skipto extends BaseCommand {
.setRequired(true)),
aliases: [],
dirname: __dirname,
ownerOnly: false
ownerOnly: false,
});
}
/**
@ -46,7 +46,7 @@ class Skipto extends BaseCommand {
queue.skipTo(queue.tracks[position - 1]);
interaction.success("music/skipto:SUCCESS", {
position: position
position: position,
});
} else return interaction.error("music/skipto:ERROR", { position: position });
}

View file

@ -14,7 +14,7 @@ class Stop extends BaseCommand {
.setDMPermission(false),
aliases: [],
dirname: __dirname,
ownerOnly: false
ownerOnly: false,
});
}
/**

View file

@ -15,7 +15,7 @@ class NSFW extends BaseCommand {
.setDMPermission(true),
aliases: [],
dirname: __dirname,
ownerOnly: false
ownerOnly: false,
});
}
/**
@ -39,8 +39,8 @@ class NSFW extends BaseCommand {
const tags = ["hentai", "ecchi", "lewdanimegirls", "hentaifemdom", "animefeets", "animebooty", "biganimetiddies", "sideoppai", "ahegao"].map(tag =>
JSON.parse(JSON.stringify({
label: tag,
value: tag
}))
value: tag,
})),
);
const row = new ActionRowBuilder()
@ -48,14 +48,14 @@ class NSFW extends BaseCommand {
new SelectMenuBuilder()
.setCustomId("nsfw_select")
.setPlaceholder(client.translate("common:NOTHING_SELECTED"))
.addOptions(tags)
.addOptions(tags),
);
const msg = await interaction.editReply({
content: interaction.translate("common:AVAILABLE_OPTIONS"),
ephemeral: true,
fetchReply: true,
components: [row]
components: [row],
});
const filter = i => i.user.id === interaction.user.id;
@ -71,7 +71,7 @@ class NSFW extends BaseCommand {
const embed = new EmbedBuilder()
.setColor(client.config.embed.color)
.setFooter({
text: client.config.embed.footer
text: client.config.embed.footer,
})
.setTitle(res.title)
.setDescription(`${interaction.translate("fun/memes:SUBREDDIT")}: **${res.subreddit}**\n${interaction.translate("common:AUTHOR")}: **${res.author}**\n${interaction.translate("fun/memes:UPS")}: **${res.ups}**`)
@ -79,14 +79,14 @@ class NSFW extends BaseCommand {
.setTimestamp();
await interaction.editReply({
embeds: [embed]
embeds: [embed],
});
}
});
collector.on("end", () => {
return interaction.editReply({
components: []
components: [],
});
});
}

View file

@ -20,7 +20,7 @@ class Announcement extends BaseCommand {
.setRequired(true)),
aliases: [],
dirname: __dirname,
ownerOnly: true
ownerOnly: true,
});
}
/**
@ -43,12 +43,12 @@ class Announcement extends BaseCommand {
const embed = new EmbedBuilder()
.setAuthor({
name: interaction.translate("owner/announcement:TITLE")
name: interaction.translate("owner/announcement:TITLE"),
})
.setDescription(text)
.setColor(client.config.embed.color)
.setFooter({
text: interaction.user.tag
text: interaction.user.tag,
})
.setTimestamp();
@ -57,13 +57,13 @@ class Announcement extends BaseCommand {
const channel = guild.channels.cache.get(guild?.data.plugins.news);
await channel.send({
content: `${interaction.options.getBoolean("tag") ? "||@everyone|| " : ""}ВАЖНОЕ ОБЪЯВЛЕНИЕ!`,
embeds: [embed]
embeds: [embed],
});
});
interaction.editReply({
content: interaction.translate("owner/announcement:SENDED"),
ephemeral: true
ephemeral: true,
});
}
}

View file

@ -22,14 +22,14 @@ class Debug extends BaseCommand {
{ 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" }
{ 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))
.setRequired(true)),
)
.addSubcommand(subcommand => subcommand.setName("add")
.setDescription(client.translate("owner/debug:ADD"))
@ -41,18 +41,18 @@ class Debug extends BaseCommand {
{ 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" }
{ 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("owner/debug:INT"))
.setRequired(true))
.setRequired(true)),
),
aliases: [],
dirname: __dirname,
ownerOnly: true
ownerOnly: true,
});
}
/**
@ -76,11 +76,11 @@ class Debug extends BaseCommand {
const member = interaction.options.getMember("user");
if (member.user.bot) return interaction.error("misc:BOT_USER", null, { ephemeral: true });
const userData = await client.findOrCreateUser({
id: member.id
id: member.id,
});
const memberData = await client.findOrCreateMember({
id: member.id,
guildId: interaction.guildId
guildId: interaction.guildId,
});
const int = interaction.options.getInteger("int");
@ -90,7 +90,7 @@ class Debug extends BaseCommand {
await memberData.save();
return interaction.success(`owner/debug:SUCCESS_${type.toUpperCase()}`, {
username: member.toString(),
amount: int
amount: int,
}, { ephemeral: true });
}
@ -99,7 +99,7 @@ class Debug extends BaseCommand {
await memberData.save();
return interaction.success(`owner/debug:SUCCESS_${type.toUpperCase()}`, {
username: member.toString(),
amount: int
amount: int,
}, { ephemeral: true });
}
@ -108,7 +108,7 @@ class Debug extends BaseCommand {
await memberData.save();
return interaction.success(`owner/debug:SUCCESS_${type.toUpperCase()}`, {
username: member.toString(),
amount: int
amount: int,
}, { ephemeral: true });
}
@ -117,7 +117,7 @@ class Debug extends BaseCommand {
await memberData.save();
return interaction.success(`owner/debug:SUCCESS_${type.toUpperCase()}`, {
username: member.toString(),
amount: int
amount: int,
}, { ephemeral: true });
}
@ -126,7 +126,7 @@ class Debug extends BaseCommand {
await userData.save();
return interaction.success(`owner/debug:SUCCESS_${type.toUpperCase()}`, {
username: member.toString(),
amount: int
amount: int,
}, { ephemeral: true });
}
}
@ -135,11 +135,11 @@ class Debug extends BaseCommand {
const member = interaction.options.getMember("target");
if (member.user.bot) return interaction.error("misc:BOT_USER", null, { ephemeral: true });
const userData = await client.findOrCreateUser({
id: member.id
id: member.id,
});
const memberData = await client.findOrCreateMember({
id: member.id,
guildId: interaction.guildId
guildId: interaction.guildId,
});
const int = interaction.options.getInteger("int");
@ -149,7 +149,7 @@ class Debug extends BaseCommand {
await memberData.save();
return interaction.success(`owner/debug:SUCCESS_${type.toUpperCase()}`, {
username: member.toString(),
amount: int
amount: int,
}, { ephemeral: true });
}
@ -158,7 +158,7 @@ class Debug extends BaseCommand {
await memberData.save();
return interaction.success(`owner/debug:SUCCESS_${type.toUpperCase()}`, {
username: member.toString(),
amount: int
amount: int,
}, { ephemeral: true });
}
@ -167,7 +167,7 @@ class Debug extends BaseCommand {
await memberData.save();
return interaction.success(`owner/debug:SUCCESS_${type.toUpperCase()}`, {
username: member.toString(),
amount: int
amount: int,
}, { ephemeral: true });
}
@ -176,7 +176,7 @@ class Debug extends BaseCommand {
await memberData.save();
return interaction.success(`owner/debug:SUCCESS_${type.toUpperCase()}`, {
username: member.toString(),
amount: int
amount: int,
}, { ephemeral: true });
}
@ -185,7 +185,7 @@ class Debug extends BaseCommand {
await userData.save();
return interaction.success(`owner/debug:SUCCESS_${type.toUpperCase()}`, {
username: member.toString(),
amount: int
amount: int,
}, { ephemeral: true });
}
}

View file

@ -17,7 +17,7 @@ class Eval extends BaseCommand {
.setRequired(true)),
aliases: [],
dirname: __dirname,
ownerOnly: true
ownerOnly: true,
});
}
/**
@ -45,7 +45,7 @@ class Eval extends BaseCommand {
if (output.includes(client.token)) output = output.replace(client.token, "T0K3N");
interaction.editReply({
content: "```js\n" + output + "```"
content: "```js\n" + output + "```",
});
}).catch(err => {
console.error(err);
@ -53,7 +53,7 @@ class Eval extends BaseCommand {
if (err.includes(client.token)) err = err.replace(client.token, "T0K3N");
interaction.editReply({
content: "```js\n" + err + "```"
content: "```js\n" + err + "```",
});
});
}

View file

@ -19,7 +19,7 @@ class Reload extends BaseCommand {
.setRequired(true)),
aliases: [],
dirname: __dirname,
ownerOnly: true
ownerOnly: true,
});
}
/**
@ -47,7 +47,7 @@ class Reload extends BaseCommand {
autoUpdateDocs.update(client);
interaction.success("owner/reload:SUCCESS", {
command: cmd.command.name
command: cmd.command.name,
}, { ephemeral: true });
}
}

View file

@ -19,7 +19,7 @@ class Say extends BaseCommand {
.setDescription(client.translate("common:CHANNEL"))),
aliases: [],
dirname: __dirname,
ownerOnly: true
ownerOnly: true,
});
}
/**
@ -45,12 +45,12 @@ class Say extends BaseCommand {
setTimeout(function () {
interaction.channel.send({
content: message
content: message,
});
interaction.replyT("owner/say:DONE", {
message,
channel: interaction.channel.toString()
channel: interaction.channel.toString(),
}, { edit: true });
}, 2000);
} else {
@ -58,12 +58,12 @@ class Say extends BaseCommand {
setTimeout(function () {
channel.send({
content: message
content: message,
});
interaction.replyT("owner/say:DONE", {
message,
channel: channel.toString()
channel: channel.toString(),
}, { edit: true });
}, 2000);
}

View file

@ -14,7 +14,7 @@ class Servers extends BaseCommand {
.setDMPermission(true),
aliases: [],
dirname: __dirname,
ownerOnly: true
ownerOnly: true,
});
}
/**
@ -59,7 +59,7 @@ class Servers extends BaseCommand {
await interaction.editReply({
content: `${interaction.translate("common:PAGE")}: **${currentPage + 1}**/**${embeds.length}**`,
embeds: [embeds[currentPage]],
components: [row]
components: [row],
});
const filter = i => i.user.id === interaction.user.id;
@ -75,7 +75,7 @@ class Servers extends BaseCommand {
interaction.editReply({
content: `${interaction.translate("common:PAGE")}: **${currentPage + 1}**/**${embeds.length}**`,
embeds: [embeds[currentPage]],
components: [row]
components: [row],
});
}
} else if (i.customId === "servers_next_page") {
@ -86,7 +86,7 @@ class Servers extends BaseCommand {
interaction.editReply({
content: `${interaction.translate("common:PAGE")}: **${currentPage + 1}**/**${embeds.length}**`,
embeds: [embeds[currentPage]],
components: [row]
components: [row],
});
}
} else if (i.customId === "servers_jump_page") {
@ -94,9 +94,9 @@ class Servers extends BaseCommand {
const msg = await interaction.followUp({
content: interaction.translate("misc:JUMP_TO_PAGE", {
length: embeds.length
length: embeds.length,
}),
fetchReply: true
fetchReply: true,
});
const filter = res => {
@ -109,7 +109,7 @@ class Servers extends BaseCommand {
interaction.editReply({
content: `${interaction.translate("common:PAGE")}: **${currentPage + 1}**/**${embeds.length}**`,
embeds: [embeds[currentPage]],
components: [row]
components: [row],
});
if (collected.first().deletable) collected.first().delete();
@ -133,7 +133,7 @@ class Servers extends BaseCommand {
});
return interaction.editReply({
components: [row]
components: [row],
});
});
}
@ -159,7 +159,7 @@ function generateServersEmbeds(interaction, servers) {
const embed = new EmbedBuilder()
.setColor(interaction.client.config.embed.color)
.setFooter({
text: interaction.client.config.embed.footer
text: interaction.client.config.embed.footer,
})
.setTitle(interaction.translate("owner/servers:SERVERS_LIST"))
.setDescription(info)

View file

@ -18,20 +18,20 @@ module.exports = {
logs: "XXXXXXXXXXX", // The channel ID of logs
port: 8080, // Dashboard port
expressSessionPassword: "XXXXXXXXXXX", // Express session password (it can be what you want)
failureURL: "https://dashboard.example.com" // url on which users will be redirected if they click the cancel button (discord authentication)
failureURL: "https://dashboard.example.com", // url on which users will be redirected if they click the cancel button (discord authentication)
},
mongoDB: "mongodb://localhost:27017/discordbot", // The URl of the mongodb database
/* For the embeds (embeded messages) */
embed: {
color: "#0091fc", // The default color for the embeds
footer: "Bot | v1.0" // And the default footer for the embeds
footer: "Bot | v1.0", // And the default footer for the embeds
},
/* Bot's owner informations */
owner: {
id: "XXXXXXXXXXX", // The ID of the bot's owner
name: "XXXXXXXXXXX#1234" // And the name of the bot's owner
name: "XXXXXXXXXXX#1234", // And the name of the bot's owner
},
/* The API keys that are required for certain commands */
/* Not used right now */
apiKeys: {}
apiKeys: {},
};

View file

@ -60,7 +60,7 @@ module.exports.init = async(client) => {
res.status(404).render("404", {
user: req.userInfos,
translate: req.translate,
currentURL: `${req.protocol}://${req.get("host")}${req.originalUrl}`
currentURL: `${req.protocol}://${req.get("host")}${req.originalUrl}`,
});
})
.use(CheckAuth, function(err, req, res) {
@ -70,7 +70,7 @@ module.exports.init = async(client) => {
res.status(500).render("500", {
user: req.userInfos,
translate: req.translate,
currentURL: `${req.protocol}://${req.get("host")}${req.originalUrl}`
currentURL: `${req.protocol}://${req.get("host")}${req.originalUrl}`,
});
});

View file

@ -14,14 +14,13 @@ router.get("/login", async function(req, res) {
router.get("/callback", async (req, res) => {
if (!req.query.code) return res.redirect(req.client.config.dashboard.failureURL);
if (req.query.state && req.query.state.startsWith("invite")) {
if (req.query.state && req.query.state.startsWith("invite"))
if (req.query.code) {
const guildID = req.query.state.substr("invite".length, req.query.state.length);
req.client.knownGuilds.push({ id: guildID, user: req.user.id });
return res.redirect(`/manage/${guildID}`);
}
}
const redirectURL = req.client.states[req.query.state] || "/selector";
const params = new URLSearchParams();
@ -33,8 +32,8 @@ router.get("/callback", async (req, res) => {
body: params.toString(),
headers: {
Authorization: `Basic ${btoa(`${req.client.user.id}:${req.client.config.dashboard.secret}`)}`,
"Content-Type": "application/x-www-form-urlencoded"
}
"Content-Type": "application/x-www-form-urlencoded",
},
});
// Fetch tokens (used to fetch user informations)
@ -44,14 +43,14 @@ router.get("/callback", async (req, res) => {
if (tokens.error || !tokens.access_token) return res.redirect(`/api/login&state=${req.query.state}`);
const userData = {
infos: null,
guilds: null
guilds: null,
};
while (!userData.infos || !userData.guilds) {
/* User infos */
if (!userData.infos) {
response = await fetch("http://discordapp.com/api/users/@me", {
method: "GET",
headers: { Authorization: `Bearer ${tokens.access_token}` }
headers: { Authorization: `Bearer ${tokens.access_token}` },
});
const json = await response.json();
if (json.retry_after) await req.client.wait(json.retry_after);
@ -62,7 +61,7 @@ router.get("/callback", async (req, res) => {
if (!userData.guilds) {
response = await fetch("https://discordapp.com/api/users/@me/guilds", {
method: "GET",
headers: { Authorization: `Bearer ${tokens.access_token}` }
headers: { Authorization: `Bearer ${tokens.access_token}` },
});
const json = await response.json();
if (json.retry_after) await req.client.wait(json.retry_after);

View file

@ -6,7 +6,7 @@ router.get("/", function (req, res) {
user: req.userInfos,
translate: req.translate,
currentURL: `${req.client.config.dashboard.baseURL}${req.originalUrl}`,
site: req.client.config.dashboard.baseURL
site: req.client.config.dashboard.baseURL,
});
});

View file

@ -7,13 +7,12 @@ const express = require("express"),
router.get("/:serverID", CheckAuth, async(req, res) => {
// Check if the user has the permissions to edit this guild
const guild = req.client.guilds.cache.get(req.params.serverID);
if (!guild || !req.userInfos.displayedGuilds || !req.userInfos.displayedGuilds.find((g) => g.id === req.params.serverID)) {
if (!guild || !req.userInfos.displayedGuilds || !req.userInfos.displayedGuilds.find((g) => g.id === req.params.serverID))
return res.render("404", {
user: req.userInfos,
translate: req.translate,
currentURL: `${req.client.config.dashboard.baseURL}${req.originalUrl}`
currentURL: `${req.client.config.dashboard.baseURL}${req.originalUrl}`,
});
}
// Fetch guild informations
const guildInfos = await utils.fetchGuild(guild.id, req.client, req.user.guilds);
@ -26,20 +25,19 @@ router.get("/:serverID", CheckAuth, async(req, res) => {
translate: req.translate,
ChannelType,
bot: req.client,
currentURL: `${req.client.config.dashboard.baseURL}${req.originalUrl}`
currentURL: `${req.client.config.dashboard.baseURL}${req.originalUrl}`,
});
});
router.post("/:serverID", CheckAuth, async(req, res) => {
// Check if the user has the permissions to edit this guild
const guild = req.client.guilds.cache.get(req.params.serverID);
if (!guild || !req.userInfos.displayedGuilds || !req.userInfos.displayedGuilds.find((g) => g.id === req.params.serverID)) {
if (!guild || !req.userInfos.displayedGuilds || !req.userInfos.displayedGuilds.find((g) => g.id === req.params.serverID))
return res.render("404", {
user: req.userInfos,
translate: req.translate,
currentURL: `${req.client.config.dashboard.baseURL}${req.originalUrl}`
currentURL: `${req.client.config.dashboard.baseURL}${req.originalUrl}`,
});
}
const guildData = await req.client.findOrCreateGuild({ id: guild.id });
const data = req.body;
@ -57,7 +55,7 @@ router.post("/:serverID", CheckAuth, async(req, res) => {
enabled: true,
message: data.message,
channel: guild.channels.cache.find(ch => "#" + ch.name === data.channel).id,
withImage: data.withImage === "on"
withImage: data.withImage === "on",
};
guildData.plugins.welcome = welcome;
guildData.markModified("plugins.welcome");
@ -69,7 +67,7 @@ router.post("/:serverID", CheckAuth, async(req, res) => {
enabled: false,
message: null,
channel: null,
withImage: null
withImage: null,
};
guildData.plugins.welcome = welcome;
guildData.markModified("plugins.welcome");
@ -81,7 +79,7 @@ router.post("/:serverID", CheckAuth, async(req, res) => {
enabled: true,
message: data.message,
channel: guild.channels.cache.find(ch => "#" + ch.name === data.channel).id,
withImage: data.withImage === "on"
withImage: data.withImage === "on",
};
guildData.plugins.goodbye = goodbye;
guildData.markModified("plugins.goodbye");
@ -93,7 +91,7 @@ router.post("/:serverID", CheckAuth, async(req, res) => {
enabled: false,
message: null,
channel: null,
withImage: null
withImage: null,
};
guildData.plugins.goodbye = goodbye;
guildData.markModified("plugins.goodbye");
@ -103,7 +101,7 @@ router.post("/:serverID", CheckAuth, async(req, res) => {
if (Object.prototype.hasOwnProperty.call(data, "autoroleEnable") || Object.prototype.hasOwnProperty.call(data, "autoroleUpdate")) {
const autorole = {
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.markModified("plugins.autorole");
@ -113,7 +111,7 @@ router.post("/:serverID", CheckAuth, async(req, res) => {
if (Object.prototype.hasOwnProperty.call(data, "autoroleDisable")) {
const autorole = {
enabled: false,
role: null
role: null,
};
guildData.plugins.autorole = autorole;
guildData.markModified("plugins.autorole");

View file

@ -6,30 +6,29 @@ const express = require("express"),
router.get("/:serverID", CheckAuth, async (req, res) => {
// Check if the user has the permissions to edit this guild
const guild = req.client.guilds.cache.get(req.params.serverID);
if (!guild) {
if (!guild)
return res.render("404", {
user: req.userInfos,
translate: req.translate,
currentURL: `${req.client.config.dashboard.baseURL}${req.originalUrl}`
currentURL: `${req.client.config.dashboard.baseURL}${req.originalUrl}`,
});
}
const memberData = await req.client.findOrCreateMember({ id: req.userInfos.id, guildId: guild.id });
// Fetch guild informations
const membersData = await req.client.membersData.find({
guildID: guild.id
guildID: guild.id,
}).lean(),
members = membersData.map((m) => {
return {
id: m.id,
money: m.money + m.bankSold
money: m.money + m.bankSold,
};
}).sort((a, b) => b.money - a.money);
const leaderboards = {
money: members,
level: utils.sortArrayOfObjects("level", membersData)
level: utils.sortArrayOfObjects("level", membersData),
};
for (const cat in leaderboards) {
@ -39,7 +38,7 @@ router.get("/:serverID", CheckAuth, async (req, res) => {
const stats = {
money: await utils.fetchUsers(leaderboards.money, req.client),
level: await utils.fetchUsers(leaderboards.level, req.client)
level: await utils.fetchUsers(leaderboards.level, req.client),
};
res.render("stats/guild", {

View file

@ -10,7 +10,7 @@ router.get("/selector", CheckAuth, async(req, res) => {
res.render("selector", {
user: req.userInfos,
translate: req.translate,
currentURL: `${req.client.config.dashboard.baseURL}${req.originalUrl}`
currentURL: `${req.client.config.dashboard.baseURL}${req.originalUrl}`,
});
});

View file

@ -9,7 +9,7 @@ router.get("/", CheckAuth, async function(req, res) {
bot: req.client,
translate: req.translate,
printDate: req.printDate,
currentURL: `${req.client.config.dashboard.baseURL}${req.originalUrl}`
currentURL: `${req.client.config.dashboard.baseURL}${req.originalUrl}`,
});
});
@ -18,12 +18,11 @@ router.post("/", CheckAuth, async function(req, res) {
const data = req.body;
if (data.bio) user.bio = data.bio;
if (data.birthdate) {
if (data.birthdate)
if (checkDate(data.birthdate)) {
user.birthdate = checkDate(data.birthdate);
user.markModified("birthdate");
}
}
await user.save();
res.redirect(303, "/profile");
@ -39,8 +38,9 @@ function checkDate(birthdate) {
if (!day || !month || !year) return false;
const match = birthdate.match(/\d+/g);
if (!match) return false;
const tday = + match[0], tmonth = + match[1] - 1;
let tyear = + match[2];
const tday = +match[0],
tmonth = +match[1] - 1;
let tyear = +match[2];
if (tyear < 100) tyear += tyear < 50 ? 2000 : 1900;
const d = new Date(tyear, tmonth, tday);
if (!(tday == d.getDate() && tmonth == d.getMonth() && tyear == d.getFullYear())) return false;

View file

@ -6,22 +6,22 @@ const express = require("express"),
// Gets user page
router.get("/:userID/:serverID", CheckAuth, async function (req, res) {
const guild = req.client.guilds.cache.get(req.params.serverID);
if (!guild) {
if (!guild)
return res.render("404", {
user: req.userInfos,
translate: req.translate,
currentURL: `${req.client.config.dashboard.baseURL}${req.originalUrl}`
currentURL: `${req.client.config.dashboard.baseURL}${req.originalUrl}`,
});
}
const guildData = await req.client.findOrCreateGuild({ id: guild.id });
const userInfos = await utils.fetchUser({
id: req.params.userID
id: req.params.userID,
}, req.client).catch(() => {
res.render("404", {
user: req.userInfos,
translate: req.translate,
currentURL: `${req.client.config.dashboard.baseURL}${req.originalUrl}`
currentURL: `${req.client.config.dashboard.baseURL}${req.originalUrl}`,
});
});
@ -32,7 +32,7 @@ router.get("/:userID/:serverID", CheckAuth, async function (req, res) {
bot: req.client,
translate: req.translate,
printDate: req.printDate,
currentURL: `${req.client.config.dashboard.baseURL}${req.originalUrl}`
currentURL: `${req.client.config.dashboard.baseURL}${req.originalUrl}`,
});
});

View file

@ -25,13 +25,13 @@ async function fetchUser(userData, client, query) {
const user = await client.users.fetch(userData.id);
const userDb = await client.findOrCreateUser({
id: user.id
id: user.id,
}, true);
const userInfos = {
...user.toJSON(),
...userDb,
...userData
...userData,
};
return userInfos;
@ -54,9 +54,9 @@ async function fetchUsers(array, client) {
...{
money: element.money,
level: element.level,
rep: element.rep
rep: element.rep,
},
...user.toJSON()
...user.toJSON(),
});
});
});
@ -74,13 +74,13 @@ async function fetchUsers(array, client) {
async function fetchGuild(guildID, client, guilds) {
const guild = client.guilds.cache.get(guildID);
const conf = await client.findOrCreateGuild({
id: guild.id
id: guild.id,
});
return {
...guild,
...conf.toJSON(),
...guilds.find((g) => g.id === guild.id)
...guilds.find((g) => g.id === guild.id),
};
}

View file

@ -5,7 +5,7 @@ class CommandHandler extends BaseEvent {
constructor() {
super({
name: "interactionCreate",
once: false
once: false,
});
}
@ -21,7 +21,7 @@ class CommandHandler extends BaseEvent {
const data = [];
const userData = await client.findOrCreateUser({
id: interaction.user.id
id: interaction.user.id,
});
data.userData = userData;
@ -30,13 +30,13 @@ class CommandHandler extends BaseEvent {
if (interaction.inGuild()) {
const guildData = await client.findOrCreateGuild({
id: interaction.guildId
id: interaction.guildId,
});
interaction.guild.data = data.guildData = guildData;
const memberData = await client.findOrCreateMember({
id: interaction.member.id,
guildId: interaction.guildId
guildId: interaction.guildId,
});
data.memberData = memberData;
}
@ -50,8 +50,8 @@ class CommandHandler extends BaseEvent {
content: interaction.user.toString(),
files: [{
name: "achievement_unlocked2.png",
attachment: "./assets/img/achievements/achievement_unlocked2.png"
}]
attachment: "./assets/img/achievements/achievement_unlocked2.png",
}],
});
}

View file

@ -5,7 +5,7 @@ class GuildCreate extends BaseEvent {
constructor() {
super({
name: "guildCreate",
once: false
once: false,
});
}
@ -18,7 +18,7 @@ class GuildCreate extends BaseEvent {
const messageOptions = {};
const userData = await client.findOrCreateUser({
id: guild.ownerId
id: guild.ownerId,
});
if (!userData.achievements.invite.achieved) {
@ -26,7 +26,7 @@ class GuildCreate extends BaseEvent {
userData.achievements.invite.achieved = true;
messageOptions.files = [{
name: "unlocked.png",
attachment: "./assets/img/achievements/achievement_unlocked7.png"
attachment: "./assets/img/achievements/achievement_unlocked7.png",
}];
userData.markModified("achievements.invite");
await userData.save();
@ -34,12 +34,12 @@ class GuildCreate extends BaseEvent {
const thanksEmbed = new EmbedBuilder()
.setAuthor({
name: "Спасибо что добавили меня на свой сервер!"
name: "Спасибо что добавили меня на свой сервер!",
})
.setDescription("Чтобы получить список команд, используйте `/help`!.")
.setColor(client.config.embed.color)
.setFooter({
text: client.config.embed.footer
text: client.config.embed.footer,
})
.setTimestamp();
messageOptions.embeds = [thanksEmbed];
@ -53,12 +53,12 @@ class GuildCreate extends BaseEvent {
const embed = new EmbedBuilder()
.setAuthor({
name: guild.name,
iconURL: guild.iconURL()
iconURL: guild.iconURL(),
})
.setColor("#32CD32")
.setDescription(`Зашёл на сервер **${guild.name}**. На нём **${users}** ${client.getNoun(users, client.translate("misc:NOUNS:USERS:1"), client.translate("misc:NOUNS:USERS:2"), client.translate("misc:NOUNS:USERS:5"))} и **${bots}** ${client.getNoun(bots, client.translate("misc:NOUNS:BOTS:1"), client.translate("misc:NOUNS:BOTS:2"), client.translate("misc:NOUNS:BOTS:5"))}`);
client.channels.cache.get(client.config.support.logs).send({
embeds: [embed]
embeds: [embed],
});
}
}

View file

@ -5,7 +5,7 @@ class GuildDelete extends BaseEvent {
constructor() {
super({
name: "guildDelete",
once: false
once: false,
});
}
@ -18,12 +18,12 @@ class GuildDelete extends BaseEvent {
const embed = new EmbedBuilder()
.setAuthor({
name: guild.name,
iconURL: guild.iconURL()
iconURL: guild.iconURL(),
})
.setColor("#B22222")
.setDescription(`Вышел с сервера **${guild.name}**.`);
client.channels.cache.get(client.config.support.logs).send({
embeds: [embed]
embeds: [embed],
});
}
}

View file

@ -8,9 +8,8 @@ Canvas.registerFont(resolve("./assets/fonts/KeepCalm-Medium.ttf"), { family: "Ke
const applyText = (canvas, text, defaultFontSize, width, font) => {
const ctx = canvas.getContext("2d");
do {
ctx.font = `${(defaultFontSize -= 1)}px ${font}`;
} while (ctx.measureText(text).width > width);
do ctx.font = `${(defaultFontSize -= 1)}px ${font}`;
while (ctx.measureText(text).width > width);
return ctx.font;
};
@ -19,7 +18,7 @@ class GuildMemberAdd extends BaseEvent {
constructor() {
super({
name: "guildMemberAdd",
once: false
once: false,
});
}
@ -34,23 +33,22 @@ class GuildMemberAdd extends BaseEvent {
await member.guild.members.fetch();
const guildData = await client.findOrCreateGuild({
id: member.guild.id
id: member.guild.id,
});
member.guild.data = guildData;
const memberData = await client.findOrCreateMember({
id: member.id,
guildId: member.guild.id
guildId: member.guild.id,
});
if (memberData.mute.muted && memberData.mute.endDate > Date.now()) {
if (memberData.mute.muted && memberData.mute.endDate > Date.now())
member.guild.channels.cache.forEach((channel) => {
channel.permissionOverwrites.edit(member.id, {
SEND_MESSAGES: false,
ADD_REACTIONS: false,
CONNECT: false
CONNECT: false,
}).catch(() => {});
});
}
if (guildData.plugins.autorole.enabled) member.roles.add(guildData.plugins.autorole.role);
@ -94,11 +92,11 @@ class GuildMemberAdd extends BaseEvent {
// Draw server name
ctx.font = applyText(canvas, client.translate("administration/welcome:IMG_WELCOME", {
server: member.guild.name
server: member.guild.name,
}, member.guild.data.language), 53, 625, "RubikMonoOne");
ctx.fillText(client.translate("administration/welcome:IMG_WELCOME", {
server: member.guild.name
server: member.guild.name,
}, member.guild.data.language), canvas.width - 700, canvas.height - 70);
// Draw discriminator
@ -131,20 +129,16 @@ class GuildMemberAdd extends BaseEvent {
ctx.closePath();
ctx.clip();
const avatar = await Canvas.loadImage(member.displayAvatarURL({
extension: "jpg"
extension: "jpg",
}));
ctx.drawImage(avatar, 45, 90, 270, 270);
const attachment = new AttachmentBuilder(canvas.toBuffer(), { name: "welcome-image.png" });
channel.send({
content: message,
files: [attachment]
files: [attachment],
});
} else {
channel.send({
content: message
});
}
} else channel.send({ content: message });
}
}
}

View file

@ -3,14 +3,13 @@ const Canvas = require("canvas"),
{ AttachmentBuilder } = require("discord.js"),
{ resolve } = require("path");
Canvas.registerFont(resolve("./assets/fonts/RubikMonoOne-Regular.ttf"), { family: "RubikMonoOne" });
Canvas.registerFont(resolve("./assets/fonts/RubikMonoOne-Regular.ttf"), { family: "RubikMonoOne" });
Canvas.registerFont(resolve("./assets/fonts/KeepCalm-Medium.ttf"), { family: "KeepCalm" });
const applyText = (canvas, text, defaultFontSize, width, font) => {
const ctx = canvas.getContext("2d");
do {
ctx.font = `${(defaultFontSize -= 1)}px ${font}`;
} while (ctx.measureText(text).width > width);
do ctx.font = `${(defaultFontSize -= 1)}px ${font}`;
while (ctx.measureText(text).width > width);
return ctx.font;
};
@ -19,7 +18,7 @@ class GuildMemberRemove extends BaseEvent {
constructor() {
super({
name: "guildMemberRemove",
once: false
once: false,
});
}
@ -34,7 +33,7 @@ class GuildMemberRemove extends BaseEvent {
await member.guild.members.fetch();
const guildData = await client.findOrCreateGuild({
id: member.guild.id
id: member.guild.id,
});
member.guild.data = guildData;
@ -78,11 +77,11 @@ class GuildMemberRemove extends BaseEvent {
// Draw server name
ctx.font = applyText(canvas, client.translate("administration/goodbye:IMG_GOODBYE", {
server: member.guild.name
server: member.guild.name,
}, member.guild.data.language), 53, 625, "RubikMonoOne");
ctx.fillText(client.translate("administration/goodbye:IMG_GOODBYE", {
server: member.guild.name
server: member.guild.name,
}, member.guild.data.language), canvas.width - 700, canvas.height - 70);
// Draw discriminator
@ -116,20 +115,16 @@ class GuildMemberRemove extends BaseEvent {
ctx.clip();
const avatar = await Canvas.loadImage(member.displayAvatarURL({
extension: "png",
size: 512
size: 512,
}));
ctx.drawImage(avatar, 45, 90, 270, 270);
const attachment = new AttachmentBuilder(canvas.toBuffer(), { name: "goodbye-image.png" });
channel.send({
content: message,
files: [attachment]
files: [attachment],
});
} else {
channel.send({
content: message
});
}
} else channel.send({ content: message });
}
}
}

View file

@ -4,7 +4,7 @@ class GuildMemberUpdate extends BaseEvent {
constructor() {
super({
name: "guildMemberRemove",
once: false
once: false,
});
}
@ -21,7 +21,7 @@ class GuildMemberUpdate extends BaseEvent {
if (newMember?.roles.cache.some(r => r.name === "Поддержавшие JaBa")) {
const userData = await client.findOrCreateUser({
id: newMember.id
id: newMember.id,
});
userData.achievements.tip.progress.now = 1;
userData.achievements.tip.achieved = true;
@ -31,8 +31,8 @@ class GuildMemberUpdate extends BaseEvent {
newMember.send({
files: [{
name: "achievement_unlocked5.png",
attachment: "./assets/img/achievements/achievement_unlocked5.png"
}]
attachment: "./assets/img/achievements/achievement_unlocked5.png",
}],
});
}
}

View file

@ -6,7 +6,7 @@ class MessageCreate extends BaseEvent {
constructor() {
super({
name: "messageCreate",
once: false
once: false,
});
}
@ -25,7 +25,7 @@ class MessageCreate extends BaseEvent {
if (message.guild && !message.member) await message.guild.members.fetch(message.author.id);
if (message.guild) {
const guild = await client.findOrCreateGuild({
id: message.guild.id
id: message.guild.id,
});
message.guild.data = data.guildData = guild;
}
@ -33,40 +33,38 @@ class MessageCreate extends BaseEvent {
if (message.guild) {
const memberData = await client.findOrCreateMember({
id: message.author.id,
guildId: message.guild.id
guildId: message.guild.id,
});
data.memberData = memberData;
}
const userData = await client.findOrCreateUser({
id: message.author.id
id: message.author.id,
});
data.userData = userData;
if (message.guild) {
await updateXp(client, message, data);
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 (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 (!message.channel.permissionsFor(message.member).has(PermissionsBitField.Flags.ManageMessages)) {
message.delete();
return message.error("administration/automod:DELETED");
}
}
}
const afkReason = data.userData.afk;
if (afkReason) {
data.userData.afk = null;
await data.userData.save();
message.replyT("general/afk:DELETED", {
username: message.author.username
username: message.author.username,
}, { mention: true });
}
message.mentions.users.forEach(async (u) => {
const userData = await client.findOrCreateUser({
id: u.id
id: u.id,
});
if (userData.afk) message.error("general/afk:IS_AFK", { user: u.tag, reason: userData.afk });
});
@ -87,9 +85,8 @@ async function updateXp(client, msg, data) {
level = parseInt(data.memberData.level),
isInCooldown = xpCooldown[msg.author.id];
if (isInCooldown) {
if (isInCooldown)
if (isInCooldown > Date.now()) return;
}
const toWait = Date.now() + (60 * 1000); // 1 min
xpCooldown[msg.author.id] = toWait;
@ -102,7 +99,7 @@ async function updateXp(client, msg, data) {
data.memberData.level = parseInt(level + 1, 10);
data.memberData.exp = 0;
msg.replyT("misc:LEVEL_UP", {
level: data.memberData.level
level: data.memberData.level,
}, { mention: false });
} else data.memberData.exp = parseInt(newXp, 10);

View file

@ -5,7 +5,7 @@ class Ready extends BaseEvent {
constructor() {
super({
name: "ready",
once: false
once: false,
});
}
/**
@ -20,7 +20,7 @@ class Ready extends BaseEvent {
client.logger.log(`Loaded a total of ${commands.length} command(s).`, "ready");
client.logger.log(`${client.user.tag}, ready to serve ${tUsers} users in ${tServers} servers.`, "ready");
client.logger.log(`Invite Link: ${client.generateInvite({ scopes: ["bot", "applications.commands"] , permissions: [ PermissionsBitField.Flags.Administrator ] })}`, "ready");
client.logger.log(`Invite Link: ${client.generateInvite({ scopes: ["bot", "applications.commands"], permissions: [ PermissionsBitField.Flags.Administrator ] })}`, "ready");
const birthdays = require("../helpers/birthdays");
birthdays.init(client);
@ -41,7 +41,7 @@ class Ready extends BaseEvent {
{ name: "help", type: ActivityType.Watching },
{ name: `${commands.length} ${client.getNoun(commands.length, client.translate("misc:NOUNS:COMMANDS:1"), client.translate("misc:NOUNS:COMMANDS:2"), client.translate("misc:NOUNS:COMMANDS:5"))}`, type: ActivityType.Listening },
{ name: `${tServers} ${client.getNoun(tServers, client.translate("misc:NOUNS:SERVER:1"), client.translate("misc:NOUNS:SERVER:2"), client.translate("misc:NOUNS:SERVER:5"))}`, type: ActivityType.Watching },
{ name: `${tUsers} ${client.getNoun(tUsers, client.translate("misc:NOUNS:USERS:1"), client.translate("misc:NOUNS:USERS:2"), client.translate("misc:NOUNS:USERS:5"))}`, type: ActivityType.Watching }
{ name: `${tUsers} ${client.getNoun(tUsers, client.translate("misc:NOUNS:USERS:1"), client.translate("misc:NOUNS:USERS:2"), client.translate("misc:NOUNS:USERS:5"))}`, type: ActivityType.Watching },
];
let i = 0;
@ -52,7 +52,7 @@ class Ready extends BaseEvent {
const toShow = status[i];
client.user.setActivity(`${toShow.name} | v${version}`, {
type: toShow.type
type: toShow.type,
});
if (status[i + 1]) i++;

View file

@ -25,7 +25,7 @@ module.exports.update = function (client) {
categories.sort().forEach(cat => {
const categoriesArray = [
["Название", "Описание", "Использование", "Разрешено использование"]
["Название", "Описание", "Использование", "Разрешено использование"],
];
const cmds = [...new Map(commands.filter(cmd => cmd.category === cat).map(v => [v.constructor.name, v])).values()];
@ -38,7 +38,7 @@ module.exports.update = function (client) {
`**${cmd.command.name}** ${cmd.aliases.length ? `**(${cmd.aliases.join(", ")})**` : ""}`,
client.translate(`${cmd.category.toLowerCase()}/${cmd.command.name}:DESCRIPTION`),
`${cmd.command.name} ${client.translate(`${cmd.category.toLowerCase()}/${cmd.command.name}:USAGE`)}`,
cmd.guildOnly ? "Только на сервере" : "На сервере и в ЛС бота"
cmd.guildOnly ? "Только на сервере" : "На сервере и в ЛС бота",
]);
});
text += `${table(categoriesArray)}\n\n`;

View file

@ -14,7 +14,7 @@ module.exports.init = async function (client) {
client.guilds.cache.forEach(async guild => {
const guildData = await client.findOrCreateGuild({
id: guild.id
id: guild.id,
});
if (guildData.plugins.birthdays) {
@ -36,12 +36,12 @@ module.exports.init = async function (client) {
name: client.user.username,
iconURL: client.user.displayAvatarURL({
extension: "png",
size: 512
})
size: 512,
}),
})
.setColor(client.config.embed.color)
.setFooter({
text: client.config.embed.footer
text: client.config.embed.footer,
})
.addFields([
{
@ -49,13 +49,13 @@ module.exports.init = async function (client) {
value: client.translate("economy/birthdate:HAPPY_BIRTHDAY_MESSAGE", {
name: user.username,
user: user.id,
age: `**${age}** ${client.getNoun(age, client.translate("misc:NOUNS:AGE:1"), client.translate("misc:NOUNS:AGE:2"), client.translate("misc:NOUNS:AGE:5"))}`
})
}
age: `**${age}** ${client.getNoun(age, client.translate("misc:NOUNS:AGE:1"), client.translate("misc:NOUNS:AGE:2"), client.translate("misc:NOUNS:AGE:5"))}`,
}),
},
]);
const msg = await channel.send({
embeds: [embed]
embeds: [embed],
});
await msg.react("🎉");
}

View file

@ -28,23 +28,23 @@ module.exports.init = function (client) {
mustSent.forEach(r => {
const embed = new EmbedBuilder()
.setAuthor({
name: client.translate("general/remindme:TITLE")
name: client.translate("general/remindme:TITLE"),
})
.setDescription(client.translate("general/remindme:CREATED", {
time: moment(r.createdAt).locale(client.defaultLanguage).format("dddd, Do MMMM YYYY, HH:mm:ss")
time: moment(r.createdAt).locale(client.defaultLanguage).format("dddd, Do MMMM YYYY, HH:mm:ss"),
}))
.addFields([
{
name: client.translate("common:MESSAGE"),
value: r.message
}
value: r.message,
},
])
.setColor(client.config.embed.color)
.setFooter({
text: client.config.embed.footer
text: client.config.embed.footer,
});
dUser.send({
embeds: [embed]
embeds: [embed],
});
});
user.reminds = user.reminds.filter(r => r.sendAt >= dateNow);

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