mirror of
https://github.com/JonnyBro/JaBa.git
synced 2024-11-21 12:44:58 +05:00
prettier
This commit is contained in:
parent
0fb732b1d0
commit
c3dca64be4
109 changed files with 2403 additions and 2864 deletions
11
.prettierrc
Normal file
11
.prettierrc
Normal file
|
@ -0,0 +1,11 @@
|
|||
{
|
||||
"arrowParens": "avoid",
|
||||
"bracketSpacing": true,
|
||||
"endOfLine": "lf",
|
||||
"printWidth": 250,
|
||||
"semi": true,
|
||||
"tabWidth": 4,
|
||||
"trailingComma": "all",
|
||||
"useTabs": true,
|
||||
"parser": "babel"
|
||||
}
|
|
@ -19,7 +19,7 @@ class BaseCommand {
|
|||
/**
|
||||
* @type {String}
|
||||
*/
|
||||
this.category = (this.dirname ? this.dirname.split(path.sep)[parseInt(this.dirname.split(path.sep).length - 1, 10)] : "Other");
|
||||
this.category = this.dirname ? this.dirname.split(path.sep)[parseInt(this.dirname.split(path.sep).length - 1, 10)] : "Other";
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -9,40 +9,43 @@ module.exports = mongoose.model("Guild", new Schema({
|
|||
members: [{ type: Schema.Types.ObjectId, ref: "Member" }],
|
||||
|
||||
language: { type: String, default: languages.find(l => l.default).name },
|
||||
plugins: { type: Object, default: {
|
||||
welcome: {
|
||||
enabled: false,
|
||||
message: null,
|
||||
channel: null,
|
||||
withImage: null,
|
||||
plugins: {
|
||||
type: Object,
|
||||
default: {
|
||||
welcome: {
|
||||
enabled: false,
|
||||
message: null,
|
||||
channel: null,
|
||||
withImage: null,
|
||||
},
|
||||
goodbye: {
|
||||
enabled: false,
|
||||
message: null,
|
||||
channel: null,
|
||||
withImage: null,
|
||||
},
|
||||
autorole: {
|
||||
enabled: false,
|
||||
role: null,
|
||||
},
|
||||
automod: {
|
||||
enabled: false,
|
||||
ignored: [],
|
||||
},
|
||||
warnsSanctions: {
|
||||
kick: null,
|
||||
ban: null,
|
||||
},
|
||||
monitoring: {
|
||||
memberAdd: null,
|
||||
memberLeave: null,
|
||||
memberUpdate: null,
|
||||
messageUpdate: null,
|
||||
},
|
||||
suggestions: null,
|
||||
reports: null,
|
||||
birthdays: null,
|
||||
modlogs: null,
|
||||
},
|
||||
goodbye: {
|
||||
enabled: false,
|
||||
message: null,
|
||||
channel: null,
|
||||
withImage: null,
|
||||
},
|
||||
autorole: {
|
||||
enabled: false,
|
||||
role: null,
|
||||
},
|
||||
automod: {
|
||||
enabled: false,
|
||||
ignored: [],
|
||||
},
|
||||
warnsSanctions: {
|
||||
kick: null,
|
||||
ban: null,
|
||||
},
|
||||
monitoring: {
|
||||
memberAdd: null,
|
||||
memberLeave: null,
|
||||
memberUpdate: null,
|
||||
messageUpdate: null,
|
||||
},
|
||||
suggestions: null,
|
||||
reports: null,
|
||||
birthdays: null,
|
||||
modlogs: null,
|
||||
} },
|
||||
},
|
||||
}));
|
45
base/JaBa.js
45
base/JaBa.js
|
@ -46,7 +46,7 @@ class JaBa extends Client {
|
|||
else
|
||||
setTimeout(() => {
|
||||
if (m.deletable) m.delete();
|
||||
}, (5 * 60 * 1000)); // m * s * ms
|
||||
}, 5 * 60 * 1000); // m * s * ms
|
||||
});
|
||||
this.player.events.on("emptyQueue", queue => queue.metadata.channel.send(this.translate("music/play:QUEUE_ENDED", null, queue.metadata.channel.guild.data.language)));
|
||||
this.player.events.on("emptyChannel", queue => queue.metadata.channel.send(this.translate("music/play:STOP_EMPTY", null, queue.metadata.channel.guild.data.language)));
|
||||
|
@ -76,14 +76,17 @@ class JaBa extends Client {
|
|||
async init() {
|
||||
this.login(this.config.token);
|
||||
|
||||
mongoose.connect(this.config.mongoDB, {
|
||||
useNewUrlParser: true,
|
||||
useUnifiedTopology: true,
|
||||
}).then(() => {
|
||||
this.logger.log("Connected to the Mongodb database.", "log");
|
||||
}).catch(err => {
|
||||
this.logger.log(`Unable to connect to the Mongodb database. Error: ${err}`, "error");
|
||||
});
|
||||
mongoose
|
||||
.connect(this.config.mongoDB, {
|
||||
useNewUrlParser: true,
|
||||
useUnifiedTopology: true,
|
||||
})
|
||||
.then(() => {
|
||||
this.logger.log("Connected to the Mongodb database.", "log");
|
||||
})
|
||||
.catch(err => {
|
||||
this.logger.log(`Unable to connect to the Mongodb database. Error: ${err}`, "error");
|
||||
});
|
||||
|
||||
await this.player.extractors.loadDefault();
|
||||
|
||||
|
@ -99,9 +102,7 @@ class JaBa extends Client {
|
|||
async loadCommands(dir) {
|
||||
const rest = new REST().setToken(this.config.token),
|
||||
filePath = path.join(__dirname, dir),
|
||||
folders = (await fs.readdir(filePath))
|
||||
.map(file => path.join(filePath, file))
|
||||
.filter(async path => (await fs.lstat(path)).isDirectory());
|
||||
folders = (await fs.readdir(filePath)).map(file => path.join(filePath, file)).filter(async path => (await fs.lstat(path)).isDirectory());
|
||||
|
||||
const commands = [];
|
||||
for (let index = 0; index < folders.length; index++) {
|
||||
|
@ -122,13 +123,13 @@ class JaBa extends Client {
|
|||
const aliases = [];
|
||||
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 };
|
||||
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);
|
||||
commands.push(command.command instanceof SlashCommandBuilder || command.command instanceof ContextMenuCommandBuilder ? command.command.toJSON() : command.command, ...aliases);
|
||||
|
||||
if (command.onLoad || typeof command.onLoad === "function") await command.onLoad(this);
|
||||
this.logger.log(`Successfully loaded "${file}" command file. (Command: ${command.command.name})`);
|
||||
|
@ -139,17 +140,13 @@ class JaBa extends Client {
|
|||
|
||||
try {
|
||||
if (this.config.production)
|
||||
await rest.put(
|
||||
Routes.applicationCommands(this.config.user), {
|
||||
body: commands,
|
||||
},
|
||||
);
|
||||
await rest.put(Routes.applicationCommands(this.config.userId), {
|
||||
body: commands,
|
||||
});
|
||||
else
|
||||
await rest.put(
|
||||
Routes.applicationGuildCommands(this.config.user, this.config.support.id), {
|
||||
body: commands,
|
||||
},
|
||||
);
|
||||
await rest.put(Routes.applicationGuildCommands(this.config.userId, this.config.support.id), {
|
||||
body: commands,
|
||||
});
|
||||
|
||||
this.logger.log("Successfully registered application commands.");
|
||||
} catch (err) {
|
||||
|
|
|
@ -13,15 +13,21 @@ module.exports = mongoose.model("Member", new mongoose.Schema({
|
|||
|
||||
registeredAt: { type: Number, default: Date.now() },
|
||||
|
||||
cooldowns: { type: Object, default: {
|
||||
work: 0,
|
||||
rob: 0,
|
||||
} },
|
||||
cooldowns: {
|
||||
type: Object,
|
||||
default: {
|
||||
work: 0,
|
||||
rob: 0,
|
||||
},
|
||||
},
|
||||
|
||||
sanctions: { type: Array, default: [] },
|
||||
mute: { type: Object, default: {
|
||||
muted: false,
|
||||
case: null,
|
||||
endDate: null,
|
||||
} },
|
||||
mute: {
|
||||
type: Object,
|
||||
default: {
|
||||
muted: false,
|
||||
case: null,
|
||||
endDate: null,
|
||||
},
|
||||
},
|
||||
}));
|
115
base/User.js
115
base/User.js
|
@ -4,8 +4,7 @@ const mongoose = require("mongoose"),
|
|||
const genToken = () => {
|
||||
let token = "";
|
||||
const characters = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwzy0123456789.-_";
|
||||
for (let i = 0; i < 32; i++)
|
||||
token += characters.charAt(Math.floor(Math.random() * characters.length));
|
||||
for (let i = 0; i < 32; i++) token += characters.charAt(Math.floor(Math.random() * characters.length));
|
||||
|
||||
return token;
|
||||
};
|
||||
|
@ -20,61 +19,67 @@ const userSchema = new mongoose.Schema({
|
|||
|
||||
registeredAt: { type: Number, default: Date.now() },
|
||||
|
||||
achievements: { type: Object, default: {
|
||||
married: {
|
||||
achieved: false,
|
||||
progress: {
|
||||
now: 0,
|
||||
total: 1,
|
||||
achievements: {
|
||||
type: Object,
|
||||
default: {
|
||||
married: {
|
||||
achieved: false,
|
||||
progress: {
|
||||
now: 0,
|
||||
total: 1,
|
||||
},
|
||||
},
|
||||
work: {
|
||||
achieved: false,
|
||||
progress: {
|
||||
now: 0,
|
||||
total: 10,
|
||||
},
|
||||
},
|
||||
firstCommand: {
|
||||
achieved: false,
|
||||
progress: {
|
||||
now: 0,
|
||||
total: 1,
|
||||
},
|
||||
},
|
||||
slots: {
|
||||
achieved: false,
|
||||
progress: {
|
||||
now: 0,
|
||||
total: 3,
|
||||
},
|
||||
},
|
||||
tip: {
|
||||
achieved: false,
|
||||
progress: {
|
||||
now: 0,
|
||||
total: 1,
|
||||
},
|
||||
},
|
||||
rep: {
|
||||
achieved: false,
|
||||
progress: {
|
||||
now: 0,
|
||||
total: 20,
|
||||
},
|
||||
},
|
||||
invite: {
|
||||
achieved: false,
|
||||
progress: {
|
||||
now: 0,
|
||||
total: 1,
|
||||
},
|
||||
},
|
||||
},
|
||||
work: {
|
||||
achieved: false,
|
||||
progress: {
|
||||
now: 0,
|
||||
total: 10,
|
||||
},
|
||||
},
|
||||
firstCommand: {
|
||||
achieved: false,
|
||||
progress: {
|
||||
now: 0,
|
||||
total: 1,
|
||||
},
|
||||
},
|
||||
slots: {
|
||||
achieved: false,
|
||||
progress: {
|
||||
now: 0,
|
||||
total: 3,
|
||||
},
|
||||
},
|
||||
tip: {
|
||||
achieved: false,
|
||||
progress: {
|
||||
now: 0,
|
||||
total: 1,
|
||||
},
|
||||
},
|
||||
rep: {
|
||||
achieved: false,
|
||||
progress: {
|
||||
now: 0,
|
||||
total: 20,
|
||||
},
|
||||
},
|
||||
invite: {
|
||||
achieved: false,
|
||||
progress: {
|
||||
now: 0,
|
||||
total: 1,
|
||||
},
|
||||
},
|
||||
} },
|
||||
},
|
||||
|
||||
cooldowns: { type: Object, default: {
|
||||
rep: 0,
|
||||
} },
|
||||
cooldowns: {
|
||||
type: Object,
|
||||
default: {
|
||||
rep: 0,
|
||||
},
|
||||
},
|
||||
|
||||
afk: { type: String, default: null },
|
||||
reminds: { type: Array, default: [] },
|
||||
|
@ -82,7 +87,7 @@ const userSchema = new mongoose.Schema({
|
|||
apiToken: { type: String, default: genToken() },
|
||||
});
|
||||
|
||||
userSchema.method("getAchievements", async function() {
|
||||
userSchema.method("getAchievements", async function () {
|
||||
const canvas = Canvas.createCanvas(1800, 250),
|
||||
ctx = canvas.getContext("2d");
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ class ImportMee6 extends BaseCommand {
|
|||
command: new SlashCommandBuilder()
|
||||
.setName("importmee6")
|
||||
.setDescription(client.translate("economy/importmee6:DESCRIPTION"))
|
||||
.setDescriptionLocalizations({ "uk": client.translate("economy/importmee6:DESCRIPTION", null, "uk-UA") })
|
||||
.setDescriptionLocalizations({ uk: client.translate("economy/importmee6:DESCRIPTION", null, "uk-UA"), ru: client.translate("economy/importmee6:DESCRIPTION", null, "ru-RU") })
|
||||
.setDMPermission(false),
|
||||
aliases: [],
|
||||
dirname: __dirname,
|
||||
|
|
|
@ -13,8 +13,8 @@ class Memes extends BaseCommand {
|
|||
.setName("memes")
|
||||
.setDescription(client.translate("fun/memes:DESCRIPTION"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("fun/memes:DESCRIPTION", null, "uk-UA"),
|
||||
"ru": client.translate("fun/memes:DESCRIPTION", null, "ru-RU"),
|
||||
uk: client.translate("fun/memes:DESCRIPTION", null, "uk-UA"),
|
||||
ru: client.translate("fun/memes:DESCRIPTION", null, "ru-RU"),
|
||||
})
|
||||
.setDMPermission(false),
|
||||
aliases: [],
|
||||
|
@ -39,19 +39,20 @@ class Memes extends BaseCommand {
|
|||
await interaction.deferReply();
|
||||
|
||||
const tags = ["funny", "memes", "dankmemes", "me_irl", "wholesomememes"].map(tag =>
|
||||
JSON.parse(JSON.stringify({
|
||||
label: tag,
|
||||
value: tag,
|
||||
})),
|
||||
JSON.parse(
|
||||
JSON.stringify({
|
||||
label: tag,
|
||||
value: tag,
|
||||
}),
|
||||
),
|
||||
);
|
||||
|
||||
const row = new ActionRowBuilder()
|
||||
.addComponents(
|
||||
new StringSelectMenuBuilder()
|
||||
.setCustomId("memes_select")
|
||||
.setPlaceholder(client.translate("common:NOTHING_SELECTED"))
|
||||
.addOptions(tags),
|
||||
);
|
||||
const row = new ActionRowBuilder().addComponents(
|
||||
new StringSelectMenuBuilder()
|
||||
.setCustomId("memes_select")
|
||||
.setPlaceholder(client.translate("common:NOTHING_SELECTED"))
|
||||
.addOptions(tags),
|
||||
);
|
||||
|
||||
const msg = await interaction.editReply({
|
||||
content: interaction.translate("common:AVAILABLE_OPTIONS"),
|
||||
|
@ -60,7 +61,7 @@ class Memes extends BaseCommand {
|
|||
});
|
||||
|
||||
const filter = i => i.user.id === interaction.user.id;
|
||||
const collector = msg.createMessageComponentCollector({ filter, idle: (2 * 60 * 1000) });
|
||||
const collector = msg.createMessageComponentCollector({ filter, idle: 2 * 60 * 1000 });
|
||||
|
||||
collector.on("collect", async i => {
|
||||
if (i.isStringSelectMenu() && i.customId === "memes_select") {
|
||||
|
|
|
@ -12,8 +12,8 @@ class Staff extends BaseCommand {
|
|||
.setName("staff")
|
||||
.setDescription(client.translate("general/staff:DESCRIPTION"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("general/staff:DESCRIPTION", null, "uk-UA"),
|
||||
"ru": client.translate("general/staff:DESCRIPTION", null, "ru-RU"),
|
||||
uk: client.translate("general/staff:DESCRIPTION", null, "uk-UA"),
|
||||
ru: client.translate("general/staff:DESCRIPTION", null, "ru-RU"),
|
||||
})
|
||||
.setDMPermission(false),
|
||||
aliases: [],
|
||||
|
@ -47,11 +47,14 @@ class Staff extends BaseCommand {
|
|||
.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)
|
||||
|
|
|
@ -12,25 +12,31 @@ class Automod extends BaseCommand {
|
|||
.setName("automod")
|
||||
.setDescription(client.translate("administration/automod:DESCRIPTION"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("administration/automod:DESCRIPTION", null, "uk-UA"),
|
||||
"ru": client.translate("administration/automod:DESCRIPTION", null, "ru-RU"),
|
||||
uk: client.translate("administration/automod:DESCRIPTION", null, "uk-UA"),
|
||||
ru: client.translate("administration/automod:DESCRIPTION", null, "ru-RU"),
|
||||
})
|
||||
.setDMPermission(false)
|
||||
.setDefaultMemberPermissions(PermissionsBitField.Flags.ManageGuild)
|
||||
.addBooleanOption(option => option.setName("state")
|
||||
.setDescription(client.translate("common:STATE"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("common:STATE", null, "uk-UA"),
|
||||
"ru": client.translate("common:STATE", null, "ru-RU"),
|
||||
})
|
||||
.setRequired(true))
|
||||
.addChannelOption(option => option.setName("channel")
|
||||
.setDescription(client.translate("common:CHANNEL"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("common:CHANNEL", null, "uk-UA"),
|
||||
"ru": client.translate("common:CHANNEL", null, "ru-RU"),
|
||||
})
|
||||
.addChannelTypes(ChannelType.GuildText)),
|
||||
.addBooleanOption(option =>
|
||||
option
|
||||
.setName("state")
|
||||
.setDescription(client.translate("common:STATE"))
|
||||
.setDescriptionLocalizations({
|
||||
uk: client.translate("common:STATE", null, "uk-UA"),
|
||||
ru: client.translate("common:STATE", null, "ru-RU"),
|
||||
})
|
||||
.setRequired(true),
|
||||
)
|
||||
.addChannelOption(option =>
|
||||
option
|
||||
.setName("channel")
|
||||
.setDescription(client.translate("common:CHANNEL"))
|
||||
.setDescriptionLocalizations({
|
||||
uk: client.translate("common:CHANNEL", null, "uk-UA"),
|
||||
ru: client.translate("common:CHANNEL", null, "ru-RU"),
|
||||
})
|
||||
.addChannelTypes(ChannelType.GuildText),
|
||||
),
|
||||
aliases: [],
|
||||
dirname: __dirname,
|
||||
ownerOnly: false,
|
||||
|
|
|
@ -12,24 +12,30 @@ class Autorole extends BaseCommand {
|
|||
.setName("autorole")
|
||||
.setDescription(client.translate("administration/autorole:DESCRIPTION"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("administration/autorole:DESCRIPTION", null, "uk-UA"),
|
||||
"ru": client.translate("administration/autorole:DESCRIPTION", null, "ru-RU"),
|
||||
uk: client.translate("administration/autorole:DESCRIPTION", null, "uk-UA"),
|
||||
ru: client.translate("administration/autorole:DESCRIPTION", null, "ru-RU"),
|
||||
})
|
||||
.setDMPermission(false)
|
||||
.setDefaultMemberPermissions(PermissionsBitField.Flags.ManageGuild)
|
||||
.addBooleanOption(option => option.setName("state")
|
||||
.setDescription(client.translate("common:STATE"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("common:STATE", null, "uk-UA"),
|
||||
"ru": client.translate("common:STATE", null, "ru-RU"),
|
||||
})
|
||||
.setRequired(true))
|
||||
.addRoleOption(option => option.setName("role")
|
||||
.setDescription(client.translate("common:ROLE"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("common:ROLE", null, "uk-UA"),
|
||||
"ru": client.translate("common:ROLE", null, "ru-RU"),
|
||||
})),
|
||||
.addBooleanOption(option =>
|
||||
option
|
||||
.setName("state")
|
||||
.setDescription(client.translate("common:STATE"))
|
||||
.setDescriptionLocalizations({
|
||||
uk: client.translate("common:STATE", null, "uk-UA"),
|
||||
ru: client.translate("common:STATE", null, "ru-RU"),
|
||||
})
|
||||
.setRequired(true),
|
||||
)
|
||||
.addRoleOption(option =>
|
||||
option
|
||||
.setName("role")
|
||||
.setDescription(client.translate("common:ROLE"))
|
||||
.setDescriptionLocalizations({
|
||||
uk: client.translate("common:ROLE", null, "uk-UA"),
|
||||
ru: client.translate("common:ROLE", null, "ru-RU"),
|
||||
}),
|
||||
),
|
||||
aliases: [],
|
||||
dirname: __dirname,
|
||||
ownerOnly: false,
|
||||
|
|
|
@ -12,51 +12,64 @@ class Config extends BaseCommand {
|
|||
.setName("config")
|
||||
.setDescription(client.translate("administration/config:DESCRIPTION"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("administration/config:DESCRIPTION", null, "uk-UA"),
|
||||
"ru": client.translate("administration/config:DESCRIPTION", null, "ru-RU"),
|
||||
uk: client.translate("administration/config:DESCRIPTION", null, "uk-UA"),
|
||||
ru: client.translate("administration/config:DESCRIPTION", null, "ru-RU"),
|
||||
})
|
||||
.setDMPermission(false)
|
||||
.setDefaultMemberPermissions(PermissionsBitField.Flags.ManageGuild)
|
||||
.addSubcommand(subcommand => subcommand.setName("list")
|
||||
.setDescription(client.translate("administration/config:LIST"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("administration/config:LIST", null, "uk-UA"),
|
||||
"ru": client.translate("administration/config:LIST", null, "ru-RU"),
|
||||
}),
|
||||
.addSubcommand(subcommand =>
|
||||
subcommand
|
||||
.setName("list")
|
||||
.setDescription(client.translate("administration/config:LIST"))
|
||||
.setDescriptionLocalizations({
|
||||
uk: client.translate("administration/config:LIST", null, "uk-UA"),
|
||||
ru: client.translate("administration/config:LIST", null, "ru-RU"),
|
||||
}),
|
||||
)
|
||||
.addSubcommand(subcommand => subcommand.setName("set")
|
||||
.setDescription(client.translate("administration/config:SET"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("administration/config:SET", null, "uk-UA"),
|
||||
"ru": client.translate("administration/config:SET", null, "ru-RU"),
|
||||
})
|
||||
.addStringOption(option => option.setName("setting")
|
||||
.setDescription(client.translate("administration/config:SETTING"))
|
||||
.addSubcommand(subcommand =>
|
||||
subcommand
|
||||
.setName("set")
|
||||
.setDescription(client.translate("administration/config:SET"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("administration/config:SETTING", null, "uk-UA"),
|
||||
"ru": client.translate("administration/config:SETTING", null, "ru-RU"),
|
||||
uk: client.translate("administration/config:SET", null, "uk-UA"),
|
||||
ru: client.translate("administration/config:SET", null, "ru-RU"),
|
||||
})
|
||||
.setChoices(
|
||||
{ name: client.translate("administration/config:BIRTHDAYS"), value: "birthdays" },
|
||||
{ name: client.translate("administration/config:MODLOGS"), value: "modlogs" },
|
||||
{ name: client.translate("administration/config:REPORTS"), value: "reports" },
|
||||
{ name: client.translate("administration/config:SUGGESTIONS"), value: "suggestions" },
|
||||
{ name: client.translate("administration/config:MESSAGEUPDATE"), value: "monitoring.messageUpdate" },
|
||||
.addStringOption(option =>
|
||||
option
|
||||
.setName("setting")
|
||||
.setDescription(client.translate("administration/config:SETTING"))
|
||||
.setDescriptionLocalizations({
|
||||
uk: client.translate("administration/config:SETTING", null, "uk-UA"),
|
||||
ru: client.translate("administration/config:SETTING", null, "ru-RU"),
|
||||
})
|
||||
.setChoices(
|
||||
{ name: client.translate("administration/config:BIRTHDAYS"), value: "birthdays" },
|
||||
{ name: client.translate("administration/config:MODLOGS"), value: "modlogs" },
|
||||
{ name: client.translate("administration/config:REPORTS"), value: "reports" },
|
||||
{ name: client.translate("administration/config:SUGGESTIONS"), value: "suggestions" },
|
||||
{ name: client.translate("administration/config:MESSAGEUPDATE"), value: "monitoring.messageUpdate" },
|
||||
)
|
||||
.setRequired(true),
|
||||
)
|
||||
.setRequired(true))
|
||||
.addBooleanOption(option => option.setName("state")
|
||||
.setDescription(client.translate("common:STATE"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("common:STATE", null, "uk-UA"),
|
||||
"ru": client.translate("common:STATE", null, "ru-RU"),
|
||||
})
|
||||
.setRequired(true))
|
||||
.addChannelOption(option => option.setName("channel")
|
||||
.setDescription(client.translate("common:CHANNEL"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("common:CHANNEL", null, "uk-UA"),
|
||||
"ru": client.translate("common:CHANNEL", null, "ru-RU"),
|
||||
})),
|
||||
.addBooleanOption(option =>
|
||||
option
|
||||
.setName("state")
|
||||
.setDescription(client.translate("common:STATE"))
|
||||
.setDescriptionLocalizations({
|
||||
uk: client.translate("common:STATE", null, "uk-UA"),
|
||||
ru: client.translate("common:STATE", null, "ru-RU"),
|
||||
})
|
||||
.setRequired(true),
|
||||
)
|
||||
.addChannelOption(option =>
|
||||
option
|
||||
.setName("channel")
|
||||
.setDescription(client.translate("common:CHANNEL"))
|
||||
.setDescriptionLocalizations({
|
||||
uk: client.translate("common:CHANNEL", null, "uk-UA"),
|
||||
ru: client.translate("common:CHANNEL", null, "ru-RU"),
|
||||
}),
|
||||
),
|
||||
),
|
||||
aliases: [],
|
||||
dirname: __dirname,
|
||||
|
@ -94,38 +107,45 @@ class Config extends BaseCommand {
|
|||
.addFields([
|
||||
{
|
||||
name: interaction.translate("administration/config:WELCOME_TITLE"),
|
||||
value: guildData.plugins.welcome.enabled ? interaction.translate("administration/config:WELCOME_CONTENT", {
|
||||
channel: `<#${guildData.plugins.welcome.channel}>`,
|
||||
withImage: guildData.plugins.welcome.withImage ? interaction.translate("common:YES") : interaction.translate("common:NO"),
|
||||
}) : interaction.translate("common:DISABLED"),
|
||||
value: guildData.plugins.welcome.enabled
|
||||
? interaction.translate("administration/config:WELCOME_CONTENT", {
|
||||
channel: `<#${guildData.plugins.welcome.channel}>`,
|
||||
withImage: guildData.plugins.welcome.withImage ? interaction.translate("common:YES") : interaction.translate("common:NO"),
|
||||
}) : interaction.translate("common:DISABLED"),
|
||||
inline: true,
|
||||
},
|
||||
{
|
||||
name: interaction.translate("administration/config:GOODBYE_TITLE"),
|
||||
value: guildData.plugins.goodbye.enabled ? interaction.translate("administration/config:GOODBYE_CONTENT", {
|
||||
channel: `<#${guildData.plugins.goodbye.channel}>`,
|
||||
withImage: guildData.plugins.goodbye.withImage ? interaction.translate("common:YES") : interaction.translate("common:NO"),
|
||||
}) : interaction.translate("common:DISABLED"),
|
||||
value: guildData.plugins.goodbye.enabled
|
||||
? interaction.translate("administration/config:GOODBYE_CONTENT", {
|
||||
channel: `<#${guildData.plugins.goodbye.channel}>`,
|
||||
withImage: guildData.plugins.goodbye.withImage ? interaction.translate("common:YES") : interaction.translate("common:NO"),
|
||||
}) : interaction.translate("common:DISABLED"),
|
||||
inline: true,
|
||||
},
|
||||
{
|
||||
name: interaction.translate("administration/config:AUTOROLE_TITLE"),
|
||||
value: guildData.plugins.autorole.enabled ? `<@&${guildData.plugins.autorole.role}>`
|
||||
: interaction.translate("common:DISABLED"),
|
||||
value: guildData.plugins.autorole.enabled ? `<@&${guildData.plugins.autorole.role}>` : interaction.translate("common:DISABLED"),
|
||||
},
|
||||
{
|
||||
name: interaction.translate("administration/config:AUTO_SANCTIONS"),
|
||||
value: (guildData.plugins.warnsSanctions.kick ? interaction.translate("administration/config:KICK_CONTENT", {
|
||||
count: guildData.plugins.warnsSanctions.kick,
|
||||
}) : interaction.translate("administration/config:KICK_NOT_DEFINED")) + "\n" + (guildData.plugins.warnsSanctions.ban ? interaction.translate("administration/config:BAN_CONTENT", {
|
||||
count: guildData.plugins.warnsSanctions.ban,
|
||||
}) : interaction.translate("administration/config:BAN_NOT_DEFINED")),
|
||||
value:
|
||||
(guildData.plugins.warnsSanctions.kick
|
||||
? interaction.translate("administration/config:KICK_CONTENT", {
|
||||
count: guildData.plugins.warnsSanctions.kick,
|
||||
}) : interaction.translate("administration/config:KICK_NOT_DEFINED")) +
|
||||
"\n" +
|
||||
(guildData.plugins.warnsSanctions.ban
|
||||
? interaction.translate("administration/config:BAN_CONTENT", {
|
||||
count: guildData.plugins.warnsSanctions.ban,
|
||||
}) : interaction.translate("administration/config:BAN_NOT_DEFINED")),
|
||||
},
|
||||
{
|
||||
name: interaction.translate("administration/config:AUTOMOD_TITLE"),
|
||||
value: guildData.plugins.automod.enabled ? interaction.translate("administration/config:AUTOMOD_CONTENT", {
|
||||
channels: guildData.plugins.automod.ignored.map(ch => ` ${ch}`),
|
||||
}) : interaction.translate("common:DISABLED"),
|
||||
value: guildData.plugins.automod.enabled
|
||||
? interaction.translate("administration/config:AUTOMOD_CONTENT", {
|
||||
channels: guildData.plugins.automod.ignored.map(ch => ` ${ch}`),
|
||||
}) : interaction.translate("common:DISABLED"),
|
||||
},
|
||||
{
|
||||
name: interaction.translate("administration/config:MONITORING_CHANNELS"),
|
||||
|
@ -189,10 +209,13 @@ async function changeSetting(interaction, setting, state, channel, guildData) {
|
|||
content: `${interaction.translate(`administration/config:${setting.toUpperCase()}`)}: **${interaction.translate("common:ENABLED")}** (${channel.toString()})`,
|
||||
ephemeral: true,
|
||||
});
|
||||
} else return interaction.reply({
|
||||
content: `${interaction.translate(`administration/config:${setting.toUpperCase()}`)}: ${guildData.plugins[setting] ? `**${interaction.translate("common:ENABLED")}** (<#${guildData.plugins[setting]}>)` : `**${interaction.translate("common:DISABLED")}**`}`,
|
||||
ephemeral: true,
|
||||
});
|
||||
} else
|
||||
return interaction.reply({
|
||||
content: `${interaction.translate(`administration/config:${setting.toUpperCase()}`)}: ${
|
||||
guildData.plugins[setting] ? `**${interaction.translate("common:ENABLED")}** (<#${guildData.plugins[setting]}>)` : `**${interaction.translate("common:DISABLED")}**`
|
||||
}`,
|
||||
ephemeral: true,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -12,49 +12,65 @@ class Goodbye extends BaseCommand {
|
|||
.setName("goodbye")
|
||||
.setDescription(client.translate("administration/goodbye:DESCRIPTION"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("administration/goodbye:DESCRIPTION", null, "uk-UA"),
|
||||
"ru": client.translate("administration/goodbye:DESCRIPTION", null, "ru-RU"),
|
||||
uk: client.translate("administration/goodbye:DESCRIPTION", null, "uk-UA"),
|
||||
ru: client.translate("administration/goodbye:DESCRIPTION", null, "ru-RU"),
|
||||
})
|
||||
.setDMPermission(false)
|
||||
.setDefaultMemberPermissions(PermissionsBitField.Flags.ManageGuild)
|
||||
.addSubcommand(subcommand => subcommand.setName("test")
|
||||
.setDescription(client.translate("administration/goodbye:TEST"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("administration/goodbye:TEST", null, "uk-UA"),
|
||||
"ru": client.translate("administration/goodbye:TEST", null, "ru-RU"),
|
||||
}),
|
||||
.addSubcommand(subcommand =>
|
||||
subcommand
|
||||
.setName("test")
|
||||
.setDescription(client.translate("administration/goodbye:TEST"))
|
||||
.setDescriptionLocalizations({
|
||||
uk: client.translate("administration/goodbye:TEST", null, "uk-UA"),
|
||||
ru: client.translate("administration/goodbye:TEST", null, "ru-RU"),
|
||||
}),
|
||||
)
|
||||
.addSubcommand(subcommand => subcommand.setName("config")
|
||||
.setDescription(client.translate("administration/goodbye:CONFIG"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("administration/goodbye:CONFIG", null, "uk-UA"),
|
||||
"ru": client.translate("administration/goodbye:CONFIG", null, "ru-RU"),
|
||||
})
|
||||
.addBooleanOption(option => option.setName("state")
|
||||
.setDescription(client.translate("common:STATE"))
|
||||
.addSubcommand(subcommand =>
|
||||
subcommand
|
||||
.setName("config")
|
||||
.setDescription(client.translate("administration/goodbye:CONFIG"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("common:STATE", null, "uk-UA"),
|
||||
"ru": client.translate("common:STATE", null, "ru-RU"),
|
||||
uk: client.translate("administration/goodbye:CONFIG", null, "uk-UA"),
|
||||
ru: client.translate("administration/goodbye:CONFIG", null, "ru-RU"),
|
||||
})
|
||||
.setRequired(true))
|
||||
.addChannelOption(option => option.setName("channel")
|
||||
.setDescription(client.translate("common:CHANNEL"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("common:CHANNEL", null, "uk-UA"),
|
||||
"ru": client.translate("common:CHANNEL", null, "ru-RU"),
|
||||
}))
|
||||
.addStringOption(option => option.setName("message")
|
||||
.setDescription(client.translate("administration/goodbye:MESSAGE"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("administration/goodbye:MESSAGE", null, "uk-UA"),
|
||||
"ru": client.translate("administration/goodbye:MESSAGE", null, "ru-RU"),
|
||||
}))
|
||||
.addBooleanOption(option => option.setName("image")
|
||||
.setDescription(client.translate("administration/goodbye:IMAGE"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("administration/goodbye:IMAGE", null, "uk-UA"),
|
||||
"ru": client.translate("administration/goodbye:IMAGE", null, "ru-RU"),
|
||||
})),
|
||||
.addBooleanOption(option =>
|
||||
option
|
||||
.setName("state")
|
||||
.setDescription(client.translate("common:STATE"))
|
||||
.setDescriptionLocalizations({
|
||||
uk: client.translate("common:STATE", null, "uk-UA"),
|
||||
ru: client.translate("common:STATE", null, "ru-RU"),
|
||||
})
|
||||
.setRequired(true),
|
||||
)
|
||||
.addChannelOption(option =>
|
||||
option
|
||||
.setName("channel")
|
||||
.setDescription(client.translate("common:CHANNEL"))
|
||||
.setDescriptionLocalizations({
|
||||
uk: client.translate("common:CHANNEL", null, "uk-UA"),
|
||||
ru: client.translate("common:CHANNEL", null, "ru-RU"),
|
||||
}),
|
||||
)
|
||||
.addStringOption(option =>
|
||||
option
|
||||
.setName("message")
|
||||
.setDescription(client.translate("administration/goodbye:MESSAGE"))
|
||||
.setDescriptionLocalizations({
|
||||
uk: client.translate("administration/goodbye:MESSAGE", null, "uk-UA"),
|
||||
ru: client.translate("administration/goodbye:MESSAGE", null, "ru-RU"),
|
||||
}),
|
||||
)
|
||||
.addBooleanOption(option =>
|
||||
option
|
||||
.setName("image")
|
||||
.setDescription(client.translate("administration/goodbye:IMAGE"))
|
||||
.setDescriptionLocalizations({
|
||||
uk: client.translate("administration/goodbye:IMAGE", null, "uk-UA"),
|
||||
ru: client.translate("administration/goodbye:IMAGE", null, "ru-RU"),
|
||||
}),
|
||||
),
|
||||
),
|
||||
aliases: [],
|
||||
dirname: __dirname,
|
||||
|
|
|
@ -12,52 +12,68 @@ class Selectroles extends BaseCommand {
|
|||
.setName("selectroles")
|
||||
.setDescription(client.translate("administration/selectroles:DESCRIPTION"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("administration/selectroles:DESCRIPTION", null, "uk-UA"),
|
||||
"ru": client.translate("administration/selectroles:DESCRIPTION", null, "ru-RU"),
|
||||
uk: client.translate("administration/selectroles:DESCRIPTION", null, "uk-UA"),
|
||||
ru: client.translate("administration/selectroles:DESCRIPTION", null, "ru-RU"),
|
||||
})
|
||||
.setDMPermission(false)
|
||||
.setDefaultMemberPermissions(PermissionsBitField.Flags.ManageGuild)
|
||||
.addSubcommand(subcommand => subcommand.setName("message")
|
||||
.setDescription(client.translate("administration/selectroles:MESSAGE"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("administration/selectroles:MESSAGE", null, "uk-UA"),
|
||||
"ru": client.translate("administration/selectroles:MESSAGE", null, "ru-RU"),
|
||||
})
|
||||
.addStringOption(option => option.setName("text")
|
||||
.setDescription(client.translate("common:MESSAGE"))
|
||||
.addSubcommand(subcommand =>
|
||||
subcommand
|
||||
.setName("message")
|
||||
.setDescription(client.translate("administration/selectroles:MESSAGE"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("common:MESSAGE", null, "uk-UA"),
|
||||
"ru": client.translate("common:MESSAGE", null, "ru-RU"),
|
||||
uk: client.translate("administration/selectroles:MESSAGE", null, "uk-UA"),
|
||||
ru: client.translate("administration/selectroles:MESSAGE", null, "ru-RU"),
|
||||
})
|
||||
.setRequired(true)),
|
||||
.addStringOption(option =>
|
||||
option
|
||||
.setName("text")
|
||||
.setDescription(client.translate("common:MESSAGE"))
|
||||
.setDescriptionLocalizations({
|
||||
uk: client.translate("common:MESSAGE", null, "uk-UA"),
|
||||
ru: client.translate("common:MESSAGE", null, "ru-RU"),
|
||||
})
|
||||
.setRequired(true),
|
||||
),
|
||||
)
|
||||
.addSubcommand(subcommand => subcommand.setName("addrole")
|
||||
.setDescription(client.translate("administration/selectroles:ADDROLE"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("administration/selectroles:ADDROLE", null, "uk-UA"),
|
||||
"ru": client.translate("administration/selectroles:ADDROLE", null, "ru-RU"),
|
||||
})
|
||||
.addChannelOption(option => option.setName("channel")
|
||||
.setDescription(client.translate("common:CHANNEL"))
|
||||
.addSubcommand(subcommand =>
|
||||
subcommand
|
||||
.setName("addrole")
|
||||
.setDescription(client.translate("administration/selectroles:ADDROLE"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("common:CHANNEL", null, "uk-UA"),
|
||||
"ru": client.translate("common:CHANNEL", null, "ru-RU"),
|
||||
uk: client.translate("administration/selectroles:ADDROLE", null, "uk-UA"),
|
||||
ru: client.translate("administration/selectroles:ADDROLE", null, "ru-RU"),
|
||||
})
|
||||
.setRequired(true))
|
||||
.addStringOption(option => option.setName("message_id")
|
||||
.setDescription(client.translate("common:MESSAGE_ID"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("common:MESSAGE_ID", null, "uk-UA"),
|
||||
"ru": client.translate("common:MESSAGE_ID", null, "ru-RU"),
|
||||
})
|
||||
.setRequired(true))
|
||||
.addRoleOption(option => option.setName("role")
|
||||
.setDescription(client.translate("common:ROLE"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("common:ROLE", null, "uk-UA"),
|
||||
"ru": client.translate("common:ROLE", null, "ru-RU"),
|
||||
})
|
||||
.setRequired(true)),
|
||||
.addChannelOption(option =>
|
||||
option
|
||||
.setName("channel")
|
||||
.setDescription(client.translate("common:CHANNEL"))
|
||||
.setDescriptionLocalizations({
|
||||
uk: client.translate("common:CHANNEL", null, "uk-UA"),
|
||||
ru: client.translate("common:CHANNEL", null, "ru-RU"),
|
||||
})
|
||||
.setRequired(true),
|
||||
)
|
||||
.addStringOption(option =>
|
||||
option
|
||||
.setName("message_id")
|
||||
.setDescription(client.translate("common:MESSAGE_ID"))
|
||||
.setDescriptionLocalizations({
|
||||
uk: client.translate("common:MESSAGE_ID", null, "uk-UA"),
|
||||
ru: client.translate("common:MESSAGE_ID", null, "ru-RU"),
|
||||
})
|
||||
.setRequired(true),
|
||||
)
|
||||
.addRoleOption(option =>
|
||||
option
|
||||
.setName("role")
|
||||
.setDescription(client.translate("common:ROLE"))
|
||||
.setDescriptionLocalizations({
|
||||
uk: client.translate("common:ROLE", null, "uk-UA"),
|
||||
ru: client.translate("common:ROLE", null, "ru-RU"),
|
||||
})
|
||||
.setRequired(true),
|
||||
),
|
||||
),
|
||||
aliases: [],
|
||||
dirname: __dirname,
|
||||
|
@ -123,10 +139,12 @@ class Selectroles extends BaseCommand {
|
|||
let row = message.components[0];
|
||||
if (!row) row = new ActionRowBuilder();
|
||||
|
||||
const option = [{
|
||||
label: role.name,
|
||||
value: role.id,
|
||||
}];
|
||||
const option = [
|
||||
{
|
||||
label: role.name,
|
||||
value: role.id,
|
||||
},
|
||||
];
|
||||
|
||||
const menu = row.components[0];
|
||||
if (menu) {
|
||||
|
@ -134,22 +152,14 @@ class Selectroles extends BaseCommand {
|
|||
if (o.value === option[0].value) return interaction.error("administration/selectroles:ALREADY_IN_MENU");
|
||||
}
|
||||
|
||||
row = ActionRowBuilder.from(row)
|
||||
.setComponents(
|
||||
StringSelectMenuBuilder.from(menu)
|
||||
.setMinValues(0)
|
||||
.setMaxValues(menu.options.length + 1)
|
||||
.addOptions(option),
|
||||
);
|
||||
} else {
|
||||
row.addComponents(
|
||||
new StringSelectMenuBuilder()
|
||||
.setCustomId("auto_roles")
|
||||
row = ActionRowBuilder.from(row).setComponents(
|
||||
StringSelectMenuBuilder.from(menu)
|
||||
.setMinValues(0)
|
||||
.setMaxValues(1)
|
||||
.setPlaceholder(interaction.translate("common:AVAILABLE_OPTIONS"))
|
||||
.setMaxValues(menu.options.length + 1)
|
||||
.addOptions(option),
|
||||
);
|
||||
} else {
|
||||
row.addComponents(new StringSelectMenuBuilder().setCustomId("auto_roles").setMinValues(0).setMaxValues(1).setPlaceholder(interaction.translate("common:AVAILABLE_OPTIONS")).addOptions(option));
|
||||
}
|
||||
|
||||
message.edit({
|
||||
|
|
|
@ -12,38 +12,47 @@ class Set extends BaseCommand {
|
|||
.setName("set")
|
||||
.setDescription(client.translate("administration/set:DESCRIPTION"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("administration/set:DESCRIPTION", null, "uk-UA"),
|
||||
"ru": client.translate("administration/set:DESCRIPTION", null, "ru-RU"),
|
||||
uk: client.translate("administration/set:DESCRIPTION", null, "uk-UA"),
|
||||
ru: client.translate("administration/set:DESCRIPTION", null, "ru-RU"),
|
||||
})
|
||||
.setDMPermission(false)
|
||||
.setDefaultMemberPermissions(PermissionsBitField.Flags.ManageGuild)
|
||||
.addStringOption(option => option.setName("type")
|
||||
.setDescription(client.translate("owner/debug:TYPE"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("owner/debug:TYPE", null, "uk-UA"),
|
||||
"ru": client.translate("owner/debug:TYPE", null, "ru-RU"),
|
||||
})
|
||||
.setRequired(true)
|
||||
.setChoices(
|
||||
{ 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" },
|
||||
))
|
||||
.addUserOption(option => option.setName("user")
|
||||
.setDescription(client.translate("common:USER"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("common:USER", null, "uk-UA"),
|
||||
"ru": client.translate("common:USER", null, "ru-RU"),
|
||||
})
|
||||
.setRequired(true))
|
||||
.addIntegerOption(option => option.setName("int")
|
||||
.setDescription(client.translate("common:INT"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("common:INT", null, "uk-UA"),
|
||||
"ru": client.translate("common:INT", null, "ru-RU"),
|
||||
})
|
||||
.setRequired(true)),
|
||||
.addStringOption(option =>
|
||||
option
|
||||
.setName("type")
|
||||
.setDescription(client.translate("owner/debug:TYPE"))
|
||||
.setDescriptionLocalizations({
|
||||
uk: client.translate("owner/debug:TYPE", null, "uk-UA"),
|
||||
ru: client.translate("owner/debug:TYPE", null, "ru-RU"),
|
||||
})
|
||||
.setRequired(true)
|
||||
.setChoices(
|
||||
{ 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" },
|
||||
),
|
||||
)
|
||||
.addUserOption(option =>
|
||||
option
|
||||
.setName("user")
|
||||
.setDescription(client.translate("common:USER"))
|
||||
.setDescriptionLocalizations({
|
||||
uk: client.translate("common:USER", null, "uk-UA"),
|
||||
ru: client.translate("common:USER", null, "ru-RU"),
|
||||
})
|
||||
.setRequired(true),
|
||||
)
|
||||
.addIntegerOption(option =>
|
||||
option
|
||||
.setName("int")
|
||||
.setDescription(client.translate("common:INT"))
|
||||
.setDescriptionLocalizations({
|
||||
uk: client.translate("common:INT", null, "uk-UA"),
|
||||
ru: client.translate("common:INT", null, "ru-RU"),
|
||||
})
|
||||
.setRequired(true),
|
||||
),
|
||||
aliases: [],
|
||||
dirname: __dirname,
|
||||
ownerOnly: false,
|
||||
|
|
|
@ -12,23 +12,22 @@ class Setlang extends BaseCommand {
|
|||
.setName("setlang")
|
||||
.setDescription(client.translate("administration/setlang:DESCRIPTION"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("administration/setlang:DESCRIPTION", null, "uk-UA"),
|
||||
"ru": client.translate("administration/setlang:DESCRIPTION", null, "ru-RU"),
|
||||
uk: client.translate("administration/setlang:DESCRIPTION", null, "uk-UA"),
|
||||
ru: client.translate("administration/setlang:DESCRIPTION", null, "ru-RU"),
|
||||
})
|
||||
.setDMPermission(false)
|
||||
.setDefaultMemberPermissions(PermissionsBitField.Flags.ManageGuild)
|
||||
.addStringOption(option => option.setName("language")
|
||||
.setDescription(client.translate("common:LANGUAGE"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("common:LANGUAGE", null, "uk-UA"),
|
||||
"ru": client.translate("common:LANGUAGE", null, "ru-RU"),
|
||||
})
|
||||
.setRequired(true)
|
||||
.setChoices(
|
||||
{ name: "English", value: "en-US" },
|
||||
{ name: "Русский", value: "ru-RU" },
|
||||
{ name: "Українська", value: "uk-UA" },
|
||||
)),
|
||||
.addStringOption(option =>
|
||||
option
|
||||
.setName("language")
|
||||
.setDescription(client.translate("common:LANGUAGE"))
|
||||
.setDescriptionLocalizations({
|
||||
uk: client.translate("common:LANGUAGE", null, "uk-UA"),
|
||||
ru: client.translate("common:LANGUAGE", null, "ru-RU"),
|
||||
})
|
||||
.setRequired(true)
|
||||
.setChoices({ name: "English", value: "en-US" }, { name: "Русский", value: "ru-RU" }, { name: "Українська", value: "uk-UA" }),
|
||||
),
|
||||
aliases: [],
|
||||
dirname: __dirname,
|
||||
ownerOnly: false,
|
||||
|
|
|
@ -12,18 +12,21 @@ class Stealemoji extends BaseCommand {
|
|||
.setName("stealemoji")
|
||||
.setDescription(client.translate("administration/stealemoji:DESCRIPTION"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("administration/stealemoji:DESCRIPTION", null, "uk-UA"),
|
||||
"ru": client.translate("administration/stealemoji:DESCRIPTION", null, "ru-RU"),
|
||||
uk: client.translate("administration/stealemoji:DESCRIPTION", null, "uk-UA"),
|
||||
ru: client.translate("administration/stealemoji:DESCRIPTION", null, "ru-RU"),
|
||||
})
|
||||
.setDMPermission(false)
|
||||
.setDefaultMemberPermissions(PermissionsBitField.Flags.ManageGuild)
|
||||
.addStringOption(option => option.setName("emoji")
|
||||
.setDescription(client.translate("common:EMOJI"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("common:EMOJI", null, "uk-UA"),
|
||||
"ru": client.translate("common:EMOJI", null, "ru-RU"),
|
||||
})
|
||||
.setRequired(true)),
|
||||
.addStringOption(option =>
|
||||
option
|
||||
.setName("emoji")
|
||||
.setDescription(client.translate("common:EMOJI"))
|
||||
.setDescriptionLocalizations({
|
||||
uk: client.translate("common:EMOJI", null, "uk-UA"),
|
||||
ru: client.translate("common:EMOJI", null, "ru-RU"),
|
||||
})
|
||||
.setRequired(true),
|
||||
),
|
||||
aliases: [],
|
||||
dirname: __dirname,
|
||||
ownerOnly: false,
|
||||
|
@ -51,9 +54,11 @@ class Stealemoji extends BaseCommand {
|
|||
name: parsedEmoji.name,
|
||||
attachment: `https://cdn.discordapp.com/emojis/${parsedEmoji.id}.${ext}`,
|
||||
})
|
||||
.then(emoji => interaction.success("administration/stealemoji:SUCCESS", {
|
||||
emoji: emoji.name,
|
||||
}, { ephemeral: true }))
|
||||
.then(emoji =>
|
||||
interaction.success("administration/stealemoji:SUCCESS", {
|
||||
emoji: emoji.name,
|
||||
}, { ephemeral: true }),
|
||||
)
|
||||
.catch(e => {
|
||||
interaction.error("administration/stealemoji:ERROR", {
|
||||
emoji: parsedEmoji.name,
|
||||
|
|
|
@ -12,49 +12,65 @@ class Welcome extends BaseCommand {
|
|||
.setName("welcome")
|
||||
.setDescription(client.translate("administration/welcome:DESCRIPTION"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("administration/welcome:DESCRIPTION", null, "uk-UA"),
|
||||
"ru": client.translate("administration/welcome:DESCRIPTION", null, "ru-RU"),
|
||||
uk: client.translate("administration/welcome:DESCRIPTION", null, "uk-UA"),
|
||||
ru: client.translate("administration/welcome:DESCRIPTION", null, "ru-RU"),
|
||||
})
|
||||
.setDMPermission(false)
|
||||
.setDefaultMemberPermissions(PermissionsBitField.Flags.ManageGuild)
|
||||
.addSubcommand(subcommand => subcommand.setName("test")
|
||||
.setDescription(client.translate("administration/goodbye:TEST"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("administration/goodbye:TEST", null, "uk-UA"),
|
||||
"ru": client.translate("administration/goodbye:TEST", null, "ru-RU"),
|
||||
}),
|
||||
.addSubcommand(subcommand =>
|
||||
subcommand
|
||||
.setName("test")
|
||||
.setDescription(client.translate("administration/goodbye:TEST"))
|
||||
.setDescriptionLocalizations({
|
||||
uk: client.translate("administration/goodbye:TEST", null, "uk-UA"),
|
||||
ru: client.translate("administration/goodbye:TEST", null, "ru-RU"),
|
||||
}),
|
||||
)
|
||||
.addSubcommand(subcommand => subcommand.setName("config")
|
||||
.setDescription(client.translate("administration/goodbye:CONFIG"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("administration/goodbye:CONFIG", null, "uk-UA"),
|
||||
"ru": client.translate("administration/goodbye:CONFIG", null, "ru-RU"),
|
||||
})
|
||||
.addBooleanOption(option => option.setName("state")
|
||||
.setDescription(client.translate("common:STATE"))
|
||||
.addSubcommand(subcommand =>
|
||||
subcommand
|
||||
.setName("config")
|
||||
.setDescription(client.translate("administration/goodbye:CONFIG"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("common:STATE", null, "uk-UA"),
|
||||
"ru": client.translate("common:STATE", null, "ru-RU"),
|
||||
uk: client.translate("administration/goodbye:CONFIG", null, "uk-UA"),
|
||||
ru: client.translate("administration/goodbye:CONFIG", null, "ru-RU"),
|
||||
})
|
||||
.setRequired(true))
|
||||
.addChannelOption(option => option.setName("channel")
|
||||
.setDescription(client.translate("common:CHANNEL"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("common:CHANNEL", null, "uk-UA"),
|
||||
"ru": client.translate("common:CHANNEL", null, "ru-RU"),
|
||||
}))
|
||||
.addStringOption(option => option.setName("message")
|
||||
.setDescription(client.translate("administration/goodbye:MESSAGE"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("administration/goodbye:MESSAGE", null, "uk-UA"),
|
||||
"ru": client.translate("administration/goodbye:MESSAGE", null, "ru-RU"),
|
||||
}))
|
||||
.addBooleanOption(option => option.setName("image")
|
||||
.setDescription(client.translate("administration/goodbye:IMAGE"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("administration/goodbye:IMAGE", null, "uk-UA"),
|
||||
"ru": client.translate("administration/goodbye:IMAGE", null, "ru-RU"),
|
||||
})),
|
||||
.addBooleanOption(option =>
|
||||
option
|
||||
.setName("state")
|
||||
.setDescription(client.translate("common:STATE"))
|
||||
.setDescriptionLocalizations({
|
||||
uk: client.translate("common:STATE", null, "uk-UA"),
|
||||
ru: client.translate("common:STATE", null, "ru-RU"),
|
||||
})
|
||||
.setRequired(true),
|
||||
)
|
||||
.addChannelOption(option =>
|
||||
option
|
||||
.setName("channel")
|
||||
.setDescription(client.translate("common:CHANNEL"))
|
||||
.setDescriptionLocalizations({
|
||||
uk: client.translate("common:CHANNEL", null, "uk-UA"),
|
||||
ru: client.translate("common:CHANNEL", null, "ru-RU"),
|
||||
}),
|
||||
)
|
||||
.addStringOption(option =>
|
||||
option
|
||||
.setName("message")
|
||||
.setDescription(client.translate("administration/goodbye:MESSAGE"))
|
||||
.setDescriptionLocalizations({
|
||||
uk: client.translate("administration/goodbye:MESSAGE", null, "uk-UA"),
|
||||
ru: client.translate("administration/goodbye:MESSAGE", null, "ru-RU"),
|
||||
}),
|
||||
)
|
||||
.addBooleanOption(option =>
|
||||
option
|
||||
.setName("image")
|
||||
.setDescription(client.translate("administration/goodbye:IMAGE"))
|
||||
.setDescriptionLocalizations({
|
||||
uk: client.translate("administration/goodbye:IMAGE", null, "uk-UA"),
|
||||
ru: client.translate("administration/goodbye:IMAGE", null, "ru-RU"),
|
||||
}),
|
||||
),
|
||||
),
|
||||
aliases: [],
|
||||
dirname: __dirname,
|
||||
|
|
|
@ -12,16 +12,19 @@ class Achievements extends BaseCommand {
|
|||
.setName("achievements")
|
||||
.setDescription(client.translate("economy/achievements:DESCRIPTION"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("economy/achievements:DESCRIPTION", null, "uk-UA"),
|
||||
"ru": client.translate("economy/achievements:DESCRIPTION", null, "ru-RU"),
|
||||
uk: client.translate("economy/achievements:DESCRIPTION", null, "uk-UA"),
|
||||
ru: client.translate("economy/achievements:DESCRIPTION", null, "ru-RU"),
|
||||
})
|
||||
.setDMPermission(false)
|
||||
.addUserOption(option => option.setName("user")
|
||||
.setDescription(client.translate("common:USER"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("common:USER", null, "uk-UA"),
|
||||
"ru": client.translate("common:USER", null, "ru-RU"),
|
||||
})),
|
||||
.addUserOption(option =>
|
||||
option
|
||||
.setName("user")
|
||||
.setDescription(client.translate("common:USER"))
|
||||
.setDescriptionLocalizations({
|
||||
uk: client.translate("common:USER", null, "uk-UA"),
|
||||
ru: client.translate("common:USER", null, "ru-RU"),
|
||||
}),
|
||||
),
|
||||
aliases: [],
|
||||
dirname: __dirname,
|
||||
ownerOnly: false,
|
||||
|
@ -44,9 +47,7 @@ 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,
|
||||
}));
|
||||
const userData = user.id === interaction.user.id ? data.userData : await client.findOrCreateUser({ id: user.id });
|
||||
|
||||
const embed = new EmbedBuilder()
|
||||
.setAuthor({
|
||||
|
|
|
@ -12,28 +12,31 @@ class Bank extends BaseCommand {
|
|||
.setName("bank")
|
||||
.setDescription(client.translate("economy/bank:DESCRIPTION"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("economy/bank:DESCRIPTION", null, "uk-UA"),
|
||||
"ru": client.translate("economy/bank:DESCRIPTION", null, "ru-RU"),
|
||||
uk: client.translate("economy/bank:DESCRIPTION", null, "uk-UA"),
|
||||
ru: client.translate("economy/bank:DESCRIPTION", null, "ru-RU"),
|
||||
})
|
||||
.setDMPermission(false)
|
||||
.addStringOption(option => option.setName("option")
|
||||
.setDescription(client.translate("economy/bank:OPTION"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("economy/bank:OPTION", null, "uk-UA"),
|
||||
"ru": client.translate("economy/bank:OPTION", null, "ru-RU"),
|
||||
})
|
||||
.setRequired(true)
|
||||
.setChoices(
|
||||
{ name: client.translate("economy/bank:DEPOSIT"), value: "deposit" },
|
||||
{ name: client.translate("economy/bank:WITHDRAW"), value: "withdraw" },
|
||||
))
|
||||
.addStringOption(option => option.setName("credits")
|
||||
.setDescription(client.translate("misc:OPTION_NAN_ALL"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("misc:OPTION_NAN_ALL", null, "uk-UA"),
|
||||
"ru": client.translate("misc:OPTION_NAN_ALL", null, "ru-RU"),
|
||||
})
|
||||
.setRequired(true)),
|
||||
.addStringOption(option =>
|
||||
option
|
||||
.setName("option")
|
||||
.setDescription(client.translate("economy/bank:OPTION"))
|
||||
.setDescriptionLocalizations({
|
||||
uk: client.translate("economy/bank:OPTION", null, "uk-UA"),
|
||||
ru: client.translate("economy/bank:OPTION", null, "ru-RU"),
|
||||
})
|
||||
.setRequired(true)
|
||||
.setChoices({ name: client.translate("economy/bank:DEPOSIT"), value: "deposit" }, { name: client.translate("economy/bank:WITHDRAW"), value: "withdraw" }),
|
||||
)
|
||||
.addStringOption(option =>
|
||||
option
|
||||
.setName("credits")
|
||||
.setDescription(client.translate("misc:OPTION_NAN_ALL"))
|
||||
.setDescriptionLocalizations({
|
||||
uk: client.translate("misc:OPTION_NAN_ALL", null, "uk-UA"),
|
||||
ru: client.translate("misc:OPTION_NAN_ALL", null, "ru-RU"),
|
||||
})
|
||||
.setRequired(true),
|
||||
),
|
||||
aliases: [],
|
||||
dirname: __dirname,
|
||||
ownerOnly: false,
|
||||
|
@ -58,7 +61,10 @@ class Bank extends BaseCommand {
|
|||
if (choice === "deposit") {
|
||||
const credits = interaction.options.getString("credits").toLowerCase() === "all" ? data.memberData.money : interaction.options.getString("credits");
|
||||
if (isNaN(credits) || credits < 1) return interaction.error("misc:OPTION_NAN_ALL");
|
||||
if (data.memberData.money < credits) return interaction.error("economy/bank:NOT_ENOUGH_CREDIT", { money: `**${credits}** ${client.functions.getNoun(credits, interaction.translate("misc:NOUNS:CREDIT:1"), interaction.translate("misc:NOUNS:CREDIT:2"), interaction.translate("misc:NOUNS:CREDIT:5"))}` });
|
||||
if (data.memberData.money < credits)
|
||||
return interaction.error("economy/bank:NOT_ENOUGH_CREDIT", {
|
||||
money: `**${credits}** ${client.functions.getNoun(credits, interaction.translate("misc:NOUNS:CREDIT:1"), interaction.translate("misc:NOUNS:CREDIT:2"), interaction.translate("misc:NOUNS:CREDIT:5"))}`,
|
||||
});
|
||||
|
||||
data.memberData.money -= credits;
|
||||
data.memberData.bankSold += credits;
|
||||
|
@ -80,7 +86,10 @@ class Bank extends BaseCommand {
|
|||
} else {
|
||||
const credits = interaction.options.getString("credits") === "all" ? data.memberData.bankSold : interaction.options.getString("credits");
|
||||
if (isNaN(credits) || credits < 1) return interaction.error("misc:OPTION_NAN_ALL");
|
||||
if (data.memberData.bankSold < credits) return interaction.error("economy/bank:NOT_ENOUGH_BANK", { money: `**${credits}** ${client.functions.getNoun(credits, interaction.translate("misc:NOUNS:CREDIT:1"), interaction.translate("misc:NOUNS:CREDIT:2"), interaction.translate("misc:NOUNS:CREDIT:5"))}` });
|
||||
if (data.memberData.bankSold < credits)
|
||||
return interaction.error("economy/bank:NOT_ENOUGH_BANK", {
|
||||
money: `**${credits}** ${client.functions.getNoun(credits, interaction.translate("misc:NOUNS:CREDIT:1"), interaction.translate("misc:NOUNS:CREDIT:2"), interaction.translate("misc:NOUNS:CREDIT:5"))}`,
|
||||
});
|
||||
|
||||
const info = {
|
||||
user: interaction.translate("economy/transactions:BANK"),
|
||||
|
|
|
@ -12,45 +12,54 @@ class Birthdate extends BaseCommand {
|
|||
.setName("birthdate")
|
||||
.setDescription(client.translate("economy/birthdate:DESCRIPTION"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("economy/birthdate:DESCRIPTION", null, "uk-UA"),
|
||||
"ru": client.translate("economy/birthdate:DESCRIPTION", null, "ru-RU"),
|
||||
uk: client.translate("economy/birthdate:DESCRIPTION", null, "uk-UA"),
|
||||
ru: client.translate("economy/birthdate:DESCRIPTION", null, "ru-RU"),
|
||||
})
|
||||
.setDMPermission(false)
|
||||
.addIntegerOption(option => option.setName("day")
|
||||
.setDescription(client.translate("economy/birthdate:DAY"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("economy/birthdate:DAY", null, "uk-UA"),
|
||||
"ru": client.translate("economy/birthdate:DAY", null, "ru-RU"),
|
||||
})
|
||||
.setRequired(true))
|
||||
.addIntegerOption(option => option.setName("month")
|
||||
.setDescription(client.translate("economy/birthdate:MONTH"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("economy/birthdate:MONTH", null, "uk-UA"),
|
||||
"ru": client.translate("economy/birthdate:MONTH", null, "ru-RU"),
|
||||
})
|
||||
.setRequired(true)
|
||||
.setChoices(
|
||||
{ name: client.translate("economy/birthdate:JANUARY"), value: 1 },
|
||||
{ name: client.translate("economy/birthdate:FEBRUARY"), value: 2 },
|
||||
{ name: client.translate("economy/birthdate:MARCH"), value: 3 },
|
||||
{ name: client.translate("economy/birthdate:APRIL"), value: 4 },
|
||||
{ name: client.translate("economy/birthdate:MAY"), value: 5 },
|
||||
{ name: client.translate("economy/birthdate:JUNE"), value: 6 },
|
||||
{ name: client.translate("economy/birthdate:JULY"), value: 7 },
|
||||
{ name: client.translate("economy/birthdate:AUGUST"), value: 8 },
|
||||
{ name: client.translate("economy/birthdate:SEPTEMBER"), value: 9 },
|
||||
{ name: client.translate("economy/birthdate:OCTOBER"), value: 10 },
|
||||
{ name: client.translate("economy/birthdate:NOVEMBER"), value: 11 },
|
||||
{ name: client.translate("economy/birthdate:DECEMBER"), value: 12 },
|
||||
))
|
||||
.addIntegerOption(option => option.setName("year")
|
||||
.setDescription(client.translate("economy/birthdate:YEAR"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("economy/birthdate:YEAR", null, "uk-UA"),
|
||||
"ru": client.translate("economy/birthdate:YEAR", null, "ru-RU"),
|
||||
})
|
||||
.setRequired(true)),
|
||||
.addIntegerOption(option =>
|
||||
option
|
||||
.setName("day")
|
||||
.setDescription(client.translate("economy/birthdate:DAY"))
|
||||
.setDescriptionLocalizations({
|
||||
uk: client.translate("economy/birthdate:DAY", null, "uk-UA"),
|
||||
ru: client.translate("economy/birthdate:DAY", null, "ru-RU"),
|
||||
})
|
||||
.setRequired(true),
|
||||
)
|
||||
.addIntegerOption(option =>
|
||||
option
|
||||
.setName("month")
|
||||
.setDescription(client.translate("economy/birthdate:MONTH"))
|
||||
.setDescriptionLocalizations({
|
||||
uk: client.translate("economy/birthdate:MONTH", null, "uk-UA"),
|
||||
ru: client.translate("economy/birthdate:MONTH", null, "ru-RU"),
|
||||
})
|
||||
.setRequired(true)
|
||||
.setChoices(
|
||||
{ name: client.translate("economy/birthdate:JANUARY"), value: 1 },
|
||||
{ name: client.translate("economy/birthdate:FEBRUARY"), value: 2 },
|
||||
{ name: client.translate("economy/birthdate:MARCH"), value: 3 },
|
||||
{ name: client.translate("economy/birthdate:APRIL"), value: 4 },
|
||||
{ name: client.translate("economy/birthdate:MAY"), value: 5 },
|
||||
{ name: client.translate("economy/birthdate:JUNE"), value: 6 },
|
||||
{ name: client.translate("economy/birthdate:JULY"), value: 7 },
|
||||
{ name: client.translate("economy/birthdate:AUGUST"), value: 8 },
|
||||
{ name: client.translate("economy/birthdate:SEPTEMBER"), value: 9 },
|
||||
{ name: client.translate("economy/birthdate:OCTOBER"), value: 10 },
|
||||
{ name: client.translate("economy/birthdate:NOVEMBER"), value: 11 },
|
||||
{ name: client.translate("economy/birthdate:DECEMBER"), value: 12 },
|
||||
),
|
||||
)
|
||||
.addIntegerOption(option =>
|
||||
option
|
||||
.setName("year")
|
||||
.setDescription(client.translate("economy/birthdate:YEAR"))
|
||||
.setDescriptionLocalizations({
|
||||
uk: client.translate("economy/birthdate:YEAR", null, "uk-UA"),
|
||||
ru: client.translate("economy/birthdate:YEAR", null, "ru-RU"),
|
||||
})
|
||||
.setRequired(true),
|
||||
),
|
||||
aliases: [],
|
||||
dirname: __dirname,
|
||||
ownerOnly: false,
|
||||
|
@ -77,7 +86,7 @@ class Birthdate extends BaseCommand {
|
|||
|
||||
if (!(day == d.getDate() && month - 1 == d.getMonth() && year == d.getFullYear())) return interaction.error("economy/birthdate:INVALID_DATE");
|
||||
if (d.getTime() > Date.now()) return interaction.error("economy/birthdate:DATE_TOO_HIGH");
|
||||
if (d.getTime() < (Date.now() - 2.523e+12)) return interaction.error("economy/birthdate:DATE_TOO_LOW");
|
||||
if (d.getTime() < Date.now() - 2.523e12) return interaction.error("economy/birthdate:DATE_TOO_LOW");
|
||||
|
||||
data.userData.birthdate = d;
|
||||
data.userData.markModified("birthdate");
|
||||
|
|
|
@ -12,8 +12,8 @@ class Divorce extends BaseCommand {
|
|||
.setName("divorce")
|
||||
.setDescription(client.translate("economy/divorce:DESCRIPTION"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("economy/divorce:DESCRIPTION", null, "uk-UA"),
|
||||
"ru": client.translate("economy/divorce:DESCRIPTION", null, "ru-RU"),
|
||||
uk: client.translate("economy/divorce:DESCRIPTION", null, "uk-UA"),
|
||||
ru: client.translate("economy/divorce:DESCRIPTION", null, "ru-RU"),
|
||||
})
|
||||
.setDMPermission(false),
|
||||
aliases: [],
|
||||
|
@ -36,7 +36,7 @@ class Divorce extends BaseCommand {
|
|||
*/
|
||||
async execute(client, interaction, data) {
|
||||
if (!data.userData.lover) return interaction.error("economy/divorce:NOT_MARRIED");
|
||||
const user = client.users.cache.get(data.userData.lover) || await client.users.fetch(data.userData.lover);
|
||||
const user = client.users.cache.get(data.userData.lover) || (await client.users.fetch(data.userData.lover));
|
||||
|
||||
data.userData.lover = null;
|
||||
data.user.markModified("lover");
|
||||
|
|
|
@ -12,22 +12,21 @@ class Leaderboard extends BaseCommand {
|
|||
.setName("leaderboard")
|
||||
.setDescription(client.translate("economy/leaderboard:DESCRIPTION"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("economy/leaderboard:DESCRIPTION", null, "uk-UA"),
|
||||
"ru": client.translate("economy/leaderboard:DESCRIPTION", null, "ru-RU"),
|
||||
uk: client.translate("economy/leaderboard:DESCRIPTION", null, "uk-UA"),
|
||||
ru: client.translate("economy/leaderboard:DESCRIPTION", null, "ru-RU"),
|
||||
})
|
||||
.setDMPermission(false)
|
||||
.addStringOption(option => option.setName("type")
|
||||
.setDescription(client.translate("owner/debug:TYPE"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("owner/debug:TYPE", null, "uk-UA"),
|
||||
"ru": client.translate("owner/debug:TYPE", null, "ru-RU"),
|
||||
})
|
||||
.setRequired(true)
|
||||
.setChoices(
|
||||
{ name: client.translate("common:LEVEL"), value: "level" },
|
||||
{ name: client.translate("common:MONEY"), value: "money" },
|
||||
{ name: client.translate("common:REP"), value: "rep" },
|
||||
)),
|
||||
.addStringOption(option =>
|
||||
option
|
||||
.setName("type")
|
||||
.setDescription(client.translate("owner/debug:TYPE"))
|
||||
.setDescriptionLocalizations({
|
||||
uk: client.translate("owner/debug:TYPE", null, "uk-UA"),
|
||||
ru: client.translate("owner/debug:TYPE", null, "ru-RU"),
|
||||
})
|
||||
.setRequired(true)
|
||||
.setChoices({ name: client.translate("common:LEVEL"), value: "level" }, { name: client.translate("common:MONEY"), value: "money" }, { name: client.translate("common:REP"), value: "rep" }),
|
||||
),
|
||||
aliases: [],
|
||||
dirname: __dirname,
|
||||
ownerOnly: false,
|
||||
|
@ -51,10 +50,11 @@ class Leaderboard extends BaseCommand {
|
|||
|
||||
const type = interaction.options.getString("type");
|
||||
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,
|
||||
});
|
||||
if (isOnMobile)
|
||||
interaction.followUp({
|
||||
content: interaction.translate("economy/leaderboard:MOBILE"),
|
||||
ephemeral: true,
|
||||
});
|
||||
|
||||
if (type === "money") {
|
||||
const membersLeaderboard = [],
|
||||
|
@ -86,15 +86,18 @@ class Leaderboard extends BaseCommand {
|
|||
iconURL: interaction.guild.iconURL(),
|
||||
})
|
||||
.setColor(client.config.embed.color)
|
||||
.addFields({
|
||||
name: interaction.translate("common:USER"),
|
||||
value: userNames,
|
||||
inline: true,
|
||||
}, {
|
||||
name: interaction.translate("common:CREDITS"),
|
||||
value: money,
|
||||
inline: true,
|
||||
});
|
||||
.addFields(
|
||||
{
|
||||
name: interaction.translate("common:USER"),
|
||||
value: userNames,
|
||||
inline: true,
|
||||
},
|
||||
{
|
||||
name: interaction.translate("common:CREDITS"),
|
||||
value: money,
|
||||
inline: true,
|
||||
},
|
||||
);
|
||||
|
||||
interaction.editReply({
|
||||
embeds: [embed],
|
||||
|
@ -183,15 +186,18 @@ class Leaderboard extends BaseCommand {
|
|||
iconURL: interaction.guild.iconURL(),
|
||||
})
|
||||
.setColor(client.config.embed.color)
|
||||
.addFields({
|
||||
name: interaction.translate("common:USER"),
|
||||
value: userNames,
|
||||
inline: true,
|
||||
}, {
|
||||
name: interaction.translate("common:REP"),
|
||||
value: rep,
|
||||
inline: true,
|
||||
});
|
||||
.addFields(
|
||||
{
|
||||
name: interaction.translate("common:USER"),
|
||||
value: userNames,
|
||||
inline: true,
|
||||
},
|
||||
{
|
||||
name: interaction.translate("common:REP"),
|
||||
value: rep,
|
||||
inline: true,
|
||||
},
|
||||
);
|
||||
|
||||
interaction.editReply({
|
||||
embeds: [embed],
|
||||
|
|
|
@ -13,17 +13,20 @@ class Marry extends BaseCommand {
|
|||
.setName("marry")
|
||||
.setDescription(client.translate("economy/marry:DESCRIPTION"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("economy/marry:DESCRIPTION", null, "uk-UA"),
|
||||
"ru": client.translate("economy/marry:DESCRIPTION", null, "ru-RU"),
|
||||
uk: client.translate("economy/marry:DESCRIPTION", null, "uk-UA"),
|
||||
ru: client.translate("economy/marry:DESCRIPTION", null, "ru-RU"),
|
||||
})
|
||||
.setDMPermission(false)
|
||||
.addUserOption(option => option.setName("user")
|
||||
.setDescription(client.translate("common:USER"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("common:USER", null, "uk-UA"),
|
||||
"ru": client.translate("common:USER", null, "ru-RU"),
|
||||
})
|
||||
.setRequired(true)),
|
||||
.addUserOption(option =>
|
||||
option
|
||||
.setName("user")
|
||||
.setDescription(client.translate("common:USER"))
|
||||
.setDescriptionLocalizations({
|
||||
uk: client.translate("common:USER", null, "uk-UA"),
|
||||
ru: client.translate("common:USER", null, "ru-RU"),
|
||||
})
|
||||
.setRequired(true),
|
||||
),
|
||||
aliases: [],
|
||||
dirname: __dirname,
|
||||
ownerOnly: false,
|
||||
|
@ -58,23 +61,27 @@ class Marry extends BaseCommand {
|
|||
const receiver = pendings[requester];
|
||||
|
||||
if (requester === interaction.author.id) {
|
||||
const user = client.users.cache.get(receiver) || await client.users.fetch(receiver);
|
||||
const user = client.users.cache.get(receiver) || (await client.users.fetch(receiver));
|
||||
|
||||
return interaction.error("economy/marry:REQUEST_AUTHOR_TO_AMEMBER", {
|
||||
user: user.toString,
|
||||
});
|
||||
} else if (receiver === interaction.member.id) {
|
||||
const user = client.users.cache.get(requester) || await client.users.fetch(requester);
|
||||
const user = client.users.cache.get(requester) || (await client.users.fetch(requester));
|
||||
|
||||
return interaction.error("economy/marry:REQUEST_AMEMBER_TO_AUTHOR", {
|
||||
user: user.toString(),
|
||||
});
|
||||
} else if (requester === member.id) {
|
||||
const user = client.users.cache.get(receiver) || await client.users.fetch(receiver);
|
||||
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(),
|
||||
});
|
||||
} else if (receiver === member.id) {
|
||||
const user = client.users.cache.get(requester) || await client.users.fetch(requester);
|
||||
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(),
|
||||
|
@ -84,17 +91,10 @@ class Marry extends BaseCommand {
|
|||
|
||||
pendings[interaction.member.id] = member.id;
|
||||
|
||||
const row = new ActionRowBuilder()
|
||||
.addComponents(
|
||||
new ButtonBuilder()
|
||||
.setCustomId("marry_confirm_yes")
|
||||
.setLabel(interaction.translate("common:ACCEPT"))
|
||||
.setStyle(ButtonStyle.Success),
|
||||
new ButtonBuilder()
|
||||
.setCustomId("marry_confirm_no")
|
||||
.setLabel(interaction.translate("common:CANCEL"))
|
||||
.setStyle(ButtonStyle.Danger),
|
||||
);
|
||||
const row = new ActionRowBuilder().addComponents(
|
||||
new ButtonBuilder().setCustomId("marry_confirm_yes").setLabel(interaction.translate("common:ACCEPT")).setStyle(ButtonStyle.Success),
|
||||
new ButtonBuilder().setCustomId("marry_confirm_no").setLabel(interaction.translate("common:CANCEL")).setStyle(ButtonStyle.Danger),
|
||||
);
|
||||
|
||||
await interaction.reply({
|
||||
content: interaction.translate("economy/marry:REQUEST", {
|
||||
|
@ -105,7 +105,7 @@ class Marry extends BaseCommand {
|
|||
});
|
||||
|
||||
const filter = i => i.user.id === member.id;
|
||||
const collector = interaction.channel.createMessageComponentCollector({ filter, idle: (10 * 60 * 1000) });
|
||||
const collector = interaction.channel.createMessageComponentCollector({ filter, idle: 10 * 60 * 1000 });
|
||||
|
||||
collector.on("collect", async i => {
|
||||
if (i.isButton()) {
|
||||
|
@ -137,10 +137,12 @@ class Marry extends BaseCommand {
|
|||
|
||||
const messageOptions = {
|
||||
content: `${member.toString()} :heart: ${interaction.member.toString()}`,
|
||||
files: [{
|
||||
name: "achievement_unlocked3.png",
|
||||
attachment: "./assets/img/achievements/achievement_unlocked3.png",
|
||||
}],
|
||||
files: [
|
||||
{
|
||||
name: "achievement_unlocked3.png",
|
||||
attachment: "./assets/img/achievements/achievement_unlocked3.png",
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
let sent = false;
|
||||
|
|
|
@ -12,16 +12,19 @@ class Money extends BaseCommand {
|
|||
.setName("money")
|
||||
.setDescription(client.translate("economy/money:DESCRIPTION"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("economy/money:DESCRIPTION", null, "uk-UA"),
|
||||
"ru": client.translate("economy/money:DESCRIPTION", null, "ru-RU"),
|
||||
uk: client.translate("economy/money:DESCRIPTION", null, "uk-UA"),
|
||||
ru: client.translate("economy/money:DESCRIPTION", null, "ru-RU"),
|
||||
})
|
||||
.setDMPermission(false)
|
||||
.addUserOption(option => option.setName("user")
|
||||
.setDescription(client.translate("common:USER"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("common:USER", null, "uk-UA"),
|
||||
"ru": client.translate("common:USER", null, "ru-RU"),
|
||||
})),
|
||||
.addUserOption(option =>
|
||||
option
|
||||
.setName("user")
|
||||
.setDescription(client.translate("common:USER"))
|
||||
.setDescriptionLocalizations({
|
||||
uk: client.translate("common:USER", null, "uk-UA"),
|
||||
ru: client.translate("common:USER", null, "ru-RU"),
|
||||
}),
|
||||
),
|
||||
aliases: [],
|
||||
dirname: __dirname,
|
||||
ownerOnly: false,
|
||||
|
@ -46,10 +49,7 @@ class Money extends BaseCommand {
|
|||
const member = interaction.options.getMember("user") || interaction.member;
|
||||
if (member.user.bot) return interaction.error("economy/money:BOT_USER");
|
||||
|
||||
const memberData = member.id === interaction.user.id ? data.memberData : await client.findOrCreateMember({
|
||||
id: member.id,
|
||||
guildId: interaction.guildId,
|
||||
});
|
||||
const memberData = member.id === interaction.user.id ? data.memberData : await client.findOrCreateMember({ id: member.id, guildId: interaction.guildId });
|
||||
|
||||
const guilds = client.guilds.cache.filter(g => g.members.cache.find(m => m.id === member.id));
|
||||
let globalMoney = 0;
|
||||
|
|
|
@ -12,24 +12,30 @@ class Pay extends BaseCommand {
|
|||
.setName("pay")
|
||||
.setDescription(client.translate("economy/pay:DESCRIPTION"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("economy/pay:DESCRIPTION", null, "uk-UA"),
|
||||
"ru": client.translate("economy/pay:DESCRIPTION", null, "ru-RU"),
|
||||
uk: client.translate("economy/pay:DESCRIPTION", null, "uk-UA"),
|
||||
ru: client.translate("economy/pay:DESCRIPTION", null, "ru-RU"),
|
||||
})
|
||||
.setDMPermission(false)
|
||||
.addUserOption(option => option.setName("user")
|
||||
.setDescription(client.translate("common:USER"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("common:USER", null, "uk-UA"),
|
||||
"ru": client.translate("common:USER", null, "ru-RU"),
|
||||
})
|
||||
.setRequired(true))
|
||||
.addIntegerOption(option => option.setName("amount")
|
||||
.setDescription(client.translate("common:INT"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("common:INT", null, "uk-UA"),
|
||||
"ru": client.translate("common:INT", null, "ru-RU"),
|
||||
})
|
||||
.setRequired(true)),
|
||||
.addUserOption(option =>
|
||||
option
|
||||
.setName("user")
|
||||
.setDescription(client.translate("common:USER"))
|
||||
.setDescriptionLocalizations({
|
||||
uk: client.translate("common:USER", null, "uk-UA"),
|
||||
ru: client.translate("common:USER", null, "ru-RU"),
|
||||
})
|
||||
.setRequired(true),
|
||||
)
|
||||
.addIntegerOption(option =>
|
||||
option
|
||||
.setName("amount")
|
||||
.setDescription(client.translate("common:INT"))
|
||||
.setDescriptionLocalizations({
|
||||
uk: client.translate("common:INT", null, "uk-UA"),
|
||||
ru: client.translate("common:INT", null, "ru-RU"),
|
||||
})
|
||||
.setRequired(true),
|
||||
),
|
||||
aliases: [],
|
||||
dirname: __dirname,
|
||||
ownerOnly: false,
|
||||
|
@ -55,9 +61,10 @@ class Pay extends BaseCommand {
|
|||
|
||||
const amount = interaction.options.getInteger("amount");
|
||||
if (amount <= 0) return interaction.error("misc:MORE_THAN_ZERO");
|
||||
if (amount > data.memberData.money) return interaction.error("economy/pay:ENOUGH_MONEY", {
|
||||
amount: `**${amount}** ${client.functions.getNoun(amount, interaction.translate("misc:NOUNS:CREDITS:1"), interaction.translate("misc:NOUNS:CREDITS:2"), interaction.translate("misc:NOUNS:CREDITS:5"))}`,
|
||||
});
|
||||
if (amount > data.memberData.money)
|
||||
return interaction.error("economy/pay:ENOUGH_MONEY", {
|
||||
amount: `**${amount}** ${client.functions.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,
|
||||
|
|
|
@ -12,16 +12,19 @@ class Profile extends BaseCommand {
|
|||
.setName("profile")
|
||||
.setDescription(client.translate("economy/profile:DESCRIPTION"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("economy/profile:DESCRIPTION", null, "uk-UA"),
|
||||
"ru": client.translate("economy/profile:DESCRIPTION", null, "ru-RU"),
|
||||
uk: client.translate("economy/profile:DESCRIPTION", null, "uk-UA"),
|
||||
ru: client.translate("economy/profile:DESCRIPTION", null, "ru-RU"),
|
||||
})
|
||||
.setDMPermission(false)
|
||||
.addUserOption(option => option.setName("user")
|
||||
.setDescription(client.translate("common:USER"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("common:USER", null, "uk-UA"),
|
||||
"ru": client.translate("common:USER", null, "ru-RU"),
|
||||
})),
|
||||
.addUserOption(option =>
|
||||
option
|
||||
.setName("user")
|
||||
.setDescription(client.translate("common:USER"))
|
||||
.setDescriptionLocalizations({
|
||||
uk: client.translate("common:USER", null, "uk-UA"),
|
||||
ru: client.translate("common:USER", null, "ru-RU"),
|
||||
}),
|
||||
),
|
||||
aliases: [],
|
||||
dirname: __dirname,
|
||||
ownerOnly: false,
|
||||
|
@ -46,14 +49,8 @@ class Profile extends BaseCommand {
|
|||
const member = interaction.options.getMember("user") || interaction.member;
|
||||
if (member.user.bot) return interaction.error("economy/profile:BOT_USER");
|
||||
|
||||
const memberData = (member.id === interaction.user.id ? data.memberData : await client.findOrCreateMember({
|
||||
id: member.id,
|
||||
guildId: interaction.guildId,
|
||||
}));
|
||||
|
||||
const userData = (member.id === interaction.user.id ? data.userData : await client.findOrCreateUser({
|
||||
id: member.id,
|
||||
}));
|
||||
const memberData = member.id === interaction.user.id ? data.memberData : await client.findOrCreateMember({ id: member.id, guildId: interaction.guildId });
|
||||
const userData = member.id === interaction.user.id ? data.userData : await client.findOrCreateUser({ id: member.id });
|
||||
if (userData.lover && !client.users.cache.find(u => u.id === userData.lover)) await client.users.fetch(userData.lover, true);
|
||||
|
||||
const guilds = client.guilds.cache.filter(g => g.members.cache.find(m => m.id === member.id));
|
||||
|
@ -107,7 +104,7 @@ class Profile extends BaseCommand {
|
|||
},
|
||||
{
|
||||
name: interaction.translate("economy/profile:LEVEL"),
|
||||
value:`**${memberData.level}**`,
|
||||
value: `**${memberData.level}**`,
|
||||
inline: true,
|
||||
},
|
||||
{
|
||||
|
@ -122,12 +119,12 @@ class Profile extends BaseCommand {
|
|||
},
|
||||
{
|
||||
name: interaction.translate("economy/profile:BIRTHDATE"),
|
||||
value: (!userData.birthdate ? interaction.translate("common:NOT_DEFINED") : client.functions.printDate(client, new Date(userData.birthdate))),
|
||||
value: !userData.birthdate ? interaction.translate("common:NOT_DEFINED") : client.functions.printDate(client, new Date(userData.birthdate)),
|
||||
inline: true,
|
||||
},
|
||||
{
|
||||
name: interaction.translate("economy/profile:LOVER"),
|
||||
value: (!userData.lover ? interaction.translate("common:NOT_DEFINED") : lover.getUsername()),
|
||||
value: !userData.lover ? interaction.translate("common:NOT_DEFINED") : lover.getUsername(),
|
||||
inline: true,
|
||||
},
|
||||
{
|
||||
|
@ -145,10 +142,12 @@ class Profile extends BaseCommand {
|
|||
|
||||
interaction.editReply({
|
||||
embeds: [profileEmbed],
|
||||
files: [{
|
||||
name: "achievements.png",
|
||||
attachment: buffer,
|
||||
}],
|
||||
files: [
|
||||
{
|
||||
name: "achievements.png",
|
||||
attachment: buffer,
|
||||
},
|
||||
],
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,17 +12,20 @@ class Rep extends BaseCommand {
|
|||
.setName("rep")
|
||||
.setDescription(client.translate("economy/rep:DESCRIPTION"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("economy/rep:DESCRIPTION", null, "uk-UA"),
|
||||
"ru": client.translate("economy/rep:DESCRIPTION", null, "ru-RU"),
|
||||
uk: client.translate("economy/rep:DESCRIPTION", null, "uk-UA"),
|
||||
ru: client.translate("economy/rep:DESCRIPTION", null, "ru-RU"),
|
||||
})
|
||||
.setDMPermission(false)
|
||||
.addUserOption(option => option.setName("user")
|
||||
.setDescription(client.translate("common:USER"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("common:USER", null, "uk-UA"),
|
||||
"ru": client.translate("common:USER", null, "ru-RU"),
|
||||
})
|
||||
.setRequired(true)),
|
||||
.addUserOption(option =>
|
||||
option
|
||||
.setName("user")
|
||||
.setDescription(client.translate("common:USER"))
|
||||
.setDescriptionLocalizations({
|
||||
uk: client.translate("common:USER", null, "uk-UA"),
|
||||
ru: client.translate("common:USER", null, "ru-RU"),
|
||||
})
|
||||
.setRequired(true),
|
||||
),
|
||||
aliases: [],
|
||||
dirname: __dirname,
|
||||
ownerOnly: false,
|
||||
|
@ -44,9 +47,10 @@ class Rep extends BaseCommand {
|
|||
async execute(client, interaction, data) {
|
||||
const isInCooldown = data.userData.cooldowns?.rep;
|
||||
if (isInCooldown) {
|
||||
if (isInCooldown > Date.now()) return interaction.error("economy/rep:COOLDOWN", {
|
||||
time: client.functions.convertTime(client, isInCooldown, true, true, data.guildData.language),
|
||||
});
|
||||
if (isInCooldown > Date.now())
|
||||
return interaction.error("economy/rep:COOLDOWN", {
|
||||
time: client.functions.convertTime(client, isInCooldown, true, true, data.guildData.language),
|
||||
});
|
||||
}
|
||||
|
||||
const user = interaction.options.getUser("user");
|
||||
|
@ -67,15 +71,17 @@ class Rep extends BaseCommand {
|
|||
userData.rep++;
|
||||
|
||||
if (!userData.achievements.rep.achieved) {
|
||||
userData.achievements.rep.progress.now = (userData.rep > userData.achievements.rep.progress.total ? userData.achievements.rep.progress.total : userData.rep);
|
||||
userData.achievements.rep.progress.now = userData.rep > userData.achievements.rep.progress.total ? userData.achievements.rep.progress.total : userData.rep;
|
||||
if (userData.achievements.rep.progress.now >= userData.achievements.rep.progress.total) {
|
||||
userData.achievements.rep.achieved = true;
|
||||
interaction.followUp({
|
||||
content: `${user}`,
|
||||
files: [{
|
||||
name: "achievement_unlocked6.png",
|
||||
attachment: "./assets/img/achievements/achievement_unlocked6.png",
|
||||
}],
|
||||
files: [
|
||||
{
|
||||
name: "achievement_unlocked6.png",
|
||||
attachment: "./assets/img/achievements/achievement_unlocked6.png",
|
||||
},
|
||||
],
|
||||
});
|
||||
}
|
||||
userData.markModified("achievements.rep");
|
||||
|
|
|
@ -12,24 +12,30 @@ class Rob extends BaseCommand {
|
|||
.setName("rob")
|
||||
.setDescription(client.translate("economy/rob:DESCRIPTION"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("economy/rob:DESCRIPTION", null, "uk-UA"),
|
||||
"ru": client.translate("economy/rob:DESCRIPTION", null, "ru-RU"),
|
||||
uk: client.translate("economy/rob:DESCRIPTION", null, "uk-UA"),
|
||||
ru: client.translate("economy/rob:DESCRIPTION", null, "ru-RU"),
|
||||
})
|
||||
.setDMPermission(false)
|
||||
.addUserOption(option => option.setName("user")
|
||||
.setDescription(client.translate("common:USER"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("common:USER", null, "uk-UA"),
|
||||
"ru": client.translate("common:USER", null, "ru-RU"),
|
||||
})
|
||||
.setRequired(true))
|
||||
.addIntegerOption(option => option.setName("amount")
|
||||
.setDescription(client.translate("common:INT"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("common:INT", null, "uk-UA"),
|
||||
"ru": client.translate("common:INT", null, "ru-RU"),
|
||||
})
|
||||
.setRequired(true)),
|
||||
.addUserOption(option =>
|
||||
option
|
||||
.setName("user")
|
||||
.setDescription(client.translate("common:USER"))
|
||||
.setDescriptionLocalizations({
|
||||
uk: client.translate("common:USER", null, "uk-UA"),
|
||||
ru: client.translate("common:USER", null, "ru-RU"),
|
||||
})
|
||||
.setRequired(true),
|
||||
)
|
||||
.addIntegerOption(option =>
|
||||
option
|
||||
.setName("amount")
|
||||
.setDescription(client.translate("common:INT"))
|
||||
.setDescriptionLocalizations({
|
||||
uk: client.translate("common:INT", null, "uk-UA"),
|
||||
ru: client.translate("common:INT", null, "ru-RU"),
|
||||
})
|
||||
.setRequired(true),
|
||||
),
|
||||
aliases: [],
|
||||
dirname: __dirname,
|
||||
ownerOnly: false,
|
||||
|
@ -68,15 +74,16 @@ 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.functions.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.functions.getNoun(data.memberData.money, interaction.translate("misc:NOUNS:CREDIT:1"), interaction.translate("misc:NOUNS:CREDIT:2"), interaction.translate("misc:NOUNS:CREDIT:5"))}`,
|
||||
});
|
||||
if (potentiallyLose > data.memberData.money)
|
||||
return interaction.error("economy/rob:NOT_ENOUGH_AUTHOR", {
|
||||
moneyMin: `**${potentiallyLose}** ${client.functions.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.functions.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);
|
||||
|
||||
if (itsAWon) {
|
||||
const toWait = Date.now() + (6 * 60 * 60 * 1000),
|
||||
const toWait = Date.now() + 6 * 60 * 60 * 1000,
|
||||
randomNum = client.functions.randomNum(1, 2);
|
||||
|
||||
memberData.cooldowns.rob = toWait;
|
||||
|
|
|
@ -12,17 +12,20 @@ class Setbio extends BaseCommand {
|
|||
.setName("setbio")
|
||||
.setDescription(client.translate("economy/setbio:DESCRIPTION"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("economy/setbio:DESCRIPTION", null, "uk-UA"),
|
||||
"ru": client.translate("economy/setbio:DESCRIPTION", null, "ru-RU"),
|
||||
uk: client.translate("economy/setbio:DESCRIPTION", null, "uk-UA"),
|
||||
ru: client.translate("economy/setbio:DESCRIPTION", null, "ru-RU"),
|
||||
})
|
||||
.setDMPermission(true)
|
||||
.addStringOption(option => option.setName("text")
|
||||
.setDescription(client.translate("economy/profile:BIO"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("economy/profile:BIO", null, "uk-UA"),
|
||||
"ru": client.translate("economy/profile:BIO", null, "ru-RU"),
|
||||
})
|
||||
.setRequired(true)),
|
||||
.addStringOption(option =>
|
||||
option
|
||||
.setName("text")
|
||||
.setDescription(client.translate("economy/profile:BIO"))
|
||||
.setDescriptionLocalizations({
|
||||
uk: client.translate("economy/profile:BIO", null, "uk-UA"),
|
||||
ru: client.translate("economy/profile:BIO", null, "ru-RU"),
|
||||
})
|
||||
.setRequired(true),
|
||||
),
|
||||
aliases: [],
|
||||
dirname: __dirname,
|
||||
ownerOnly: false,
|
||||
|
|
|
@ -12,17 +12,20 @@ class Slots extends BaseCommand {
|
|||
.setName("slots")
|
||||
.setDescription(client.translate("economy/slots:DESCRIPTION"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("economy/slots:DESCRIPTION", null, "uk-UA"),
|
||||
"ru": client.translate("economy/slots:DESCRIPTION", null, "ru-RU"),
|
||||
uk: client.translate("economy/slots:DESCRIPTION", null, "uk-UA"),
|
||||
ru: client.translate("economy/slots:DESCRIPTION", null, "ru-RU"),
|
||||
})
|
||||
.setDMPermission(false)
|
||||
.addIntegerOption(option => option.setName("amount")
|
||||
.setDescription(client.translate("common:INT"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("common:INT", null, "uk-UA"),
|
||||
"ru": client.translate("common:INT", null, "ru-RU"),
|
||||
})
|
||||
.setRequired(true)),
|
||||
.addIntegerOption(option =>
|
||||
option
|
||||
.setName("amount")
|
||||
.setDescription(client.translate("common:INT"))
|
||||
.setDescriptionLocalizations({
|
||||
uk: client.translate("common:INT", null, "uk-UA"),
|
||||
ru: client.translate("common:INT", null, "ru-RU"),
|
||||
})
|
||||
.setRequired(true),
|
||||
),
|
||||
aliases: [],
|
||||
dirname: __dirname,
|
||||
ownerOnly: false,
|
||||
|
@ -45,19 +48,24 @@ class Slots extends BaseCommand {
|
|||
await interaction.deferReply();
|
||||
|
||||
const amount = interaction.options.getInteger("amount");
|
||||
if (amount > data.memberData.money) return interaction.error("economy/slots:NOT_ENOUGH", { money: `**${amount}** ${client.functions.getNoun(amount, interaction.translate("misc:NOUNS:CREDIT:1"), interaction.translate("misc:NOUNS:CREDIT:2"), interaction.translate("misc:NOUNS:CREDIT:5"))}` }, { edit: true });
|
||||
if (amount > data.memberData.money)
|
||||
return interaction.error("economy/slots:NOT_ENOUGH", {
|
||||
money: `**${amount}** ${client.functions.getNoun(amount, interaction.translate("misc:NOUNS:CREDIT:1"), interaction.translate("misc:NOUNS:CREDIT:2"), interaction.translate("misc:NOUNS:CREDIT:5"))}`,
|
||||
}, { edit: true });
|
||||
|
||||
const fruits = ["🍎", "🍐", "🍌", "🍇", "🍉", "🍒", "🍓"];
|
||||
|
||||
let i1 = 0, j1 = 0, k1 = 0,
|
||||
i2 = 1, j2 = 1, k2 = 1,
|
||||
i3 = 2, j3 = 2, k3 = 2;
|
||||
let i1 = 0,
|
||||
j1 = 0,
|
||||
k1 = 0,
|
||||
i2 = 1,
|
||||
j2 = 1,
|
||||
k2 = 1,
|
||||
i3 = 2,
|
||||
j3 = 2,
|
||||
k3 = 2;
|
||||
|
||||
const colonnes = [
|
||||
client.functions.shuffle(fruits),
|
||||
client.functions.shuffle(fruits),
|
||||
client.functions.shuffle(fruits),
|
||||
];
|
||||
const colonnes = [client.functions.shuffle(fruits), client.functions.shuffle(fruits), client.functions.shuffle(fruits)];
|
||||
|
||||
function getCredits(number, isJackpot) {
|
||||
if (!isJackpot) number = number * 1.5;
|
||||
|
@ -78,33 +86,35 @@ class Slots extends BaseCommand {
|
|||
async function end() {
|
||||
let msg = "[ :slot_machine: | **СЛОТЫ** ]\n------------------\n";
|
||||
|
||||
i1 = (i1 < fruits.length - 1) ? i1 + 1 : 0;
|
||||
i2 = (i2 < fruits.length - 1) ? i2 + 1 : 0;
|
||||
i3 = (i3 < fruits.length - 1) ? i3 + 1 : 0;
|
||||
j1 = (j1 < fruits.length - 1) ? j1 + 1 : 0;
|
||||
j2 = (j2 < fruits.length - 1) ? j2 + 1 : 0;
|
||||
j3 = (j3 < fruits.length - 1) ? j3 + 1 : 0;
|
||||
k1 = (k1 < fruits.length - 1) ? k1 + 1 : 0;
|
||||
k2 = (k2 < fruits.length - 1) ? k2 + 1 : 0;
|
||||
k3 = (k3 < fruits.length - 1) ? k3 + 1 : 0;
|
||||
i1 = i1 < fruits.length - 1 ? i1 + 1 : 0;
|
||||
i2 = i2 < fruits.length - 1 ? i2 + 1 : 0;
|
||||
i3 = i3 < fruits.length - 1 ? i3 + 1 : 0;
|
||||
j1 = j1 < fruits.length - 1 ? j1 + 1 : 0;
|
||||
j2 = j2 < fruits.length - 1 ? j2 + 1 : 0;
|
||||
j3 = j3 < fruits.length - 1 ? j3 + 1 : 0;
|
||||
k1 = k1 < fruits.length - 1 ? k1 + 1 : 0;
|
||||
k2 = k2 < fruits.length - 1 ? k2 + 1 : 0;
|
||||
k3 = k3 < fruits.length - 1 ? k3 + 1 : 0;
|
||||
|
||||
msg += colonnes[0][i1] + " : " + colonnes[1][j1] + " : " + colonnes[2][k1] + "\n";
|
||||
msg += colonnes[0][i2] + " : " + colonnes[1][j2] + " : " + colonnes[2][k2] + " **<**\n";
|
||||
msg += colonnes[0][i3] + " : " + colonnes[1][j3] + " : " + colonnes[2][k3] + "\n------------------\n";
|
||||
|
||||
if ((colonnes[0][i2] == colonnes[1][j2]) && (colonnes[1][j2] == colonnes[2][k2])) {
|
||||
msg += "| : : : **" + (interaction.translate("common:VICTORY").toUpperCase()) + "** : : : |";
|
||||
if (colonnes[0][i2] == colonnes[1][j2] && colonnes[1][j2] == colonnes[2][k2]) {
|
||||
msg += "| : : : **" + interaction.translate("common:VICTORY").toUpperCase() + "** : : : |";
|
||||
await interaction.editReply({
|
||||
content: msg,
|
||||
});
|
||||
|
||||
const credits = getCredits(amount, true);
|
||||
interaction.followUp({
|
||||
content: "**!! ДЖЕКПОТ !!**\n" + interaction.translate("economy/slots:VICTORY", {
|
||||
money: `**${amount}** ${client.functions.getNoun(amount, interaction.translate("misc:NOUNS:CREDIT:1"), interaction.translate("misc:NOUNS:CREDIT:2"), interaction.translate("misc:NOUNS:CREDIT:5"))}`,
|
||||
won: `**${credits}** ${client.functions.getNoun(credits, interaction.translate("misc:NOUNS:CREDIT:1"), interaction.translate("misc:NOUNS:CREDIT:2"), interaction.translate("misc:NOUNS:CREDIT:5"))}`,
|
||||
user: interaction.member.toString(),
|
||||
}),
|
||||
content:
|
||||
"**!! ДЖЕКПОТ !!**\n" +
|
||||
interaction.translate("economy/slots:VICTORY", {
|
||||
money: `**${amount}** ${client.functions.getNoun(amount, interaction.translate("misc:NOUNS:CREDIT:1"), interaction.translate("misc:NOUNS:CREDIT:2"), interaction.translate("misc:NOUNS:CREDIT:5"))}`,
|
||||
won: `**${credits}** ${client.functions.getNoun(credits, interaction.translate("misc:NOUNS:CREDIT:1"), interaction.translate("misc:NOUNS:CREDIT:2"), interaction.translate("misc:NOUNS:CREDIT:5"))}`,
|
||||
user: interaction.member.toString(),
|
||||
}),
|
||||
});
|
||||
|
||||
const toAdd = credits - amount;
|
||||
|
@ -127,10 +137,12 @@ class Slots extends BaseCommand {
|
|||
if (data.userData.achievements.slots.progress.now === data.userData.achievements.slots.progress.total) {
|
||||
data.userData.achievements.slots.achieved = true;
|
||||
interaction.followUp({
|
||||
files: [{
|
||||
name: "achievement_unlocked4.png",
|
||||
attachment: "./assets/img/achievements/achievement_unlocked4.png",
|
||||
}],
|
||||
files: [
|
||||
{
|
||||
name: "achievement_unlocked4.png",
|
||||
attachment: "./assets/img/achievements/achievement_unlocked4.png",
|
||||
},
|
||||
],
|
||||
});
|
||||
}
|
||||
data.userData.markModified("achievements.slots");
|
||||
|
@ -142,7 +154,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()) + "** : : : |";
|
||||
msg += "| : : : **" + interaction.translate("common:VICTORY").toUpperCase() + "** : : : |";
|
||||
await interaction.editReply({
|
||||
content: msg,
|
||||
});
|
||||
|
@ -175,10 +187,12 @@ class Slots extends BaseCommand {
|
|||
if (data.userData.achievements.slots.progress.now === data.userData.achievements.slots.progress.total) {
|
||||
data.userData.achievements.slots.achieved = true;
|
||||
interaction.followUp({
|
||||
files: [{
|
||||
name: "achievement_unlocked4.png",
|
||||
attachment: "./assets/img/achievements/achievement_unlocked4.png",
|
||||
}],
|
||||
files: [
|
||||
{
|
||||
name: "achievement_unlocked4.png",
|
||||
attachment: "./assets/img/achievements/achievement_unlocked4.png",
|
||||
},
|
||||
],
|
||||
});
|
||||
}
|
||||
data.userData.markModified("achievements.slots");
|
||||
|
@ -188,7 +202,7 @@ class Slots extends BaseCommand {
|
|||
return;
|
||||
}
|
||||
|
||||
msg += "| : : : **" + (interaction.translate("common:DEFEAT").toUpperCase()) + "** : : : |";
|
||||
msg += "| : : : **" + interaction.translate("common:DEFEAT").toUpperCase() + "** : : : |";
|
||||
interaction.followUp({
|
||||
content: interaction.translate("economy/slots:DEFEAT", {
|
||||
money: `**${amount}** ${client.functions.getNoun(amount, interaction.translate("misc:NOUNS:CREDIT:1"), interaction.translate("misc:NOUNS:CREDIT:2"), interaction.translate("misc:NOUNS:CREDIT:5"))}`,
|
||||
|
@ -221,15 +235,15 @@ class Slots extends BaseCommand {
|
|||
async function editMsg() {
|
||||
let msg = "[ :slot_machine: | **СЛОТЫ** ]\n------------------\n";
|
||||
|
||||
i1 = (i1 < fruits.length - 1) ? i1 + 1 : 0;
|
||||
i2 = (i2 < fruits.length - 1) ? i2 + 1 : 0;
|
||||
i3 = (i3 < fruits.length - 1) ? i3 + 1 : 0;
|
||||
j1 = (j1 < fruits.length - 1) ? j1 + 1 : 0;
|
||||
j2 = (j2 < fruits.length - 1) ? j2 + 1 : 0;
|
||||
j3 = (j3 < fruits.length - 1) ? j3 + 1 : 0;
|
||||
k1 = (k1 < fruits.length - 1) ? k1 + 1 : 0;
|
||||
k2 = (k2 < fruits.length - 1) ? k2 + 1 : 0;
|
||||
k3 = (k3 < fruits.length - 1) ? k3 + 1 : 0;
|
||||
i1 = i1 < fruits.length - 1 ? i1 + 1 : 0;
|
||||
i2 = i2 < fruits.length - 1 ? i2 + 1 : 0;
|
||||
i3 = i3 < fruits.length - 1 ? i3 + 1 : 0;
|
||||
j1 = j1 < fruits.length - 1 ? j1 + 1 : 0;
|
||||
j2 = j2 < fruits.length - 1 ? j2 + 1 : 0;
|
||||
j3 = j3 < fruits.length - 1 ? j3 + 1 : 0;
|
||||
k1 = k1 < fruits.length - 1 ? k1 + 1 : 0;
|
||||
k2 = k2 < fruits.length - 1 ? k2 + 1 : 0;
|
||||
k3 = k3 < fruits.length - 1 ? k3 + 1 : 0;
|
||||
|
||||
msg += colonnes[0][i1] + " : " + colonnes[1][j1] + " : " + colonnes[2][k1] + "\n";
|
||||
msg += colonnes[0][i2] + " : " + colonnes[1][j2] + " : " + colonnes[2][k2] + " **<**\n";
|
||||
|
|
|
@ -12,16 +12,19 @@ class Transactions extends BaseCommand {
|
|||
.setName("transactions")
|
||||
.setDescription(client.translate("economy/transactions:DESCRIPTION"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("economy/transactions:DESCRIPTION", null, "uk-UA"),
|
||||
"ru": client.translate("economy/transactions:DESCRIPTION", null, "ru-RU"),
|
||||
uk: client.translate("economy/transactions:DESCRIPTION", null, "uk-UA"),
|
||||
ru: client.translate("economy/transactions:DESCRIPTION", null, "ru-RU"),
|
||||
})
|
||||
.setDMPermission(false)
|
||||
.addBooleanOption(option => option.setName("clear")
|
||||
.setDescription(client.translate("economy/transactions:CLEAR"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("economy/transactions:CLEAR", null, "uk-UA"),
|
||||
"ru": client.translate("economy/transactions:CLEAR", null, "ru-RU"),
|
||||
})),
|
||||
.addBooleanOption(option =>
|
||||
option
|
||||
.setName("clear")
|
||||
.setDescription(client.translate("economy/transactions:CLEAR"))
|
||||
.setDescriptionLocalizations({
|
||||
uk: client.translate("economy/transactions:CLEAR", null, "uk-UA"),
|
||||
ru: client.translate("economy/transactions:CLEAR", null, "ru-RU"),
|
||||
}),
|
||||
),
|
||||
aliases: [],
|
||||
dirname: __dirname,
|
||||
ownerOnly: false,
|
||||
|
@ -60,30 +63,36 @@ class Transactions extends BaseCommand {
|
|||
});
|
||||
|
||||
const transactions = data.memberData.transactions,
|
||||
sortedTransactions = [ [], [] ];
|
||||
sortedTransactions = [[], []];
|
||||
|
||||
transactions.slice(-20).forEach(t => {
|
||||
const array = t.type === "got" ? sortedTransactions[0] : sortedTransactions[1];
|
||||
array.push(`${interaction.translate("economy/transactions:T_USER_" + t.type.toUpperCase())}: ${t.user}\n${interaction.translate("economy/transactions:T_AMOUNT")}: ${t.amount}\n${interaction.translate("economy/transactions:T_DATE")}: ${client.functions.printDate(client, t.date, "Do MMMM YYYY, HH:mm", data.guildData.language)}\n`);
|
||||
array.push(
|
||||
`${interaction.translate("economy/transactions:T_USER_" + t.type.toUpperCase())}: ${t.user}\n${interaction.translate("economy/transactions:T_AMOUNT")}: ${t.amount}\n${interaction.translate(
|
||||
"economy/transactions:T_DATE",
|
||||
)}: ${client.functions.printDate(client, t.date, "Do MMMM YYYY, HH:mm", data.guildData.language)}\n`,
|
||||
);
|
||||
});
|
||||
|
||||
if (transactions.length < 1) {
|
||||
embed.setDescription(interaction.translate("economy/transactions:NO_TRANSACTIONS"));
|
||||
} else {
|
||||
if (sortedTransactions[0].length > 0) embed.addFields([
|
||||
{
|
||||
name: interaction.translate("economy/transactions:T_GOT"),
|
||||
value: sortedTransactions[0].join("\n"),
|
||||
inline: true,
|
||||
},
|
||||
]);
|
||||
if (sortedTransactions[1].length > 0) embed.addFields([
|
||||
{
|
||||
name: interaction.translate("economy/transactions:T_SEND"),
|
||||
value: sortedTransactions[1].join("\n"),
|
||||
inline: true,
|
||||
},
|
||||
]);
|
||||
if (sortedTransactions[0].length > 0)
|
||||
embed.addFields([
|
||||
{
|
||||
name: interaction.translate("economy/transactions:T_GOT"),
|
||||
value: sortedTransactions[0].join("\n"),
|
||||
inline: true,
|
||||
},
|
||||
]);
|
||||
if (sortedTransactions[1].length > 0)
|
||||
embed.addFields([
|
||||
{
|
||||
name: interaction.translate("economy/transactions:T_SEND"),
|
||||
value: sortedTransactions[1].join("\n"),
|
||||
inline: true,
|
||||
},
|
||||
]);
|
||||
}
|
||||
|
||||
interaction.reply({
|
||||
|
|
|
@ -12,8 +12,8 @@ class Work extends BaseCommand {
|
|||
.setName("work")
|
||||
.setDescription(client.translate("economy/work:DESCRIPTION"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("economy/work:DESCRIPTION", null, "uk-UA"),
|
||||
"ru": client.translate("economy/work:DESCRIPTION", null, "ru-RU"),
|
||||
uk: client.translate("economy/work:DESCRIPTION", null, "uk-UA"),
|
||||
ru: client.translate("economy/work:DESCRIPTION", null, "ru-RU"),
|
||||
})
|
||||
.setDMPermission(false),
|
||||
aliases: [],
|
||||
|
@ -37,13 +37,14 @@ class Work extends BaseCommand {
|
|||
async execute(client, interaction, data) {
|
||||
const isInCooldown = data.memberData.cooldowns?.work;
|
||||
if (isInCooldown) {
|
||||
if (isInCooldown > Date.now()) return interaction.error("economy/work:COOLDOWN", {
|
||||
time: client.functions.convertTime(client, isInCooldown, true, true, data.guildData.language),
|
||||
});
|
||||
if (isInCooldown > Date.now())
|
||||
return interaction.error("economy/work:COOLDOWN", {
|
||||
time: client.functions.convertTime(client, isInCooldown, true, true, data.guildData.language),
|
||||
});
|
||||
}
|
||||
if (Date.now() > data.memberData.cooldowns.work + (24 * 60 * 60 * 1000)) data.memberData.workStreak = 0;
|
||||
if (Date.now() > data.memberData.cooldowns.work + 24 * 60 * 60 * 1000) data.memberData.workStreak = 0;
|
||||
|
||||
const toWait = Date.now() + (24 * 60 * 60 * 1000); // 24 hours
|
||||
const toWait = Date.now() + 24 * 60 * 60 * 1000; // 24 hours
|
||||
data.memberData.cooldowns.work = toWait;
|
||||
data.memberData.markModified("cooldowns");
|
||||
|
||||
|
@ -57,13 +58,7 @@ class Work extends BaseCommand {
|
|||
})
|
||||
.setColor(client.config.embed.color);
|
||||
|
||||
const award = [
|
||||
client.customEmojis.letters.a,
|
||||
client.customEmojis.letters.w,
|
||||
client.customEmojis.letters.a,
|
||||
client.customEmojis.letters.r,
|
||||
client.customEmojis.letters.d,
|
||||
];
|
||||
const award = [client.customEmojis.letters.a, client.customEmojis.letters.w, client.customEmojis.letters.a, client.customEmojis.letters.r, client.customEmojis.letters.d];
|
||||
let won = 200;
|
||||
|
||||
if (data.memberData.workStreak >= 5) {
|
||||
|
@ -117,13 +112,16 @@ class Work extends BaseCommand {
|
|||
const messageOptions = {
|
||||
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",
|
||||
}];
|
||||
messageOptions.files = [
|
||||
{
|
||||
name: "unlocked.png",
|
||||
attachment: "./assets/img/achievements/achievement_unlocked1.png",
|
||||
},
|
||||
];
|
||||
data.userData.achievements.work.achieved = true;
|
||||
}
|
||||
data.userData.markModified("achievements.work");
|
||||
|
|
|
@ -12,17 +12,20 @@ class Eightball extends BaseCommand {
|
|||
.setName("8ball")
|
||||
.setDescription(client.translate("fun/8ball:DESCRIPTION"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("fun/8ball:DESCRIPTION", null, "uk-UA"),
|
||||
"ru": client.translate("fun/8ball:DESCRIPTION", null, "ru-RU"),
|
||||
uk: client.translate("fun/8ball:DESCRIPTION", null, "uk-UA"),
|
||||
ru: client.translate("fun/8ball:DESCRIPTION", null, "ru-RU"),
|
||||
})
|
||||
.setDMPermission(true)
|
||||
.addStringOption(option => option.setName("question")
|
||||
.setDescription(client.translate("fun/8ball:QUESTION"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("fun/8ball:QUESTION", null, "uk-UA"),
|
||||
"ru": client.translate("fun/8ball:QUESTION", null, "ru-RU"),
|
||||
})
|
||||
.setRequired(true)),
|
||||
.addStringOption(option =>
|
||||
option
|
||||
.setName("question")
|
||||
.setDescription(client.translate("fun/8ball:QUESTION"))
|
||||
.setDescriptionLocalizations({
|
||||
uk: client.translate("fun/8ball:QUESTION", null, "uk-UA"),
|
||||
ru: client.translate("fun/8ball:QUESTION", null, "ru-RU"),
|
||||
})
|
||||
.setRequired(true),
|
||||
),
|
||||
aliases: [],
|
||||
dirname: __dirname,
|
||||
ownerOnly: false,
|
||||
|
|
|
@ -13,8 +13,8 @@ class Cat extends BaseCommand {
|
|||
.setName("cat")
|
||||
.setDescription(client.translate("fun/cat:DESCRIPTION"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("fun/cat:DESCRIPTION", null, "uk-UA"),
|
||||
"ru": client.translate("fun/cat:DESCRIPTION", null, "ru-RU"),
|
||||
uk: client.translate("fun/cat:DESCRIPTION", null, "uk-UA"),
|
||||
ru: client.translate("fun/cat:DESCRIPTION", null, "ru-RU"),
|
||||
})
|
||||
.setDMPermission(true),
|
||||
aliases: [],
|
||||
|
|
|
@ -13,8 +13,8 @@ class Crab extends BaseCommand {
|
|||
.setName("crab")
|
||||
.setDescription(client.translate("fun/crab:DESCRIPTION"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("fun/crab:DESCRIPTION", null, "uk-UA"),
|
||||
"ru": client.translate("fun/crab:DESCRIPTION", null, "ru-RU"),
|
||||
uk: client.translate("fun/crab:DESCRIPTION", null, "uk-UA"),
|
||||
ru: client.translate("fun/crab:DESCRIPTION", null, "ru-RU"),
|
||||
})
|
||||
.setDMPermission(true),
|
||||
aliases: [],
|
||||
|
|
|
@ -13,8 +13,8 @@ class Dog extends BaseCommand {
|
|||
.setName("dog")
|
||||
.setDescription(client.translate("fun/dog:DESCRIPTION"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("fun/dog:DESCRIPTION", null, "uk-UA"),
|
||||
"ru": client.translate("fun/dog:DESCRIPTION", null, "ru-RU"),
|
||||
uk: client.translate("fun/dog:DESCRIPTION", null, "uk-UA"),
|
||||
ru: client.translate("fun/dog:DESCRIPTION", null, "ru-RU"),
|
||||
})
|
||||
.setDMPermission(true),
|
||||
aliases: [],
|
||||
|
|
|
@ -13,24 +13,30 @@ class LMGTFY extends BaseCommand {
|
|||
.setName("lmgtfy")
|
||||
.setDescription(client.translate("fun/lmgtfy:DESCRIPTION"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("fun/lmgtfy:DESCRIPTION", null, "uk-UA"),
|
||||
"ru": client.translate("fun/lmgtfy:DESCRIPTION", null, "ru-RU"),
|
||||
uk: client.translate("fun/lmgtfy:DESCRIPTION", null, "uk-UA"),
|
||||
ru: client.translate("fun/lmgtfy:DESCRIPTION", null, "ru-RU"),
|
||||
})
|
||||
.setDMPermission(true)
|
||||
.addStringOption(option => option.setName("query")
|
||||
.setDescription(client.translate("fun/lmgtfy:QUERY"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("fun/lmgtfy:QUERY", null, "uk-UA"),
|
||||
"ru": client.translate("fun/lmgtfy:QUERY", null, "ru-RU"),
|
||||
})
|
||||
.setRequired(true))
|
||||
.addBooleanOption(option => option.setName("short")
|
||||
.setDescription(client.translate("fun/lmgtfy:SHORT"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("fun/lmgtfy:SHORT", null, "uk-UA"),
|
||||
"ru": client.translate("fun/lmgtfy:SHORT", null, "ru-RU"),
|
||||
})
|
||||
.setRequired(true)),
|
||||
.addStringOption(option =>
|
||||
option
|
||||
.setName("query")
|
||||
.setDescription(client.translate("fun/lmgtfy:QUERY"))
|
||||
.setDescriptionLocalizations({
|
||||
uk: client.translate("fun/lmgtfy:QUERY", null, "uk-UA"),
|
||||
ru: client.translate("fun/lmgtfy:QUERY", null, "ru-RU"),
|
||||
})
|
||||
.setRequired(true),
|
||||
)
|
||||
.addBooleanOption(option =>
|
||||
option
|
||||
.setName("short")
|
||||
.setDescription(client.translate("fun/lmgtfy:SHORT"))
|
||||
.setDescriptionLocalizations({
|
||||
uk: client.translate("fun/lmgtfy:SHORT", null, "uk-UA"),
|
||||
ru: client.translate("fun/lmgtfy:SHORT", null, "ru-RU"),
|
||||
})
|
||||
.setRequired(true),
|
||||
),
|
||||
aliases: [],
|
||||
dirname: __dirname,
|
||||
ownerOnly: false,
|
||||
|
|
|
@ -13,25 +13,29 @@ class Lovecalc extends BaseCommand {
|
|||
.setName("lovecalc")
|
||||
.setDescription(client.translate("fun/lovecalc:DESCRIPTION"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("fun/lovecalc:DESCRIPTION", null, "uk-UA"),
|
||||
"ru": client.translate("fun/lovecalc:DESCRIPTION", null, "ru-RU"),
|
||||
uk: client.translate("fun/lovecalc:DESCRIPTION", null, "uk-UA"),
|
||||
ru: client.translate("fun/lovecalc:DESCRIPTION", null, "ru-RU"),
|
||||
})
|
||||
.setDMPermission(false)
|
||||
.addUserOption(option =>
|
||||
option.setName("first_member")
|
||||
option
|
||||
.setName("first_member")
|
||||
.setDescription(client.translate("common:USER"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("common:USER", null, "uk-UA"),
|
||||
"ru": client.translate("common:USER", null, "ru-RU"),
|
||||
uk: client.translate("common:USER", null, "uk-UA"),
|
||||
ru: client.translate("common:USER", null, "ru-RU"),
|
||||
})
|
||||
.setRequired(true))
|
||||
.setRequired(true),
|
||||
)
|
||||
.addUserOption(option =>
|
||||
option.setName("second_member")
|
||||
option
|
||||
.setName("second_member")
|
||||
.setDescription(client.translate("common:USER"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("common:USER", null, "uk-UA"),
|
||||
"ru": client.translate("common:USER", null, "ru-RU"),
|
||||
})),
|
||||
uk: client.translate("common:USER", null, "uk-UA"),
|
||||
ru: client.translate("common:USER", null, "ru-RU"),
|
||||
}),
|
||||
),
|
||||
aliases: [],
|
||||
dirname: __dirname,
|
||||
ownerOnly: false,
|
||||
|
@ -67,11 +71,13 @@ class Lovecalc extends BaseCommand {
|
|||
.setAuthor({
|
||||
name: `❤️ ${interaction.translate("fun/lovecalc:DESCRIPTION")}`,
|
||||
})
|
||||
.setDescription(interaction.translate("fun/lovecalc:CONTENT", {
|
||||
percent,
|
||||
firstMember: firstMember.user.toString(),
|
||||
secondMember: secondMember.user.toString(),
|
||||
}))
|
||||
.setDescription(
|
||||
interaction.translate("fun/lovecalc:CONTENT", {
|
||||
percent,
|
||||
firstMember: firstMember.user.toString(),
|
||||
secondMember: secondMember.user.toString(),
|
||||
}),
|
||||
)
|
||||
.setColor(client.config.embed.color)
|
||||
.setFooter({
|
||||
text: client.config.embed.footer,
|
||||
|
|
|
@ -13,8 +13,8 @@ class Number extends BaseCommand {
|
|||
.setName("number")
|
||||
.setDescription(client.translate("fun/number:DESCRIPTION"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("fun/number:DESCRIPTION", null, "uk-UA"),
|
||||
"ru": client.translate("fun/number:DESCRIPTION", null, "ru-RU"),
|
||||
uk: client.translate("fun/number:DESCRIPTION", null, "uk-UA"),
|
||||
ru: client.translate("fun/number:DESCRIPTION", null, "ru-RU"),
|
||||
})
|
||||
.setDMPermission(false),
|
||||
aliases: [],
|
||||
|
@ -48,7 +48,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;
|
||||
|
||||
|
@ -102,12 +102,14 @@ class Number extends BaseCommand {
|
|||
collector.stop();
|
||||
}
|
||||
|
||||
if (parseInt(msg.content) < number) msg.reply({
|
||||
content: interaction.translate("fun/number:TOO_BIG", { user: msg.author.toString(), number: parsedNumber }),
|
||||
});
|
||||
if (parseInt(msg.content) > number) msg.reply({
|
||||
content: interaction.translate("fun/number:TOO_SMALL", { user: msg.author.toString(), number: parsedNumber }),
|
||||
});
|
||||
if (parseInt(msg.content) < number)
|
||||
msg.reply({
|
||||
content: interaction.translate("fun/number:TOO_BIG", { user: msg.author.toString(), number: parsedNumber }),
|
||||
});
|
||||
if (parseInt(msg.content) > number)
|
||||
msg.reply({
|
||||
content: interaction.translate("fun/number:TOO_SMALL", { user: msg.author.toString(), number: parsedNumber }),
|
||||
});
|
||||
});
|
||||
|
||||
collector.on("end", (_, reason) => {
|
||||
|
|
|
@ -13,17 +13,20 @@ class TicTacToe extends BaseCommand {
|
|||
.setName("tictactoe")
|
||||
.setDescription(client.translate("fun/tictactoe:DESCRIPTION"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("fun/tictactoe:DESCRIPTION", null, "uk-UA"),
|
||||
"ru": client.translate("fun/tictactoe:DESCRIPTION", null, "ru-RU"),
|
||||
uk: client.translate("fun/tictactoe:DESCRIPTION", null, "uk-UA"),
|
||||
ru: client.translate("fun/tictactoe:DESCRIPTION", null, "ru-RU"),
|
||||
})
|
||||
.setDMPermission(false)
|
||||
.addUserOption(option => option.setName("user")
|
||||
.setDescription(client.translate("common:USER"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("common:USER", null, "uk-UA"),
|
||||
"ru": client.translate("common:USER", null, "ru-RU"),
|
||||
})
|
||||
.setRequired(true)),
|
||||
.addUserOption(option =>
|
||||
option
|
||||
.setName("user")
|
||||
.setDescription(client.translate("common:USER"))
|
||||
.setDescriptionLocalizations({
|
||||
uk: client.translate("common:USER", null, "uk-UA"),
|
||||
ru: client.translate("common:USER", null, "ru-RU"),
|
||||
})
|
||||
.setRequired(true),
|
||||
),
|
||||
aliases: [],
|
||||
dirname: __dirname,
|
||||
ownerOnly: false,
|
||||
|
|
|
@ -12,17 +12,20 @@ class Afk extends BaseCommand {
|
|||
.setName("afk")
|
||||
.setDescription(client.translate("general/afk:DESCRIPTION"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("general/afk:DESCRIPTION", null, "uk-UA"),
|
||||
"ru": client.translate("general/afk:DESCRIPTION", null, "ru-RU"),
|
||||
uk: client.translate("general/afk:DESCRIPTION", null, "uk-UA"),
|
||||
ru: client.translate("general/afk:DESCRIPTION", null, "ru-RU"),
|
||||
})
|
||||
.setDMPermission(true)
|
||||
.addStringOption(option => option.setName("message")
|
||||
.setDescription(client.translate("common:MESSAGE"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("common:MESSAGE", null, "uk-UA"),
|
||||
"ru": client.translate("common:MESSAGE", null, "ru-RU"),
|
||||
})
|
||||
.setRequired(true)),
|
||||
.addStringOption(option =>
|
||||
option
|
||||
.setName("message")
|
||||
.setDescription(client.translate("common:MESSAGE"))
|
||||
.setDescriptionLocalizations({
|
||||
uk: client.translate("common:MESSAGE", null, "uk-UA"),
|
||||
ru: client.translate("common:MESSAGE", null, "ru-RU"),
|
||||
})
|
||||
.setRequired(true),
|
||||
),
|
||||
aliases: [],
|
||||
dirname: __dirname,
|
||||
ownerOnly: false,
|
||||
|
|
|
@ -12,22 +12,28 @@ class Avatar extends BaseCommand {
|
|||
.setName("avatar")
|
||||
.setDescription(client.translate("general/avatar:DESCRIPTION"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("general/avatar:DESCRIPTION", null, "uk-UA"),
|
||||
"ru": client.translate("general/avatar:DESCRIPTION", null, "ru-RU"),
|
||||
uk: client.translate("general/avatar:DESCRIPTION", null, "uk-UA"),
|
||||
ru: client.translate("general/avatar:DESCRIPTION", null, "ru-RU"),
|
||||
})
|
||||
.setDMPermission(true)
|
||||
.addUserOption(option => option.setName("user")
|
||||
.setDescription(client.translate("common:USER"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("common:USER", null, "uk-UA"),
|
||||
"ru": client.translate("common:USER", null, "ru-RU"),
|
||||
}))
|
||||
.addBooleanOption(option => option.setName("server")
|
||||
.setDescription(client.translate("general/avatar:SERVER"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("general/avatar:SERVER", null, "uk-UA"),
|
||||
"ru": client.translate("general/avatar:SERVER", null, "ru-RU"),
|
||||
})),
|
||||
.addUserOption(option =>
|
||||
option
|
||||
.setName("user")
|
||||
.setDescription(client.translate("common:USER"))
|
||||
.setDescriptionLocalizations({
|
||||
uk: client.translate("common:USER", null, "uk-UA"),
|
||||
ru: client.translate("common:USER", null, "ru-RU"),
|
||||
}),
|
||||
)
|
||||
.addBooleanOption(option =>
|
||||
option
|
||||
.setName("server")
|
||||
.setDescription(client.translate("general/avatar:SERVER"))
|
||||
.setDescriptionLocalizations({
|
||||
uk: client.translate("general/avatar:SERVER", null, "uk-UA"),
|
||||
ru: client.translate("general/avatar:SERVER", null, "ru-RU"),
|
||||
}),
|
||||
),
|
||||
aliases: [],
|
||||
dirname: __dirname,
|
||||
ownerOnly: false,
|
||||
|
@ -51,9 +57,11 @@ class Avatar extends BaseCommand {
|
|||
const avatarURL = interaction.options.getBoolean("server") ? member.avatarURL({ size: 512 }) : member.user.avatarURL({ size: 512 });
|
||||
|
||||
interaction.reply({
|
||||
files: [{
|
||||
attachment: avatarURL,
|
||||
}],
|
||||
files: [
|
||||
{
|
||||
attachment: avatarURL,
|
||||
},
|
||||
],
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,8 +12,8 @@ class Boosters extends BaseCommand {
|
|||
.setName("boosters")
|
||||
.setDescription(client.translate("general/boosters:DESCRIPTION"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("general/boosters:DESCRIPTION", null, "uk-UA"),
|
||||
"ru": client.translate("general/boosters:DESCRIPTION", null, "ru-RU"),
|
||||
uk: client.translate("general/boosters:DESCRIPTION", null, "uk-UA"),
|
||||
ru: client.translate("general/boosters:DESCRIPTION", null, "ru-RU"),
|
||||
})
|
||||
.setDMPermission(false),
|
||||
aliases: [],
|
||||
|
@ -43,25 +43,12 @@ class Boosters extends BaseCommand {
|
|||
|
||||
const embeds = generateBoostersEmbeds(client, interaction, boosters, data.guildData);
|
||||
|
||||
const row = new ActionRowBuilder()
|
||||
.addComponents(
|
||||
new ButtonBuilder()
|
||||
.setCustomId("boosters_prev_page")
|
||||
.setStyle(ButtonStyle.Primary)
|
||||
.setEmoji("⬅️"),
|
||||
new ButtonBuilder()
|
||||
.setCustomId("boosters_next_page")
|
||||
.setStyle(ButtonStyle.Primary)
|
||||
.setEmoji("➡️"),
|
||||
new ButtonBuilder()
|
||||
.setCustomId("boosters_jump_page")
|
||||
.setStyle(ButtonStyle.Secondary)
|
||||
.setEmoji("↗️"),
|
||||
new ButtonBuilder()
|
||||
.setCustomId("boosters_stop")
|
||||
.setStyle(ButtonStyle.Danger)
|
||||
.setEmoji("⏹️"),
|
||||
);
|
||||
const row = new ActionRowBuilder().addComponents(
|
||||
new ButtonBuilder().setCustomId("boosters_prev_page").setStyle(ButtonStyle.Primary).setEmoji("⬅️"),
|
||||
new ButtonBuilder().setCustomId("boosters_next_page").setStyle(ButtonStyle.Primary).setEmoji("➡️"),
|
||||
new ButtonBuilder().setCustomId("boosters_jump_page").setStyle(ButtonStyle.Secondary).setEmoji("↗️"),
|
||||
new ButtonBuilder().setCustomId("boosters_stop").setStyle(ButtonStyle.Danger).setEmoji("⏹️"),
|
||||
);
|
||||
|
||||
await interaction.editReply({
|
||||
content: `${interaction.translate("common:PAGE")}: **${currentPage + 1}**/**${embeds.length}**`,
|
||||
|
@ -70,7 +57,7 @@ class Boosters extends BaseCommand {
|
|||
});
|
||||
|
||||
const filter = i => i.user.id === interaction.user.id;
|
||||
const collector = interaction.guild === null ? (await interaction.user.createDM()).createMessageComponentCollector({ filter, idle: (20 * 1000) }) : interaction.channel.createMessageComponentCollector({ filter, idle: (20 * 1000) });
|
||||
const collector = interaction.guild === null ? (await interaction.user.createDM()).createMessageComponentCollector({ filter, idle: 20 * 1000 }) : interaction.channel.createMessageComponentCollector({ filter, idle: 20 * 1000 });
|
||||
|
||||
collector.on("collect", async i => {
|
||||
if (i.isButton()) {
|
||||
|
@ -110,7 +97,7 @@ class Boosters extends BaseCommand {
|
|||
return res.author.id === interaction.user.id && !isNaN(res.content);
|
||||
};
|
||||
|
||||
interaction.channel.awaitMessages({ filter, max: 1, time: (10 * 1000) }).then(collected => {
|
||||
interaction.channel.awaitMessages({ filter, max: 1, time: 10 * 1000 }).then(collected => {
|
||||
if (embeds[collected.first().content - 1]) {
|
||||
currentPage = collected.first().content - 1;
|
||||
interaction.editReply({
|
||||
|
@ -159,7 +146,10 @@ function generateBoostersEmbeds(client, interaction, boosters, guildData) {
|
|||
let k = 10;
|
||||
|
||||
for (let i = 0; i < boosters.size; i += 10) {
|
||||
const current = boosters.sort((a, b) => a.premiumSinceTimestamp - b.premiumSinceTimestamp).map(g => g).slice(i, k);
|
||||
const current = boosters
|
||||
.sort((a, b) => a.premiumSinceTimestamp - b.premiumSinceTimestamp)
|
||||
.map(g => g)
|
||||
.slice(i, k);
|
||||
let j = i;
|
||||
k += 10;
|
||||
|
||||
|
|
|
@ -12,17 +12,20 @@ class Emoji extends BaseCommand {
|
|||
.setName("emoji")
|
||||
.setDescription(client.translate("general/emoji:DESCRIPTION"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("general/emoji:DESCRIPTION", null, "uk-UA"),
|
||||
"ru": client.translate("general/emoji:DESCRIPTION", null, "ru-RU"),
|
||||
uk: client.translate("general/emoji:DESCRIPTION", null, "uk-UA"),
|
||||
ru: client.translate("general/emoji:DESCRIPTION", null, "ru-RU"),
|
||||
})
|
||||
.setDMPermission(true)
|
||||
.addStringOption(option => option.setName("emoji")
|
||||
.setDescription(client.translate("common:EMOJI"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("commom:EMOJI", null, "uk-UA"),
|
||||
"ru": client.translate("common:EMOJI", null, "ru-RU"),
|
||||
})
|
||||
.setRequired(true)),
|
||||
.addStringOption(option =>
|
||||
option
|
||||
.setName("emoji")
|
||||
.setDescription(client.translate("common:EMOJI"))
|
||||
.setDescriptionLocalizations({
|
||||
uk: client.translate("commom:EMOJI", null, "uk-UA"),
|
||||
ru: client.translate("common:EMOJI", null, "ru-RU"),
|
||||
})
|
||||
.setRequired(true),
|
||||
),
|
||||
aliases: [],
|
||||
dirname: __dirname,
|
||||
ownerOnly: false,
|
||||
|
|
|
@ -12,18 +12,20 @@ class Help extends BaseCommand {
|
|||
.setName("help")
|
||||
.setDescription(client.translate("general/help:DESCRIPTION"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("general/help:DESCRIPTION", null, "uk-UA"),
|
||||
"ru": client.translate("general/help:DESCRIPTION", null, "ru-RU"),
|
||||
uk: client.translate("general/help:DESCRIPTION", null, "uk-UA"),
|
||||
ru: client.translate("general/help:DESCRIPTION", null, "ru-RU"),
|
||||
})
|
||||
.setDMPermission(true)
|
||||
.addStringOption(option =>
|
||||
option.setName("command")
|
||||
option
|
||||
.setName("command")
|
||||
.setDescription(client.translate("common:COMMAND"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("common:COMMAND", null, "uk-UA"),
|
||||
"ru": client.translate("common:COMMAND", null, "ru-RU"),
|
||||
uk: client.translate("common:COMMAND", null, "uk-UA"),
|
||||
ru: client.translate("common:COMMAND", null, "ru-RU"),
|
||||
})
|
||||
.setAutocomplete(true)),
|
||||
.setAutocomplete(true),
|
||||
),
|
||||
aliases: [],
|
||||
dirname: __dirname,
|
||||
ownerOnly: false,
|
||||
|
@ -52,7 +54,7 @@ class Help extends BaseCommand {
|
|||
if (command) {
|
||||
if (commands.find(c => c.command.name === command).category === "Owner" && interaction.user.id !== client.config.owner.id) return interaction.error("misc:OWNER_ONLY", null, { edit: true, ephemeral: true });
|
||||
|
||||
return interaction.editReply({ embeds: [ generateCommandHelp(interaction, command) ] });
|
||||
return interaction.editReply({ embeds: [generateCommandHelp(interaction, command)] });
|
||||
}
|
||||
|
||||
commands.forEach(c => {
|
||||
|
@ -72,13 +74,7 @@ class Help extends BaseCommand {
|
|||
};
|
||||
});
|
||||
|
||||
const row = new ActionRowBuilder()
|
||||
.addComponents(
|
||||
new StringSelectMenuBuilder()
|
||||
.setCustomId("help_category_select")
|
||||
.setPlaceholder(client.translate("common:NOTHING_SELECTED"))
|
||||
.addOptions(categoriesRows),
|
||||
);
|
||||
const row = new ActionRowBuilder().addComponents(new StringSelectMenuBuilder().setCustomId("help_category_select").setPlaceholder(client.translate("common:NOTHING_SELECTED")).addOptions(categoriesRows));
|
||||
|
||||
const msg = await interaction.editReply({
|
||||
content: interaction.translate("common:AVAILABLE_OPTIONS"),
|
||||
|
@ -87,19 +83,21 @@ class Help extends BaseCommand {
|
|||
});
|
||||
|
||||
const filter = i => i.user.id === interaction.user.id;
|
||||
const collector = msg.createMessageComponentCollector({ filter, idle: (15 * 1000) });
|
||||
const collector = msg.createMessageComponentCollector({ filter, idle: 15 * 1000 });
|
||||
|
||||
collector.on("collect", async i => {
|
||||
if (i.isStringSelectMenu() && i.customId === "help_category_select") {
|
||||
i.deferUpdate();
|
||||
|
||||
const arg = i?.values[0];
|
||||
const categoryCommands = commands.filter(cmd => cmd.category === arg).map(c => {
|
||||
return {
|
||||
name: `**${c.command.name}**`,
|
||||
value: interaction.translate(`${arg.toLowerCase()}/${c.command.name}:DESCRIPTION`),
|
||||
};
|
||||
});
|
||||
const categoryCommands = commands
|
||||
.filter(cmd => cmd.category === arg)
|
||||
.map(c => {
|
||||
return {
|
||||
name: `**${c.command.name}**`,
|
||||
value: interaction.translate(`${arg.toLowerCase()}/${c.command.name}:DESCRIPTION`),
|
||||
};
|
||||
});
|
||||
|
||||
const embed = new EmbedBuilder()
|
||||
.setColor(client.config.embed.color)
|
||||
|
@ -146,14 +144,13 @@ class Help extends BaseCommand {
|
|||
results.slice(0, 25).map(command => ({
|
||||
name: command.command.name,
|
||||
value: command.command.name,
|
||||
}),
|
||||
));
|
||||
})),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
function getPermName(bitfield = 0) {
|
||||
for (const key in PermissionsBitField.Flags)
|
||||
if (PermissionsBitField.Flags[key] === BigInt(bitfield)) return key;
|
||||
for (const key in PermissionsBitField.Flags) if (PermissionsBitField.Flags[key] === BigInt(bitfield)) return key;
|
||||
return null;
|
||||
}
|
||||
|
||||
|
@ -161,9 +158,7 @@ function generateCommandHelp(interaction, command) {
|
|||
const cmd = interaction.client.commands.get(command);
|
||||
if (!cmd) return interaction.error("general/help:NOT_FOUND", { command }, { edit: true });
|
||||
|
||||
const usage = interaction.translate(`${cmd.category.toLowerCase()}/${cmd.command.name}:USAGE`) === "" ?
|
||||
interaction.translate("misc:NO_ARGS")
|
||||
: interaction.translate(`${cmd.category.toLowerCase()}/${cmd.command.name}:USAGE`);
|
||||
const usage = interaction.translate(`${cmd.category.toLowerCase()}/${cmd.command.name}:USAGE`) === "" ? interaction.translate("misc:NO_ARGS") : interaction.translate(`${cmd.category.toLowerCase()}/${cmd.command.name}:USAGE`);
|
||||
|
||||
const embed = new EmbedBuilder()
|
||||
.setAuthor({
|
||||
|
|
|
@ -13,17 +13,20 @@ class Minecraft extends BaseCommand {
|
|||
.setName("minecraft")
|
||||
.setDescription(client.translate("general/minecraft:DESCRIPTION"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("general/minecraft:DESCRIPTION", null, "uk-UA"),
|
||||
"ru": client.translate("general/minecraft:DESCRIPTION", null, "ru-RU"),
|
||||
uk: client.translate("general/minecraft:DESCRIPTION", null, "uk-UA"),
|
||||
ru: client.translate("general/minecraft:DESCRIPTION", null, "ru-RU"),
|
||||
})
|
||||
.setDMPermission(true)
|
||||
.addStringOption(option => option.setName("ip")
|
||||
.setDescription(client.translate("common:IP"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("common:IP", null, "uk-UA"),
|
||||
"ru": client.translate("common:IP", null, "ru-RU"),
|
||||
})
|
||||
.setRequired(true)),
|
||||
.addStringOption(option =>
|
||||
option
|
||||
.setName("ip")
|
||||
.setDescription(client.translate("common:IP"))
|
||||
.setDescriptionLocalizations({
|
||||
uk: client.translate("common:IP", null, "uk-UA"),
|
||||
ru: client.translate("common:IP", null, "ru-RU"),
|
||||
})
|
||||
.setRequired(true),
|
||||
),
|
||||
aliases: [],
|
||||
dirname: __dirname,
|
||||
ownerOnly: false,
|
||||
|
@ -77,7 +80,17 @@ class Minecraft extends BaseCommand {
|
|||
},
|
||||
{
|
||||
name: interaction.translate("general/minecraft:FIELD_CONNECTED"),
|
||||
value: `**${(res.raw.players ? res.raw.players.online : res.players.length)}** ${client.functions.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.functions.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.functions.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.functions.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"),
|
||||
|
@ -88,7 +101,6 @@ class Minecraft extends BaseCommand {
|
|||
name: interaction.translate("general/minecraft:FIELD_VERSION"),
|
||||
value: res.raw.vanilla.raw.version.name,
|
||||
inline: true,
|
||||
|
||||
},
|
||||
{
|
||||
name: interaction.translate("general/minecraft:FIELD_PING"),
|
||||
|
|
|
@ -12,8 +12,8 @@ class Ping extends BaseCommand {
|
|||
.setName("ping")
|
||||
.setDescription(client.translate("general/ping:DESCRIPTION"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("general/ping:DESCRIPTION", null, "uk-UA"),
|
||||
"ru": client.translate("general/ping:DESCRIPTION", null, "ru-RU"),
|
||||
uk: client.translate("general/ping:DESCRIPTION", null, "uk-UA"),
|
||||
ru: client.translate("general/ping:DESCRIPTION", null, "ru-RU"),
|
||||
})
|
||||
.setDMPermission(true),
|
||||
aliases: [],
|
||||
|
@ -44,9 +44,11 @@ class Ping extends BaseCommand {
|
|||
name: interaction.translate("general/ping:PONG"),
|
||||
iconURL: client.user.avatarURL(),
|
||||
})
|
||||
.setDescription(interaction.translate("general/ping:PING", {
|
||||
ping: Math.round(client.ws.ping),
|
||||
}));
|
||||
.setDescription(
|
||||
interaction.translate("general/ping:PING", {
|
||||
ping: Math.round(client.ws.ping),
|
||||
}),
|
||||
);
|
||||
|
||||
interaction.reply({
|
||||
embeds: [embed],
|
||||
|
|
|
@ -14,24 +14,30 @@ class Remindme extends BaseCommand {
|
|||
.setName("remindme")
|
||||
.setDescription(client.translate("general/remindme:DESCRIPTION"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("general/remindme:DESCRIPTION", null, "uk-UA"),
|
||||
"ru": client.translate("general/remindme:DESCRIPTION", null, "ru-RU"),
|
||||
uk: client.translate("general/remindme:DESCRIPTION", null, "uk-UA"),
|
||||
ru: client.translate("general/remindme:DESCRIPTION", null, "ru-RU"),
|
||||
})
|
||||
.setDMPermission(true)
|
||||
.addStringOption(option => option.setName("time")
|
||||
.setDescription(client.translate("general/remindme:TIME"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("general/remindme:TIME", null, "uk-UA"),
|
||||
"ru": client.translate("general/remindme:TIME", null, "ru-RU"),
|
||||
})
|
||||
.setRequired(true))
|
||||
.addStringOption(option => option.setName("message")
|
||||
.setDescription(client.translate("common:MESSAGE"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("common:MESSAGE", null, "uk-UA"),
|
||||
"ru": client.translate("common:MESSAGE", null, "ru-RU"),
|
||||
})
|
||||
.setRequired(true)),
|
||||
.addStringOption(option =>
|
||||
option
|
||||
.setName("time")
|
||||
.setDescription(client.translate("general/remindme:TIME"))
|
||||
.setDescriptionLocalizations({
|
||||
uk: client.translate("general/remindme:TIME", null, "uk-UA"),
|
||||
ru: client.translate("general/remindme:TIME", null, "ru-RU"),
|
||||
})
|
||||
.setRequired(true),
|
||||
)
|
||||
.addStringOption(option =>
|
||||
option
|
||||
.setName("message")
|
||||
.setDescription(client.translate("common:MESSAGE"))
|
||||
.setDescriptionLocalizations({
|
||||
uk: client.translate("common:MESSAGE", null, "uk-UA"),
|
||||
ru: client.translate("common:MESSAGE", null, "ru-RU"),
|
||||
})
|
||||
.setRequired(true),
|
||||
),
|
||||
aliases: [],
|
||||
dirname: __dirname,
|
||||
ownerOnly: false,
|
||||
|
|
|
@ -12,24 +12,30 @@ class Report extends BaseCommand {
|
|||
.setName("report")
|
||||
.setDescription(client.translate("general/report:DESCRIPTION"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("general/report:DESCRIPTION", null, "uk-UA"),
|
||||
"ru": client.translate("general/report:DESCRIPTION", null, "ru-RU"),
|
||||
uk: client.translate("general/report:DESCRIPTION", null, "uk-UA"),
|
||||
ru: client.translate("general/report:DESCRIPTION", null, "ru-RU"),
|
||||
})
|
||||
.setDMPermission(false)
|
||||
.addUserOption(option => option.setName("user")
|
||||
.setDescription(client.translate("common:USER"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("common:USER", null, "uk-UA"),
|
||||
"ru": client.translate("common:USER", null, "ru-RU"),
|
||||
})
|
||||
.setRequired(true))
|
||||
.addStringOption(option => option.setName("message")
|
||||
.setDescription(client.translate("common:MESSAGE"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("common:MESSAGE", null, "uk-UA"),
|
||||
"ru": client.translate("common:MESSAGE", null, "ru-RU"),
|
||||
})
|
||||
.setRequired(true)),
|
||||
.addUserOption(option =>
|
||||
option
|
||||
.setName("user")
|
||||
.setDescription(client.translate("common:USER"))
|
||||
.setDescriptionLocalizations({
|
||||
uk: client.translate("common:USER", null, "uk-UA"),
|
||||
ru: client.translate("common:USER", null, "ru-RU"),
|
||||
})
|
||||
.setRequired(true),
|
||||
)
|
||||
.addStringOption(option =>
|
||||
option
|
||||
.setName("message")
|
||||
.setDescription(client.translate("common:MESSAGE"))
|
||||
.setDescriptionLocalizations({
|
||||
uk: client.translate("common:MESSAGE", null, "uk-UA"),
|
||||
ru: client.translate("common:MESSAGE", null, "ru-RU"),
|
||||
})
|
||||
.setRequired(true),
|
||||
),
|
||||
aliases: [],
|
||||
dirname: __dirname,
|
||||
ownerOnly: false,
|
||||
|
|
|
@ -12,8 +12,8 @@ class Serverinfo extends BaseCommand {
|
|||
.setName("serverinfo")
|
||||
.setDescription(client.translate("general/serverinfo:DESCRIPTION"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("general/serverinfo:DESCRIPTION", null, "uk-UA"),
|
||||
"ru": client.translate("general/serverinfo:DESCRIPTION", null, "ru-RU"),
|
||||
uk: client.translate("general/serverinfo:DESCRIPTION", null, "uk-UA"),
|
||||
ru: client.translate("general/serverinfo:DESCRIPTION", null, "ru-RU"),
|
||||
})
|
||||
.setDMPermission(false),
|
||||
aliases: [],
|
||||
|
@ -63,8 +63,20 @@ class Serverinfo extends BaseCommand {
|
|||
},
|
||||
{
|
||||
name: client.customEmojis.users + interaction.translate("common:MEMBERS"),
|
||||
value: `${guild.members.cache.filter(m => !m.user.bot).size} ${client.functions.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.functions.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"))}`,
|
||||
value:
|
||||
`${guild.members.cache.filter(m => !m.user.bot).size} ${client.functions.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.functions.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,
|
||||
},
|
||||
{
|
||||
|
@ -89,9 +101,27 @@ class Serverinfo extends BaseCommand {
|
|||
},
|
||||
{
|
||||
name: client.customEmojis.channels + interaction.translate("common:CHANNELS"),
|
||||
value: `${guild.channels.cache.filter(c => c.type === ChannelType.GuildText).size} ${client.functions.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.functions.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.functions.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"))}`,
|
||||
value:
|
||||
`${guild.channels.cache.filter(c => c.type === ChannelType.GuildText).size} ${client.functions.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.functions.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.functions.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,
|
||||
},
|
||||
])
|
||||
|
|
|
@ -13,17 +13,20 @@ class Shorturl extends BaseCommand {
|
|||
.setName("shorturl")
|
||||
.setDescription(client.translate("general/shorturl:DESCRIPTION"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("general/shorturl:DESCRIPTION", null, "uk-UA"),
|
||||
"ru": client.translate("general/shorturl:DESCRIPTION", null, "ru-RU"),
|
||||
uk: client.translate("general/shorturl:DESCRIPTION", null, "uk-UA"),
|
||||
ru: client.translate("general/shorturl:DESCRIPTION", null, "ru-RU"),
|
||||
})
|
||||
.setDMPermission(true)
|
||||
.addStringOption(option => option.setName("url")
|
||||
.setDescription(client.translate("common:URL"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("common:URL", null, "uk-UA"),
|
||||
"ru": client.translate("common:URL", null, "ru-RU"),
|
||||
})
|
||||
.setRequired(true)),
|
||||
.addStringOption(option =>
|
||||
option
|
||||
.setName("url")
|
||||
.setDescription(client.translate("common:URL"))
|
||||
.setDescriptionLocalizations({
|
||||
uk: client.translate("common:URL", null, "uk-UA"),
|
||||
ru: client.translate("common:URL", null, "ru-RU"),
|
||||
})
|
||||
.setRequired(true),
|
||||
),
|
||||
aliases: [],
|
||||
dirname: __dirname,
|
||||
ownerOnly: false,
|
||||
|
|
|
@ -12,8 +12,8 @@ class Stats extends BaseCommand {
|
|||
.setName("stats")
|
||||
.setDescription(client.translate("general/stats:DESCRIPTION"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("general/stats:DESCRIPTION", null, "uk-UA"),
|
||||
"ru": client.translate("general/stats:DESCRIPTION", null, "ru-RU"),
|
||||
uk: client.translate("general/stats:DESCRIPTION", null, "uk-UA"),
|
||||
ru: client.translate("general/stats:DESCRIPTION", null, "ru-RU"),
|
||||
})
|
||||
.setDMPermission(true),
|
||||
aliases: [],
|
||||
|
@ -80,7 +80,12 @@ class Stats extends BaseCommand {
|
|||
{
|
||||
name: client.customEmojis.voice + " " + interaction.translate("general/stats:MUSIC_TITLE"),
|
||||
value: interaction.translate("general/stats:MUSIC_CONTENT", {
|
||||
count: `${client.player.nodes.cache.size} ${client.functions.getNoun(client.player.nodes.cache.size, interaction.translate("misc:NOUNS:SERVERS:1"), interaction.translate("misc:NOUNS:SERVERS:2"), interaction.translate("misc:NOUNS:SERVERS:5"))}`,
|
||||
count: `${client.player.nodes.cache.size} ${client.functions.getNoun(
|
||||
client.player.nodes.cache.size,
|
||||
interaction.translate("misc:NOUNS:SERVERS:1"),
|
||||
interaction.translate("misc:NOUNS:SERVERS:2"),
|
||||
interaction.translate("misc:NOUNS:SERVERS:5"),
|
||||
)}`,
|
||||
}),
|
||||
},
|
||||
{
|
||||
|
@ -92,7 +97,7 @@ class Stats extends BaseCommand {
|
|||
value: interaction.translate("misc:STATS_FOOTER", {
|
||||
dashboardLink: client.config.dashboard.domain,
|
||||
supportLink: "https://discord.gg/Ptkj2n9nzZ",
|
||||
inviteLink: client.generateInvite({ scopes: ["bot", "applications.commands"], permissions: [ PermissionsBitField.Flags.Administrator ] }),
|
||||
inviteLink: client.generateInvite({ scopes: ["bot", "applications.commands"], permissions: [PermissionsBitField.Flags.Administrator] }),
|
||||
donateLink: "https://www.donationalerts.com/r/jonny_bro",
|
||||
owner: client.config.owner.id,
|
||||
}),
|
||||
|
|
|
@ -12,17 +12,20 @@ class Suggest extends BaseCommand {
|
|||
.setName("suggest")
|
||||
.setDescription(client.translate("general/suggest:DESCRIPTION"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("general/suggest:DESCRIPTION", null, "uk-UA"),
|
||||
"ru": client.translate("general/suggest:DESCRIPTION", null, "ru-RU"),
|
||||
uk: client.translate("general/suggest:DESCRIPTION", null, "uk-UA"),
|
||||
ru: client.translate("general/suggest:DESCRIPTION", null, "ru-RU"),
|
||||
})
|
||||
.setDMPermission(false)
|
||||
.addStringOption(option => option.setName("message")
|
||||
.setDescription(client.translate("common:MESSAGE"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("common:MESSAGE", null, "uk-UA"),
|
||||
"ru": client.translate("common:MESSAGE", null, "ru-RU"),
|
||||
})
|
||||
.setRequired(true)),
|
||||
.addStringOption(option =>
|
||||
option
|
||||
.setName("message")
|
||||
.setDescription(client.translate("common:MESSAGE"))
|
||||
.setDescriptionLocalizations({
|
||||
uk: client.translate("common:MESSAGE", null, "uk-UA"),
|
||||
ru: client.translate("common:MESSAGE", null, "ru-RU"),
|
||||
})
|
||||
.setRequired(true),
|
||||
),
|
||||
aliases: [],
|
||||
dirname: __dirname,
|
||||
ownerOnly: false,
|
||||
|
|
|
@ -12,16 +12,19 @@ class Userinfo extends BaseCommand {
|
|||
.setName("userinfo")
|
||||
.setDescription(client.translate("general/userinfo:DESCRIPTION"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("general/userinfo:DESCRIPTION", null, "uk-UA"),
|
||||
"ru": client.translate("general/userinfo:DESCRIPTION", null, "ru-RU"),
|
||||
uk: client.translate("general/userinfo:DESCRIPTION", null, "uk-UA"),
|
||||
ru: client.translate("general/userinfo:DESCRIPTION", null, "ru-RU"),
|
||||
})
|
||||
.setDMPermission(false)
|
||||
.addUserOption(option => option.setName("user")
|
||||
.setDescription(client.translate("common:USER"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("common:USER", null, "uk-UA"),
|
||||
"ru": client.translate("common:USER", null, "ru-RU"),
|
||||
})),
|
||||
.addUserOption(option =>
|
||||
option
|
||||
.setName("user")
|
||||
.setDescription(client.translate("common:USER"))
|
||||
.setDescriptionLocalizations({
|
||||
uk: client.translate("common:USER", null, "uk-UA"),
|
||||
ru: client.translate("common:USER", null, "ru-RU"),
|
||||
}),
|
||||
),
|
||||
aliases: [],
|
||||
dirname: __dirname,
|
||||
ownerOnly: false,
|
||||
|
@ -47,9 +50,11 @@ class Userinfo extends BaseCommand {
|
|||
name: `${member.user.getUsername()} (${member.id})`,
|
||||
iconURL: member.displayAvatarURL(),
|
||||
})
|
||||
.setThumbnail(member.displayAvatarURL({
|
||||
size: 512,
|
||||
}))
|
||||
.setThumbnail(
|
||||
member.displayAvatarURL({
|
||||
size: 512,
|
||||
}),
|
||||
)
|
||||
.addFields([
|
||||
{
|
||||
name: ":man: " + interaction.translate("common:USERNAME"),
|
||||
|
@ -88,9 +93,13 @@ class Userinfo extends BaseCommand {
|
|||
},
|
||||
{
|
||||
name: client.customEmojis.roles + " " + interaction.translate("common:ROLES"),
|
||||
value: (member.roles.size > 10 ? member.roles.cache.map(r => r).slice(0, 10).join(", ") + " " + interaction.translate("general/userinfo:MORE_ROLES", {
|
||||
count: member.roles.cache.size - 10,
|
||||
}) : (member.roles.cache.size < 1) ? interaction.translate("general/userinfo:NO_ROLE") : member.roles.cache.map(r => r).join(", ")),
|
||||
value:
|
||||
member.roles.size > 10
|
||||
? member.roles.cache.map(r => r).filter(r => r.id !== interaction.guild.roles.everyone.id).slice(0, 10).join(", ") + " " +
|
||||
interaction.translate("general/userinfo:MORE_ROLES", {
|
||||
count: member.roles.cache.size - 10,
|
||||
})
|
||||
: member.roles.cache.size < 1 ? interaction.translate("general/userinfo:NO_ROLE") : member.roles.cache.map(r => r).filter(r => r.id !== interaction.guild.roles.everyone.id).slice(0, 10).join(", "),
|
||||
inline: true,
|
||||
},
|
||||
])
|
||||
|
|
|
@ -13,17 +13,20 @@ class Whois extends BaseCommand {
|
|||
.setName("whois")
|
||||
.setDescription(client.translate("general/whois:DESCRIPTION"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("general/whois:DESCRIPTION", null, "uk-UA"),
|
||||
"ru": client.translate("general/whois:DESCRIPTION", null, "ru-RU"),
|
||||
uk: client.translate("general/whois:DESCRIPTION", null, "uk-UA"),
|
||||
ru: client.translate("general/whois:DESCRIPTION", null, "ru-RU"),
|
||||
})
|
||||
.setDMPermission(true)
|
||||
.addStringOption(option => option.setName("ip")
|
||||
.setDescription(client.translate("common:IP"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("common:IP", null, "uk-UA"),
|
||||
"ru": client.translate("common:IP", null, "ru-RU"),
|
||||
})
|
||||
.setRequired(true)),
|
||||
.addStringOption(option =>
|
||||
option
|
||||
.setName("ip")
|
||||
.setDescription(client.translate("common:IP"))
|
||||
.setDescriptionLocalizations({
|
||||
uk: client.translate("common:IP", null, "uk-UA"),
|
||||
ru: client.translate("common:IP", null, "ru-RU"),
|
||||
})
|
||||
.setRequired(true),
|
||||
),
|
||||
aliases: [],
|
||||
dirname: __dirname,
|
||||
ownerOnly: false,
|
||||
|
@ -51,9 +54,11 @@ 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,
|
||||
}))
|
||||
.setTitle(
|
||||
interaction.translate("general/whois:INFO_ABOUT", {
|
||||
ip,
|
||||
}),
|
||||
)
|
||||
.setFooter({
|
||||
text: client.config.embed.footer,
|
||||
})
|
||||
|
|
|
@ -14,8 +14,8 @@ class Checkjar extends BaseCommand {
|
|||
.setName("checkjar")
|
||||
.setDescription(client.translate("iat/checkjar:DESCRIPTION"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("iat/checkjar:DESCRIPTION", null, "uk-UA"),
|
||||
"ru": client.translate("iat/checkjar:DESCRIPTION", null, "ru-RU"),
|
||||
uk: client.translate("iat/checkjar:DESCRIPTION", null, "uk-UA"),
|
||||
ru: client.translate("iat/checkjar:DESCRIPTION", null, "ru-RU"),
|
||||
})
|
||||
.setDMPermission(false),
|
||||
aliases: [],
|
||||
|
@ -47,7 +47,7 @@ class Checkjar extends BaseCommand {
|
|||
},
|
||||
}).then(res => res.json());
|
||||
const jar = clientInfo.jars[1];
|
||||
const jarTransactions = await fetch(`https://api.monobank.ua/personal/statement/${jar.id}/${Date.now() - (7 * 24 * 60 * 60 * 1000)}/${Date.now()}`, {
|
||||
const jarTransactions = await fetch(`https://api.monobank.ua/personal/statement/${jar.id}/${Date.now() - 7 * 24 * 60 * 60 * 1000}/${Date.now()}`, {
|
||||
method: "GET",
|
||||
headers: {
|
||||
"X-Token": client.config.apiKeys.monobankApiKey,
|
||||
|
|
|
@ -12,30 +12,39 @@ class Clear extends BaseCommand {
|
|||
.setName("clear")
|
||||
.setDescription(client.translate("moderation/clear:DESCRIPTION"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("moderation/clear:DESCRIPTION", null, "uk-UA"),
|
||||
"ru": client.translate("moderation/clear:DESCRIPTION", null, "ru-RU"),
|
||||
uk: client.translate("moderation/clear:DESCRIPTION", null, "uk-UA"),
|
||||
ru: client.translate("moderation/clear:DESCRIPTION", null, "ru-RU"),
|
||||
})
|
||||
.setDMPermission(false)
|
||||
.setDefaultMemberPermissions(PermissionsBitField.Flags.ManageMessages)
|
||||
.addStringOption(option => option.setName("option")
|
||||
.setDescription(client.translate("moderation/clear:OPTION"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("moderation/clear:OPTION", null, "uk-UA"),
|
||||
"ru": client.translate("moderation/clear:OPTION", null, "ru-RU"),
|
||||
})
|
||||
.setRequired(true))
|
||||
.addUserOption(option => option.setName("user")
|
||||
.setDescription(client.translate("common:USER"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("common:USER", null, "uk-UA"),
|
||||
"ru": client.translate("common:USER", null, "ru-RU"),
|
||||
}))
|
||||
.addStringOption(option => option.setName("id")
|
||||
.setDescription(client.translate("common:USER_ID"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("common:USER_ID", null, "uk-UA"),
|
||||
"ru": client.translate("common:USER_ID", null, "ru-RU"),
|
||||
})),
|
||||
.addStringOption(option =>
|
||||
option
|
||||
.setName("option")
|
||||
.setDescription(client.translate("moderation/clear:OPTION"))
|
||||
.setDescriptionLocalizations({
|
||||
uk: client.translate("moderation/clear:OPTION", null, "uk-UA"),
|
||||
ru: client.translate("moderation/clear:OPTION", null, "ru-RU"),
|
||||
})
|
||||
.setRequired(true),
|
||||
)
|
||||
.addUserOption(option =>
|
||||
option
|
||||
.setName("user")
|
||||
.setDescription(client.translate("common:USER"))
|
||||
.setDescriptionLocalizations({
|
||||
uk: client.translate("common:USER", null, "uk-UA"),
|
||||
ru: client.translate("common:USER", null, "ru-RU"),
|
||||
}),
|
||||
)
|
||||
.addStringOption(option =>
|
||||
option
|
||||
.setName("id")
|
||||
.setDescription(client.translate("common:USER_ID"))
|
||||
.setDescriptionLocalizations({
|
||||
uk: client.translate("common:USER_ID", null, "uk-UA"),
|
||||
ru: client.translate("common:USER_ID", null, "ru-RU"),
|
||||
}),
|
||||
),
|
||||
aliases: [],
|
||||
dirname: __dirname,
|
||||
ownerOnly: false,
|
||||
|
@ -62,17 +71,10 @@ class Clear extends BaseCommand {
|
|||
user_id = interaction.options.getString("id");
|
||||
|
||||
if (option === "all") {
|
||||
const row = new ActionRowBuilder()
|
||||
.addComponents(
|
||||
new ButtonBuilder()
|
||||
.setCustomId("clear_confirm_yes")
|
||||
.setLabel(interaction.translate("common:ACCEPT"))
|
||||
.setStyle(ButtonStyle.Danger),
|
||||
new ButtonBuilder()
|
||||
.setCustomId("clear_confirm_no")
|
||||
.setLabel(interaction.translate("common:CANCEL"))
|
||||
.setStyle(ButtonStyle.Secondary),
|
||||
);
|
||||
const row = new ActionRowBuilder().addComponents(
|
||||
new ButtonBuilder().setCustomId("clear_confirm_yes").setLabel(interaction.translate("common:ACCEPT")).setStyle(ButtonStyle.Danger),
|
||||
new ButtonBuilder().setCustomId("clear_confirm_no").setLabel(interaction.translate("common:CANCEL")).setStyle(ButtonStyle.Secondary),
|
||||
);
|
||||
|
||||
await interaction.editReply({
|
||||
content: interaction.translate("moderation/clear:ALL_CONFIRM"),
|
||||
|
@ -80,7 +82,7 @@ class Clear extends BaseCommand {
|
|||
});
|
||||
|
||||
const filter = i => i.user.id === interaction.user.id;
|
||||
const collector = interaction.channel.createMessageComponentCollector({ filter, idle: (15 * 1000) });
|
||||
const collector = interaction.channel.createMessageComponentCollector({ filter, idle: 15 * 1000 });
|
||||
|
||||
collector.on("collect", async i => {
|
||||
if (i.isButton()) {
|
||||
|
@ -132,12 +134,15 @@ class Clear extends BaseCommand {
|
|||
if (user_id && member) return interaction.replyT("moderation/clear:REQUIRE_ID_USER", null, { edit: true });
|
||||
if (user_id || member) messages = messages.filter(m => m.author.id === (user_id || member.id));
|
||||
|
||||
interaction.channel.bulkDelete(messages.filter(m => !m.pinned), true);
|
||||
interaction.channel.bulkDelete(
|
||||
messages.filter(m => !m.pinned),
|
||||
true,
|
||||
);
|
||||
|
||||
if (member || user_id) {
|
||||
interaction.replyT("moderation/clear:CLEARED_MEMBER", {
|
||||
amount: `**${option}** ${client.functions.getNoun(option, interaction.translate("misc:NOUNS:MESSAGES:1"), interaction.translate("misc:NOUNS:MESSAGES:2"), interaction.translate("misc:NOUNS:MESSAGES:5"))}`,
|
||||
user: member && member.user.getUsername() || user_id,
|
||||
user: (member && member.user.getUsername()) || user_id,
|
||||
}, { edit: true });
|
||||
} else {
|
||||
interaction.replyT("moderation/clear:CLEARED", {
|
||||
|
|
|
@ -12,18 +12,21 @@ class Clearwarns extends BaseCommand {
|
|||
.setName("clearwarns")
|
||||
.setDescription(client.translate("moderation/clearwarns:DESCRIPTION"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("moderation/clearwarns:DESCRIPTION", null, "uk-UA"),
|
||||
"ru": client.translate("moderation/clearwarns:DESCRIPTION", null, "ru-RU"),
|
||||
uk: client.translate("moderation/clearwarns:DESCRIPTION", null, "uk-UA"),
|
||||
ru: client.translate("moderation/clearwarns:DESCRIPTION", null, "ru-RU"),
|
||||
})
|
||||
.setDMPermission(false)
|
||||
.setDefaultMemberPermissions(PermissionsBitField.Flags.ManageMessages)
|
||||
.addUserOption(option => option.setName("user")
|
||||
.setDescription(client.translate("common:USER"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("common:USER", null, "uk-UA"),
|
||||
"ru": client.translate("common:USER", null, "ru-RU"),
|
||||
})
|
||||
.setRequired(true)),
|
||||
.addUserOption(option =>
|
||||
option
|
||||
.setName("user")
|
||||
.setDescription(client.translate("common:USER"))
|
||||
.setDescriptionLocalizations({
|
||||
uk: client.translate("common:USER", null, "uk-UA"),
|
||||
ru: client.translate("common:USER", null, "ru-RU"),
|
||||
})
|
||||
.setRequired(true),
|
||||
),
|
||||
aliases: [],
|
||||
dirname: __dirname,
|
||||
ownerOnly: false,
|
||||
|
|
|
@ -13,87 +13,116 @@ class Giveaway extends BaseCommand {
|
|||
.setName("giveaway")
|
||||
.setDescription(client.translate("moderation/giveaway:DESCRIPTION"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("moderation/giveaway:DESCRIPTION", null, "uk-UA"),
|
||||
"ru": client.translate("moderation/giveaway:DESCRIPTION", null, "ru-RU"),
|
||||
uk: client.translate("moderation/giveaway:DESCRIPTION", null, "uk-UA"),
|
||||
ru: client.translate("moderation/giveaway:DESCRIPTION", null, "ru-RU"),
|
||||
})
|
||||
.setDMPermission(false)
|
||||
.setDefaultMemberPermissions(PermissionsBitField.Flags.ManageMessages)
|
||||
.addSubcommand(subcommand => subcommand.setName("create")
|
||||
.setDescription(client.translate("moderation/giveaway:CREATE"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("moderation/giveaway:CREATE", null, "uk-UA"),
|
||||
"ru": client.translate("moderation/giveaway:CREATE", null, "ru-RU"),
|
||||
})
|
||||
.addStringOption(option => option.setName("duration")
|
||||
.setDescription(client.translate("common:DURATION"))
|
||||
.addSubcommand(subcommand =>
|
||||
subcommand
|
||||
.setName("create")
|
||||
.setDescription(client.translate("moderation/giveaway:CREATE"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("common:DURATION", null, "uk-UA"),
|
||||
"ru": client.translate("common:DURATION", null, "ru-RU"),
|
||||
uk: client.translate("moderation/giveaway:CREATE", null, "uk-UA"),
|
||||
ru: client.translate("moderation/giveaway:CREATE", null, "ru-RU"),
|
||||
})
|
||||
.setRequired(true))
|
||||
.addIntegerOption(option => option.setName("winners_count")
|
||||
.setDescription(client.translate("moderation/giveaway:WINNERS_COUNT"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("moderation/giveaway:WINNERS_COUNT", null, "uk-UA"),
|
||||
"ru": client.translate("moderation/giveaway:WINNERS_COUNT", null, "ru-RU"),
|
||||
})
|
||||
.setRequired(true))
|
||||
.addStringOption(option => option.setName("prize")
|
||||
.setDescription(client.translate("moderation/giveaway:PRIZE"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("moderation/giveaway:PRIZE", null, "uk-UA"),
|
||||
"ru": client.translate("moderation/giveaway:PRIZE", null, "ru-RU"),
|
||||
})
|
||||
.setRequired(true))
|
||||
.addBooleanOption(option => option.setName("isdrop")
|
||||
.setDescription(client.translate("moderation/giveaway:ISDROP"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("moderation/giveaway:ISDROP", null, "uk-UA"),
|
||||
"ru": client.translate("moderation/giveaway:ISDROP", null, "ru-RU"),
|
||||
})
|
||||
.setRequired(true)),
|
||||
.addStringOption(option =>
|
||||
option
|
||||
.setName("duration")
|
||||
.setDescription(client.translate("common:DURATION"))
|
||||
.setDescriptionLocalizations({
|
||||
uk: client.translate("common:DURATION", null, "uk-UA"),
|
||||
ru: client.translate("common:DURATION", null, "ru-RU"),
|
||||
})
|
||||
.setRequired(true),
|
||||
)
|
||||
.addIntegerOption(option =>
|
||||
option
|
||||
.setName("winners_count")
|
||||
.setDescription(client.translate("moderation/giveaway:WINNERS_COUNT"))
|
||||
.setDescriptionLocalizations({
|
||||
uk: client.translate("moderation/giveaway:WINNERS_COUNT", null, "uk-UA"),
|
||||
ru: client.translate("moderation/giveaway:WINNERS_COUNT", null, "ru-RU"),
|
||||
})
|
||||
.setRequired(true),
|
||||
)
|
||||
.addStringOption(option =>
|
||||
option
|
||||
.setName("prize")
|
||||
.setDescription(client.translate("moderation/giveaway:PRIZE"))
|
||||
.setDescriptionLocalizations({
|
||||
uk: client.translate("moderation/giveaway:PRIZE", null, "uk-UA"),
|
||||
ru: client.translate("moderation/giveaway:PRIZE", null, "ru-RU"),
|
||||
})
|
||||
.setRequired(true),
|
||||
)
|
||||
.addBooleanOption(option =>
|
||||
option
|
||||
.setName("isdrop")
|
||||
.setDescription(client.translate("moderation/giveaway:ISDROP"))
|
||||
.setDescriptionLocalizations({
|
||||
uk: client.translate("moderation/giveaway:ISDROP", null, "uk-UA"),
|
||||
ru: client.translate("moderation/giveaway:ISDROP", null, "ru-RU"),
|
||||
})
|
||||
.setRequired(true),
|
||||
),
|
||||
)
|
||||
.addSubcommand(subcommand => subcommand.setName("reroll")
|
||||
.setDescription(client.translate("moderation/giveaway:REROLL"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("moderation/giveaway:REROLL", null, "uk-UA"),
|
||||
"ru": client.translate("moderation/giveaway:REROLL", null, "ru-RU"),
|
||||
})
|
||||
.addStringOption(option => option.setName("giveaway_id")
|
||||
.setDescription(client.translate("moderation/giveaway:GIVEAWAY_ID"))
|
||||
.addSubcommand(subcommand =>
|
||||
subcommand
|
||||
.setName("reroll")
|
||||
.setDescription(client.translate("moderation/giveaway:REROLL"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("moderation/giveaway:GIVEAWAY_ID", null, "uk-UA"),
|
||||
"ru": client.translate("moderation/giveaway:GIVEAWAY_ID", null, "ru-RU"),
|
||||
uk: client.translate("moderation/giveaway:REROLL", null, "uk-UA"),
|
||||
ru: client.translate("moderation/giveaway:REROLL", null, "ru-RU"),
|
||||
})
|
||||
.setRequired(true)),
|
||||
.addStringOption(option =>
|
||||
option
|
||||
.setName("giveaway_id")
|
||||
.setDescription(client.translate("moderation/giveaway:GIVEAWAY_ID"))
|
||||
.setDescriptionLocalizations({
|
||||
uk: client.translate("moderation/giveaway:GIVEAWAY_ID", null, "uk-UA"),
|
||||
ru: client.translate("moderation/giveaway:GIVEAWAY_ID", null, "ru-RU"),
|
||||
})
|
||||
.setRequired(true),
|
||||
),
|
||||
)
|
||||
.addSubcommand(subcommand => subcommand.setName("end")
|
||||
.setDescription(client.translate("moderation/giveaway:END"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("moderation/giveaway:END", null, "uk-UA"),
|
||||
"ru": client.translate("moderation/giveaway:END", null, "ru-RU"),
|
||||
})
|
||||
.addStringOption(option => option.setName("giveaway_id")
|
||||
.setDescription(client.translate("moderation/giveaway:GIVEAWAY_ID"))
|
||||
.addSubcommand(subcommand =>
|
||||
subcommand
|
||||
.setName("end")
|
||||
.setDescription(client.translate("moderation/giveaway:END"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("moderation/giveaway:GIVEAWAY_ID", null, "uk-UA"),
|
||||
"ru": client.translate("moderation/giveaway:GIVEAWAY_ID", null, "ru-RU"),
|
||||
uk: client.translate("moderation/giveaway:END", null, "uk-UA"),
|
||||
ru: client.translate("moderation/giveaway:END", null, "ru-RU"),
|
||||
})
|
||||
.setRequired(true)),
|
||||
.addStringOption(option =>
|
||||
option
|
||||
.setName("giveaway_id")
|
||||
.setDescription(client.translate("moderation/giveaway:GIVEAWAY_ID"))
|
||||
.setDescriptionLocalizations({
|
||||
uk: client.translate("moderation/giveaway:GIVEAWAY_ID", null, "uk-UA"),
|
||||
ru: client.translate("moderation/giveaway:GIVEAWAY_ID", null, "ru-RU"),
|
||||
})
|
||||
.setRequired(true),
|
||||
),
|
||||
)
|
||||
.addSubcommand(subcommand => subcommand.setName("delete")
|
||||
.setDescription(client.translate("moderation/giveaway:DELETE"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("moderation/giveaway:DELETE", null, "uk-UA"),
|
||||
"ru": client.translate("moderation/giveaway:DELETE", null, "ru-RU"),
|
||||
})
|
||||
.addStringOption(option => option.setName("giveaway_id")
|
||||
.setDescription(client.translate("moderation/giveaway:GIVEAWAY_ID"))
|
||||
.addSubcommand(subcommand =>
|
||||
subcommand
|
||||
.setName("delete")
|
||||
.setDescription(client.translate("moderation/giveaway:DELETE"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("moderation/giveaway:GIVEAWAY_ID", null, "uk-UA"),
|
||||
"ru": client.translate("moderation/giveaway:GIVEAWAY_ID", null, "ru-RU"),
|
||||
uk: client.translate("moderation/giveaway:DELETE", null, "uk-UA"),
|
||||
ru: client.translate("moderation/giveaway:DELETE", null, "ru-RU"),
|
||||
})
|
||||
.setRequired(true)),
|
||||
.addStringOption(option =>
|
||||
option
|
||||
.setName("giveaway_id")
|
||||
.setDescription(client.translate("moderation/giveaway:GIVEAWAY_ID"))
|
||||
.setDescriptionLocalizations({
|
||||
uk: client.translate("moderation/giveaway:GIVEAWAY_ID", null, "uk-UA"),
|
||||
ru: client.translate("moderation/giveaway:GIVEAWAY_ID", null, "ru-RU"),
|
||||
})
|
||||
.setRequired(true),
|
||||
),
|
||||
),
|
||||
aliases: [],
|
||||
dirname: __dirname,
|
||||
|
@ -129,44 +158,49 @@ class Giveaway extends BaseCommand {
|
|||
const prize = interaction.options.getString("prize");
|
||||
const isdrop = interaction.options.getBoolean("isdrop");
|
||||
|
||||
client.giveawaysManager.start(interaction.channel, {
|
||||
duration: ms(duration),
|
||||
winnerCount: winnersCount,
|
||||
prize: prize,
|
||||
hostedBy: interaction.user,
|
||||
isDrop: isdrop,
|
||||
messages: {
|
||||
giveaway: interaction.translate("moderation/giveaway:TITLE"),
|
||||
giveawayEnded: interaction.translate("moderation/giveaway:ENDED"),
|
||||
timeRemaining: interaction.translate("moderation/giveaway:TIME_REMAINING"),
|
||||
inviteToParticipate: interaction.translate("moderation/giveaway:INVITE_PARTICIPATE"),
|
||||
winMessage: interaction.translate("moderation/giveaway:WIN_MESSAGE"),
|
||||
drawing: interaction.translate("moderation/giveaway:DRAWING"),
|
||||
dropMessage: interaction.translate("moderation/giveaway:DROP"),
|
||||
embedFooter: interaction.translate("moderation/giveaway:FOOTER"),
|
||||
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"),
|
||||
},
|
||||
}).then(() => {
|
||||
return interaction.success("moderation/giveaway:GIVEAWAY_CREATED", null, { ephemeral: true });
|
||||
});
|
||||
client.giveawaysManager
|
||||
.start(interaction.channel, {
|
||||
duration: ms(duration),
|
||||
winnerCount: winnersCount,
|
||||
prize: prize,
|
||||
hostedBy: interaction.user,
|
||||
isDrop: isdrop,
|
||||
messages: {
|
||||
giveaway: interaction.translate("moderation/giveaway:TITLE"),
|
||||
giveawayEnded: interaction.translate("moderation/giveaway:ENDED"),
|
||||
timeRemaining: interaction.translate("moderation/giveaway:TIME_REMAINING"),
|
||||
inviteToParticipate: interaction.translate("moderation/giveaway:INVITE_PARTICIPATE"),
|
||||
winMessage: interaction.translate("moderation/giveaway:WIN_MESSAGE"),
|
||||
drawing: interaction.translate("moderation/giveaway:DRAWING"),
|
||||
dropMessage: interaction.translate("moderation/giveaway:DROP"),
|
||||
embedFooter: interaction.translate("moderation/giveaway:FOOTER"),
|
||||
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"),
|
||||
},
|
||||
})
|
||||
.then(() => {
|
||||
return interaction.success("moderation/giveaway:GIVEAWAY_CREATED", null, { ephemeral: true });
|
||||
});
|
||||
} else if (command === "reroll") {
|
||||
const giveaway_id = interaction.options.getString("giveaway_id");
|
||||
|
||||
client.giveawaysManager.reroll(giveaway_id, {
|
||||
messages: {
|
||||
congrat: interaction.translate("moderation/giveaway:REROLL_CONGRAT"),
|
||||
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,
|
||||
}, { ephemeral: true });
|
||||
});
|
||||
client.giveawaysManager
|
||||
.reroll(giveaway_id, {
|
||||
messages: {
|
||||
congrat: interaction.translate("moderation/giveaway:REROLL_CONGRAT"),
|
||||
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,
|
||||
}, { ephemeral: true });
|
||||
});
|
||||
} else if (command === "end") {
|
||||
const giveaway_id = interaction.options.getString("giveaway_id");
|
||||
|
||||
|
@ -181,13 +215,16 @@ class Giveaway extends BaseCommand {
|
|||
} else if (command === "delete") {
|
||||
const giveaway_id = interaction.options.getString("giveaway_id");
|
||||
|
||||
client.giveawaysManager.delete(giveaway_id).then(() => {
|
||||
return interaction.success("moderation/giveaway:GIVEAWAY_DELETED");
|
||||
}).catch(() => {
|
||||
return interaction.error("moderation/giveaway:NOT_FOUND", {
|
||||
messageId: giveaway_id,
|
||||
}, { ephemeral: true });
|
||||
});
|
||||
client.giveawaysManager
|
||||
.delete(giveaway_id)
|
||||
.then(() => {
|
||||
return interaction.success("moderation/giveaway:GIVEAWAY_DELETED");
|
||||
})
|
||||
.catch(() => {
|
||||
return interaction.error("moderation/giveaway:NOT_FOUND", {
|
||||
messageId: giveaway_id,
|
||||
}, { ephemeral: true });
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,18 +12,21 @@ class Poll extends BaseCommand {
|
|||
.setName("poll")
|
||||
.setDescription(client.translate("moderation/poll:DESCRIPTION"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("moderation/poll:DESCRIPTION", null, "uk-UA"),
|
||||
"ru": client.translate("moderation/poll:DESCRIPTION", null, "ru-RU"),
|
||||
uk: client.translate("moderation/poll:DESCRIPTION", null, "uk-UA"),
|
||||
ru: client.translate("moderation/poll:DESCRIPTION", null, "ru-RU"),
|
||||
})
|
||||
.setDMPermission(false)
|
||||
.setDefaultMemberPermissions(PermissionsBitField.Flags.ManageMessages)
|
||||
.addStringOption(option => option.setName("question")
|
||||
.setDescription(client.translate("moderation/poll:QUESTION"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("moderation/poll:QUESTION", null, "uk-UA"),
|
||||
"ru": client.translate("moderation/poll:QUESTION", null, "ru-RU"),
|
||||
})
|
||||
.setRequired(true)),
|
||||
.addStringOption(option =>
|
||||
option
|
||||
.setName("question")
|
||||
.setDescription(client.translate("moderation/poll:QUESTION"))
|
||||
.setDescriptionLocalizations({
|
||||
uk: client.translate("moderation/poll:QUESTION", null, "uk-UA"),
|
||||
ru: client.translate("moderation/poll:QUESTION", null, "ru-RU"),
|
||||
})
|
||||
.setRequired(true),
|
||||
),
|
||||
aliases: [],
|
||||
dirname: __dirname,
|
||||
ownerOnly: false,
|
||||
|
@ -45,26 +48,12 @@ class Poll extends BaseCommand {
|
|||
async execute(client, interaction) {
|
||||
const question = interaction.options.getString("question");
|
||||
|
||||
const row = new ActionRowBuilder()
|
||||
.addComponents(
|
||||
new ButtonBuilder()
|
||||
.setCustomId("poll_everyone")
|
||||
.setLabel("@everyone")
|
||||
.setStyle(ButtonStyle.Primary),
|
||||
new ButtonBuilder()
|
||||
.setCustomId("poll_here")
|
||||
.setLabel("@here")
|
||||
.setStyle(ButtonStyle.Primary),
|
||||
new ButtonBuilder()
|
||||
.setCustomId("poll_nothing")
|
||||
.setLabel(interaction.translate("moderation/poll:NOTHING"))
|
||||
.setStyle(ButtonStyle.Primary),
|
||||
new ButtonBuilder()
|
||||
.setCustomId("poll_cancel")
|
||||
.setLabel(interaction.translate("common:CANCEL"))
|
||||
.setStyle(ButtonStyle.Danger),
|
||||
);
|
||||
|
||||
const row = new ActionRowBuilder().addComponents(
|
||||
new ButtonBuilder().setCustomId("poll_everyone").setLabel("@everyone").setStyle(ButtonStyle.Primary),
|
||||
new ButtonBuilder().setCustomId("poll_here").setLabel("@here").setStyle(ButtonStyle.Primary),
|
||||
new ButtonBuilder().setCustomId("poll_nothing").setLabel(interaction.translate("moderation/poll:NOTHING")).setStyle(ButtonStyle.Primary),
|
||||
new ButtonBuilder().setCustomId("poll_cancel").setLabel(interaction.translate("common:CANCEL")).setStyle(ButtonStyle.Danger),
|
||||
);
|
||||
|
||||
await interaction.reply({
|
||||
content: interaction.translate("moderation/poll:SELECT_MENTION"),
|
||||
|
@ -74,7 +63,7 @@ class Poll extends BaseCommand {
|
|||
|
||||
let mention = null;
|
||||
const filter = i => i.user.id === interaction.user.id;
|
||||
const collector = interaction.channel.createMessageComponentCollector({ filter, idle: (15 * 1000) });
|
||||
const collector = interaction.channel.createMessageComponentCollector({ filter, idle: 15 * 1000 });
|
||||
|
||||
collector.on("collect", async i => {
|
||||
if (i.isButton()) {
|
||||
|
|
|
@ -12,18 +12,21 @@ class Unban extends BaseCommand {
|
|||
.setName("unban")
|
||||
.setDescription(client.translate("moderation/unban:DESCRIPTION"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("moderation/unban:DESCRIPTION", null, "uk-UA"),
|
||||
"ru": client.translate("moderation/unban:DESCRIPTION", null, "ru-RU"),
|
||||
uk: client.translate("moderation/unban:DESCRIPTION", null, "uk-UA"),
|
||||
ru: client.translate("moderation/unban:DESCRIPTION", null, "ru-RU"),
|
||||
})
|
||||
.setDMPermission(false)
|
||||
.setDefaultMemberPermissions(PermissionsBitField.Flags.ManageMessages)
|
||||
.addStringOption(option => option.setName("user_id")
|
||||
.setDescription(client.translate("common:USER_ID"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("common:USER_ID", null, "uk-UA"),
|
||||
"ru": client.translate("common:USER_ID", null, "ru-RU"),
|
||||
})
|
||||
.setRequired(true)),
|
||||
.addStringOption(option =>
|
||||
option
|
||||
.setName("user_id")
|
||||
.setDescription(client.translate("common:USER_ID"))
|
||||
.setDescriptionLocalizations({
|
||||
uk: client.translate("common:USER_ID", null, "uk-UA"),
|
||||
ru: client.translate("common:USER_ID", null, "ru-RU"),
|
||||
})
|
||||
.setRequired(true),
|
||||
),
|
||||
aliases: [],
|
||||
dirname: __dirname,
|
||||
ownerOnly: false,
|
||||
|
|
|
@ -8,11 +8,7 @@ class Warn extends BaseCommand {
|
|||
*/
|
||||
constructor() {
|
||||
super({
|
||||
command: new ContextMenuCommandBuilder()
|
||||
.setName("warn")
|
||||
.setType(ApplicationCommandType.User)
|
||||
.setDMPermission(false)
|
||||
.setDefaultMemberPermissions(PermissionsBitField.Flags.ManageMessages),
|
||||
command: new ContextMenuCommandBuilder().setName("warn").setType(ApplicationCommandType.User).setDMPermission(false).setDefaultMemberPermissions(PermissionsBitField.Flags.ManageMessages),
|
||||
aliases: [],
|
||||
dirname: __dirname,
|
||||
ownerOnly: false,
|
||||
|
@ -47,7 +43,9 @@ class Warn extends BaseCommand {
|
|||
|
||||
const modal = new ModalBuilder()
|
||||
.setCustomId("warn_modal")
|
||||
.setTitle(interaction.translate("moderation/warn:MODAL_TITLE", { nickname: member.user.getUsername() }).normalize("NFKD"));
|
||||
.setTitle(interaction.translate("moderation/warn:MODAL_TITLE", {
|
||||
nickname: member.user.getUsername(),
|
||||
}).normalize("NFKD"));
|
||||
|
||||
const reasonInput = new TextInputBuilder()
|
||||
.setCustomId("warn_reason")
|
||||
|
@ -61,15 +59,17 @@ class Warn extends BaseCommand {
|
|||
|
||||
await interaction.showModal(modal);
|
||||
|
||||
const submitted = await interaction.awaitModalSubmit({
|
||||
time: (2 * 60 * 1000),
|
||||
filter: i => i.user.id === interaction.member.id && i.customId === "warn_modal",
|
||||
}).catch(() => {
|
||||
interaction.followUp({
|
||||
content: interaction.translate("misc:TIMED_OUT"),
|
||||
ephemeral: true,
|
||||
const submitted = await interaction
|
||||
.awaitModalSubmit({
|
||||
time: 2 * 60 * 1000,
|
||||
filter: i => i.user.id === interaction.member.id && i.customId === "warn_modal",
|
||||
})
|
||||
.catch(() => {
|
||||
interaction.followUp({
|
||||
content: interaction.translate("misc:TIMED_OUT"),
|
||||
ephemeral: true,
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
if (submitted) {
|
||||
const reason = submitted.fields.getTextInputValue("warn_reason");
|
||||
|
@ -85,22 +85,21 @@ class Warn extends BaseCommand {
|
|||
reason,
|
||||
};
|
||||
|
||||
const embed = new EmbedBuilder()
|
||||
.addFields([
|
||||
{
|
||||
name: interaction.translate("common:USER"),
|
||||
value: `\`${member.user.getUsername()}\` (${member.user.toString()})`,
|
||||
},
|
||||
{
|
||||
name: interaction.translate("common:MODERATOR"),
|
||||
value: `\`${interaction.user.getUsername()}\` (${interaction.user.toString()})`,
|
||||
},
|
||||
{
|
||||
name: interaction.translate("common:REASON"),
|
||||
value: reason,
|
||||
inline: true,
|
||||
},
|
||||
]);
|
||||
const embed = new EmbedBuilder().addFields([
|
||||
{
|
||||
name: interaction.translate("common:USER"),
|
||||
value: `\`${member.user.getUsername()}\` (${member.user.toString()})`,
|
||||
},
|
||||
{
|
||||
name: interaction.translate("common:MODERATOR"),
|
||||
value: `\`${interaction.user.getUsername()}\` (${interaction.user.toString()})`,
|
||||
},
|
||||
{
|
||||
name: interaction.translate("common:REASON"),
|
||||
value: reason,
|
||||
inline: true,
|
||||
},
|
||||
]);
|
||||
/*
|
||||
if (banCount) {
|
||||
if (sanctions >= banCount) {
|
||||
|
|
|
@ -12,18 +12,21 @@ class Warns extends BaseCommand {
|
|||
.setName("warns")
|
||||
.setDescription(client.translate("moderation/warns:DESCRIPTION"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("moderation/warns:DESCRIPTION", null, "uk-UA"),
|
||||
"ru": client.translate("moderation/warns:DESCRIPTION", null, "ru-RU"),
|
||||
uk: client.translate("moderation/warns:DESCRIPTION", null, "uk-UA"),
|
||||
ru: client.translate("moderation/warns:DESCRIPTION", null, "ru-RU"),
|
||||
})
|
||||
.setDMPermission(false)
|
||||
.setDefaultMemberPermissions(PermissionsBitField.Flags.ManageMessages)
|
||||
.addUserOption(option => option.setName("user")
|
||||
.setDescription(client.translate("common:USER"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("common:USER", null, "uk-UA"),
|
||||
"ru": client.translate("common:USER", null, "ru-RU"),
|
||||
})
|
||||
.setRequired(true)),
|
||||
.addUserOption(option =>
|
||||
option
|
||||
.setName("user")
|
||||
.setDescription(client.translate("common:USER"))
|
||||
.setDescriptionLocalizations({
|
||||
uk: client.translate("common:USER", null, "uk-UA"),
|
||||
ru: client.translate("common:USER", null, "ru-RU"),
|
||||
})
|
||||
.setRequired(true),
|
||||
),
|
||||
aliases: [],
|
||||
dirname: __dirname,
|
||||
ownerOnly: false,
|
||||
|
@ -56,10 +59,7 @@ class Warns extends BaseCommand {
|
|||
name: interaction.translate("moderation/warns:SANCTIONS_OF", {
|
||||
member: member.user.getUsername(),
|
||||
}),
|
||||
iconURL: member.displayAvatarURL({
|
||||
extension: "png",
|
||||
size: 512,
|
||||
}),
|
||||
iconURL: member.displayAvatarURL(),
|
||||
})
|
||||
.setColor(client.config.embed.color)
|
||||
.setFooter({
|
||||
|
@ -67,9 +67,11 @@ class Warns extends BaseCommand {
|
|||
});
|
||||
|
||||
if (memberData.sanctions.length === 0) {
|
||||
embed.setDescription(interaction.translate("moderation/warns:NO_SANCTIONS", {
|
||||
member: member.user.getUsername(),
|
||||
}));
|
||||
embed.setDescription(
|
||||
interaction.translate("moderation/warns:NO_SANCTIONS", {
|
||||
member: member.user.getUsername(),
|
||||
}),
|
||||
);
|
||||
return interaction.reply({
|
||||
embeds: [embed],
|
||||
});
|
||||
|
@ -84,6 +86,7 @@ class Warns extends BaseCommand {
|
|||
]);
|
||||
});
|
||||
}
|
||||
|
||||
interaction.reply({
|
||||
embeds: [embed],
|
||||
});
|
||||
|
|
|
@ -12,8 +12,8 @@ class Back extends BaseCommand {
|
|||
.setName("back")
|
||||
.setDescription(client.translate("music/back:DESCRIPTION"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("music/back:DESCRIPTION", null, "uk-UA"),
|
||||
"ru": client.translate("music/back:DESCRIPTION", null, "ru-RU"),
|
||||
uk: client.translate("music/back:DESCRIPTION", null, "uk-UA"),
|
||||
ru: client.translate("music/back:DESCRIPTION", null, "ru-RU"),
|
||||
})
|
||||
.setDMPermission(false),
|
||||
aliases: [],
|
||||
|
|
|
@ -14,18 +14,21 @@ class Clips extends BaseCommand {
|
|||
.setName("clips")
|
||||
.setDescription(client.translate("music/clips:DESCRIPTION"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("music/clips:DESCRIPTION", null, "uk-UA"),
|
||||
"ru": client.translate("music/clips:DESCRIPTION", null, "ru-RU"),
|
||||
uk: client.translate("music/clips:DESCRIPTION", null, "uk-UA"),
|
||||
ru: client.translate("music/clips:DESCRIPTION", null, "ru-RU"),
|
||||
})
|
||||
.setDMPermission(false)
|
||||
.addStringOption(option => option.setName("query")
|
||||
.setDescription(client.translate("music/clips:QUERY"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("music/clips:QUERY", null, "uk-UA"),
|
||||
"ru": client.translate("music/clips:QUERY", null, "ru-RU"),
|
||||
})
|
||||
.setRequired(true)
|
||||
.setAutocomplete(true)),
|
||||
.addStringOption(option =>
|
||||
option
|
||||
.setName("query")
|
||||
.setDescription(client.translate("music/clips:QUERY"))
|
||||
.setDescriptionLocalizations({
|
||||
uk: client.translate("music/clips:QUERY", null, "uk-UA"),
|
||||
ru: client.translate("music/clips:QUERY", null, "ru-RU"),
|
||||
})
|
||||
.setRequired(true)
|
||||
.setAutocomplete(true),
|
||||
),
|
||||
aliases: [],
|
||||
dirname: __dirname,
|
||||
ownerOnly: false,
|
||||
|
@ -92,8 +95,8 @@ class Clips extends BaseCommand {
|
|||
results.slice(0, 25).map(file => ({
|
||||
name: file.substring(0, file.length - 4),
|
||||
value: `./clips/${file}`,
|
||||
}),
|
||||
));
|
||||
})),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -13,23 +13,26 @@ class Loop extends BaseCommand {
|
|||
.setName("loop")
|
||||
.setDescription(client.translate("music/loop:DESCRIPTION"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("music/loop:DESCRIPTION", null, "uk-UA"),
|
||||
"ru": client.translate("music/loop:DESCRIPTION", null, "ru-RU"),
|
||||
uk: client.translate("music/loop:DESCRIPTION", null, "uk-UA"),
|
||||
ru: client.translate("music/loop:DESCRIPTION", null, "ru-RU"),
|
||||
})
|
||||
.setDMPermission(false)
|
||||
.addStringOption(option => option.setName("option")
|
||||
.setDescription(client.translate("music/loop:OPTION"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("music/loop:OPTION", null, "uk-UA"),
|
||||
"ru": client.translate("music/loop:OPTION", null, "ru-RU"),
|
||||
})
|
||||
.setRequired(true)
|
||||
.setChoices(
|
||||
{ name: client.translate("music/loop:AUTOPLAY"), value: "3" },
|
||||
{ name: client.translate("music/loop:QUEUE"), value: "2" },
|
||||
{ name: client.translate("music/loop:TRACK"), value: "1" },
|
||||
{ name: client.translate("music/loop:DISABLE"), value: "0" },
|
||||
)),
|
||||
.addStringOption(option =>
|
||||
option
|
||||
.setName("option")
|
||||
.setDescription(client.translate("music/loop:OPTION"))
|
||||
.setDescriptionLocalizations({
|
||||
uk: client.translate("music/loop:OPTION", null, "uk-UA"),
|
||||
ru: client.translate("music/loop:OPTION", null, "ru-RU"),
|
||||
})
|
||||
.setRequired(true)
|
||||
.setChoices(
|
||||
{ name: client.translate("music/loop:AUTOPLAY"), value: "3" },
|
||||
{ name: client.translate("music/loop:QUEUE"), value: "2" },
|
||||
{ name: client.translate("music/loop:TRACK"), value: "1" },
|
||||
{ name: client.translate("music/loop:DISABLE"), value: "0" },
|
||||
),
|
||||
),
|
||||
aliases: [],
|
||||
dirname: __dirname,
|
||||
ownerOnly: false,
|
||||
|
@ -56,17 +59,11 @@ class Loop extends BaseCommand {
|
|||
if (!queue) return interaction.error("music/play:NOT_PLAYING", null, { edit: true });
|
||||
|
||||
const type = interaction.options.getString("option"),
|
||||
mode = type === "3" ? QueueRepeatMode.AUTOPLAY :
|
||||
type === "2" ? QueueRepeatMode.QUEUE :
|
||||
type === "1" ? QueueRepeatMode.TRACK : QueueRepeatMode.OFF;
|
||||
mode = type === "3" ? QueueRepeatMode.AUTOPLAY : type === "2" ? QueueRepeatMode.QUEUE : type === "1" ? QueueRepeatMode.TRACK : QueueRepeatMode.OFF;
|
||||
|
||||
queue.setRepeatMode(mode);
|
||||
|
||||
interaction.success(`music/loop:${
|
||||
type === "3" ? "AUTOPLAY_ENABLED" :
|
||||
type === "2" ? "QUEUE_ENABLED" :
|
||||
type === "1" ? "TRACK_ENABLED" : "LOOP_DISABLED"
|
||||
}`);
|
||||
interaction.success(`music/loop:${type === "3" ? "AUTOPLAY_ENABLED" : type === "2" ? "QUEUE_ENABLED" : type === "1" ? "TRACK_ENABLED" : "LOOP_DISABLED"}`);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -13,8 +13,8 @@ class Nowplaying extends BaseCommand {
|
|||
.setName("nowplaying")
|
||||
.setDescription(client.translate("music/nowplaying:DESCRIPTION"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("music/nowplaying:DESCRIPTION", null, "uk-UA"),
|
||||
"ru": client.translate("music/nowplaying:DESCRIPTION", null, "ru-RU"),
|
||||
uk: client.translate("music/nowplaying:DESCRIPTION", null, "uk-UA"),
|
||||
ru: client.translate("music/nowplaying:DESCRIPTION", null, "ru-RU"),
|
||||
})
|
||||
.setDMPermission(false),
|
||||
aliases: [],
|
||||
|
@ -77,9 +77,13 @@ class Nowplaying extends BaseCommand {
|
|||
{
|
||||
name: "\u200b",
|
||||
value: `${interaction.translate("music/nowplaying:REPEAT")}: \`${
|
||||
queue.repeatMode === QueueRepeatMode.AUTOPLAY ? interaction.translate("music/nowplaying:AUTOPLAY") :
|
||||
queue.repeatMode === QueueRepeatMode.QUEUE ? interaction.translate("music/nowplaying:QUEUE") :
|
||||
queue.repeatMode === QueueRepeatMode.TRACK ? interaction.translate("music/nowplaying:TRACK") : interaction.translate("common:DISABLED")
|
||||
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")
|
||||
}\``,
|
||||
},
|
||||
])
|
||||
|
|
|
@ -12,18 +12,21 @@ class Play extends BaseCommand {
|
|||
.setName("play")
|
||||
.setDescription(client.translate("music/play:DESCRIPTION"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("music/play:DESCRIPTION", null, "uk-UA"),
|
||||
"ru": client.translate("music/play:DESCRIPTION", null, "ru-RU"),
|
||||
uk: client.translate("music/play:DESCRIPTION", null, "uk-UA"),
|
||||
ru: client.translate("music/play:DESCRIPTION", null, "ru-RU"),
|
||||
})
|
||||
.setDMPermission(false)
|
||||
.addStringOption(option => option.setName("query")
|
||||
.setDescription(client.translate("music/play:QUERY"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("music/play:QUERY", null, "uk-UA"),
|
||||
"ru": client.translate("music/play:QUERY", null, "ru-RU"),
|
||||
})
|
||||
.setRequired(true)
|
||||
.setAutocomplete(true)),
|
||||
.addStringOption(option =>
|
||||
option
|
||||
.setName("query")
|
||||
.setDescription(client.translate("music/play:QUERY"))
|
||||
.setDescriptionLocalizations({
|
||||
uk: client.translate("music/play:QUERY", null, "uk-UA"),
|
||||
ru: client.translate("music/play:QUERY", null, "ru-RU"),
|
||||
})
|
||||
.setRequired(true)
|
||||
.setAutocomplete(true),
|
||||
),
|
||||
aliases: [],
|
||||
dirname: __dirname,
|
||||
ownerOnly: false,
|
||||
|
@ -96,10 +99,10 @@ class Play extends BaseCommand {
|
|||
|
||||
return interaction.respond(
|
||||
results.tracks.slice(0, 10).map(track => ({
|
||||
name: (`${track.author} - ${track.title}`.length >= 100 & `${track.author} - ${track.title}`.slice(0, 90) + "...") || `${track.author} - ${track.title}`,
|
||||
name: (`${track.author} - ${track.title}`.length >= 100) & (`${track.author} - ${track.title}`.slice(0, 90) + "...") || `${track.author} - ${track.title}`,
|
||||
value: track.url,
|
||||
}),
|
||||
));
|
||||
})),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -13,8 +13,8 @@ class Queue extends BaseCommand {
|
|||
.setName("queue")
|
||||
.setDescription(client.translate("music/queue:DESCRIPTION"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("music/queue:DESCRIPTION", null, "uk-UA"),
|
||||
"ru": client.translate("music/queue:DESCRIPTION", null, "ru-RU"),
|
||||
uk: client.translate("music/queue:DESCRIPTION", null, "uk-UA"),
|
||||
ru: client.translate("music/queue:DESCRIPTION", null, "ru-RU"),
|
||||
})
|
||||
.setDMPermission(false),
|
||||
aliases: [],
|
||||
|
@ -42,29 +42,12 @@ class Queue extends BaseCommand {
|
|||
let currentPage = 0;
|
||||
let embeds = generateQueueEmbeds(interaction, queue);
|
||||
|
||||
const row = new ActionRowBuilder()
|
||||
.addComponents(
|
||||
new ButtonBuilder()
|
||||
.setCustomId("queue_prev_page")
|
||||
.setLabel(interaction.translate("music/queue:PREV_PAGE"))
|
||||
.setStyle(ButtonStyle.Primary)
|
||||
.setEmoji("⬅️"),
|
||||
new ButtonBuilder()
|
||||
.setCustomId("queue_next_page")
|
||||
.setLabel(interaction.translate("music/queue:NEXT_PAGE"))
|
||||
.setStyle(ButtonStyle.Primary)
|
||||
.setEmoji("➡️"),
|
||||
new ButtonBuilder()
|
||||
.setCustomId("queue_jump_page")
|
||||
.setLabel(interaction.translate("music/queue:JUMP_PAGE"))
|
||||
.setStyle(ButtonStyle.Secondary)
|
||||
.setEmoji("↗️"),
|
||||
new ButtonBuilder()
|
||||
.setCustomId("queue_stop")
|
||||
.setLabel(interaction.translate("common:CANCEL"))
|
||||
.setStyle(ButtonStyle.Danger)
|
||||
.setEmoji("⏹️"),
|
||||
);
|
||||
const row = new ActionRowBuilder().addComponents(
|
||||
new ButtonBuilder().setCustomId("queue_prev_page").setLabel(interaction.translate("music/queue:PREV_PAGE")).setStyle(ButtonStyle.Primary).setEmoji("⬅️"),
|
||||
new ButtonBuilder().setCustomId("queue_next_page").setLabel(interaction.translate("music/queue:NEXT_PAGE")).setStyle(ButtonStyle.Primary).setEmoji("➡️"),
|
||||
new ButtonBuilder().setCustomId("queue_jump_page").setLabel(interaction.translate("music/queue:JUMP_PAGE")).setStyle(ButtonStyle.Secondary).setEmoji("↗️"),
|
||||
new ButtonBuilder().setCustomId("queue_stop").setLabel(interaction.translate("common:CANCEL")).setStyle(ButtonStyle.Danger).setEmoji("⏹️"),
|
||||
);
|
||||
|
||||
await interaction.reply({
|
||||
content: `${interaction.translate("common:PAGE")}: **${currentPage + 1}**/**${embeds.length}**`,
|
||||
|
@ -73,7 +56,7 @@ class Queue extends BaseCommand {
|
|||
});
|
||||
|
||||
const filter = i => i.user.id === interaction.user.id;
|
||||
const collector = interaction.channel.createMessageComponentCollector({ filter, idle: (20 * 1000) });
|
||||
const collector = interaction.channel.createMessageComponentCollector({ filter, idle: 20 * 1000 });
|
||||
|
||||
collector.on("collect", async i => {
|
||||
if (i.isButton()) {
|
||||
|
@ -116,7 +99,7 @@ class Queue extends BaseCommand {
|
|||
return res.author.id === interaction.user.id && !isNaN(res.content);
|
||||
};
|
||||
|
||||
interaction.channel.awaitMessages({ filter, max: 1, time: (10 * 1000) }).then(collected => {
|
||||
interaction.channel.awaitMessages({ filter, max: 1, time: 10 * 1000 }).then(collected => {
|
||||
if (embeds[collected.first().content - 1]) {
|
||||
currentPage = collected.first().content - 1;
|
||||
interaction.editReply({
|
||||
|
@ -168,11 +151,19 @@ function generateQueueEmbeds(interaction, queue) {
|
|||
.setTitle(interaction.translate("music/nowplaying:CURRENTLY_PLAYING"))
|
||||
.setThumbnail(currentTrack.thumbnail)
|
||||
.setColor(interaction.client.config.embed.color)
|
||||
.setDescription(`${interaction.translate("music/nowplaying:REPEAT")}: \`${
|
||||
queue.repeatMode === QueueRepeatMode.AUTOPLAY ? interaction.translate("music/nowplaying:AUTOPLAY") :
|
||||
queue.repeatMode === QueueRepeatMode.QUEUE ? interaction.translate("music/nowplaying:QUEUE") :
|
||||
queue.repeatMode === QueueRepeatMode.TRACK ? interaction.translate("music/nowplaying:TRACK") : interaction.translate("common:DISABLED")
|
||||
}\`\n${currentTrack.url.startsWith("./clips") ? `${currentTrack.title} (clips)` : `[${currentTrack.title}](${currentTrack.url})`}\n> ${interaction.translate("music/queue:ADDED")} ${currentTrack.requestedBy}\n\n**${interaction.translate("music/queue:NEXT")}**\n${interaction.translate("music/queue:NO_QUEUE")}`)
|
||||
.setDescription(
|
||||
`${interaction.translate("music/nowplaying:REPEAT")}: \`${
|
||||
queue.repeatMode === QueueRepeatMode.AUTOPLAY
|
||||
? interaction.translate("music/nowplaying:AUTOPLAY")
|
||||
: queue.repeatMode === QueueRepeatMode.QUEUE
|
||||
? interaction.translate("music/nowplaying:QUEUE")
|
||||
: queue.repeatMode === QueueRepeatMode.TRACK
|
||||
? interaction.translate("music/nowplaying:TRACK")
|
||||
: interaction.translate("common:DISABLED")
|
||||
}\`\n${currentTrack.url.startsWith("./clips") ? `${currentTrack.title} (clips)` : `[${currentTrack.title}](${currentTrack.url})`}\n> ${interaction.translate("music/queue:ADDED")} ${
|
||||
currentTrack.requestedBy
|
||||
}\n\n**${interaction.translate("music/queue:NEXT")}**\n${interaction.translate("music/queue:NO_QUEUE")}`,
|
||||
)
|
||||
.setTimestamp();
|
||||
embeds.push(embed);
|
||||
|
||||
|
@ -190,11 +181,19 @@ function generateQueueEmbeds(interaction, queue) {
|
|||
.setTitle(interaction.translate("music/nowplaying:CURRENTLY_PLAYING"))
|
||||
.setThumbnail(currentTrack.thumbnail)
|
||||
.setColor(interaction.client.config.embed.color)
|
||||
.setDescription(`${interaction.translate("music/nowplaying:REPEAT")}: \`${
|
||||
queue.repeatMode === QueueRepeatMode.AUTOPLAY ? interaction.translate("music/nowplaying:AUTOPLAY") :
|
||||
queue.repeatMode === QueueRepeatMode.QUEUE ? interaction.translate("music/nowplaying:QUEUE") :
|
||||
queue.repeatMode === QueueRepeatMode.TRACK ? interaction.translate("music/nowplaying:TRACK") : interaction.translate("common:DISABLED")
|
||||
}\`\n${currentTrack.url.startsWith("./clips") ? `${currentTrack.title} (clips)` : `[${currentTrack.title}](${currentTrack.url})`}\n> ${interaction.translate("music/queue:ADDED")} ${currentTrack.requestedBy}\n\n**${interaction.translate("music/queue:NEXT")}**\n${info}`)
|
||||
.setDescription(
|
||||
`${interaction.translate("music/nowplaying:REPEAT")}: \`${
|
||||
queue.repeatMode === QueueRepeatMode.AUTOPLAY
|
||||
? interaction.translate("music/nowplaying:AUTOPLAY")
|
||||
: queue.repeatMode === QueueRepeatMode.QUEUE
|
||||
? interaction.translate("music/nowplaying:QUEUE")
|
||||
: queue.repeatMode === QueueRepeatMode.TRACK
|
||||
? interaction.translate("music/nowplaying:TRACK")
|
||||
: interaction.translate("common:DISABLED")
|
||||
}\`\n${currentTrack.url.startsWith("./clips") ? `${currentTrack.title} (clips)` : `[${currentTrack.title}](${currentTrack.url})`}\n> ${interaction.translate("music/queue:ADDED")} ${
|
||||
currentTrack.requestedBy
|
||||
}\n\n**${interaction.translate("music/queue:NEXT")}**\n${info}`,
|
||||
)
|
||||
.setTimestamp();
|
||||
embeds.push(embed);
|
||||
}
|
||||
|
|
|
@ -12,16 +12,19 @@ class Seek extends BaseCommand {
|
|||
.setName("seek")
|
||||
.setDescription(client.translate("music/seek:DESCRIPTION"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("music/seek:DESCRIPTION", null, "uk-UA"),
|
||||
"ru": client.translate("music/seek:DESCRIPTION", null, "ru-RU"),
|
||||
uk: client.translate("music/seek:DESCRIPTION", null, "uk-UA"),
|
||||
ru: client.translate("music/seek:DESCRIPTION", null, "ru-RU"),
|
||||
})
|
||||
.addIntegerOption(option => option.setName("time")
|
||||
.setDescription(client.translate("music/seek:TIME"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("music/seek:TIME", null, "uk-UA"),
|
||||
"ru": client.translate("music/seek:TIME", null, "ru-RU"),
|
||||
})
|
||||
.setRequired(true)),
|
||||
.addIntegerOption(option =>
|
||||
option
|
||||
.setName("time")
|
||||
.setDescription(client.translate("music/seek:TIME"))
|
||||
.setDescriptionLocalizations({
|
||||
uk: client.translate("music/seek:TIME", null, "uk-UA"),
|
||||
ru: client.translate("music/seek:TIME", null, "ru-RU"),
|
||||
})
|
||||
.setRequired(true),
|
||||
),
|
||||
aliases: [],
|
||||
dirname: __dirname,
|
||||
ownerOnly: false,
|
||||
|
|
|
@ -12,8 +12,8 @@ class Shuffle extends BaseCommand {
|
|||
.setName("shuffle")
|
||||
.setDescription(client.translate("music/shuffle:DESCRIPTION"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("music/shuffle:DESCRIPTION", null, "uk-UA"),
|
||||
"ru": client.translate("music/shuffle:DESCRIPTION", null, "ru-RU"),
|
||||
uk: client.translate("music/shuffle:DESCRIPTION", null, "uk-UA"),
|
||||
ru: client.translate("music/shuffle:DESCRIPTION", null, "ru-RU"),
|
||||
})
|
||||
.setDMPermission(false),
|
||||
aliases: [],
|
||||
|
|
|
@ -12,8 +12,8 @@ class Skip extends BaseCommand {
|
|||
.setName("skip")
|
||||
.setDescription(client.translate("music/skip:DESCRIPTION"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("music/skip:DESCRIPTION", null, "uk-UA"),
|
||||
"ru": client.translate("music/skip:DESCRIPTION", null, "ru-RU"),
|
||||
uk: client.translate("music/skip:DESCRIPTION", null, "uk-UA"),
|
||||
ru: client.translate("music/skip:DESCRIPTION", null, "ru-RU"),
|
||||
})
|
||||
.setDMPermission(false),
|
||||
aliases: [],
|
||||
|
|
|
@ -12,17 +12,20 @@ class Skipto extends BaseCommand {
|
|||
.setName("skipto")
|
||||
.setDescription(client.translate("music/skipto:DESCRIPTION"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("music/skipto:DESCRIPTION", null, "uk-UA"),
|
||||
"ru": client.translate("music/skipto:DESCRIPTION", null, "ru-RU"),
|
||||
uk: client.translate("music/skipto:DESCRIPTION", null, "uk-UA"),
|
||||
ru: client.translate("music/skipto:DESCRIPTION", null, "ru-RU"),
|
||||
})
|
||||
.setDMPermission(false)
|
||||
.addIntegerOption(option => option.setName("position")
|
||||
.setDescription(client.translate("music/skipto:POSITION"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("music/skipto:POSITION", null, "uk-UA"),
|
||||
"ru": client.translate("music/skipto:POSITION", null, "ru-RU"),
|
||||
})
|
||||
.setRequired(true)),
|
||||
.addIntegerOption(option =>
|
||||
option
|
||||
.setName("position")
|
||||
.setDescription(client.translate("music/skipto:POSITION"))
|
||||
.setDescriptionLocalizations({
|
||||
uk: client.translate("music/skipto:POSITION", null, "uk-UA"),
|
||||
ru: client.translate("music/skipto:POSITION", null, "ru-RU"),
|
||||
})
|
||||
.setRequired(true),
|
||||
),
|
||||
aliases: [],
|
||||
dirname: __dirname,
|
||||
ownerOnly: false,
|
||||
|
|
|
@ -12,8 +12,8 @@ class Stop extends BaseCommand {
|
|||
.setName("stop")
|
||||
.setDescription(client.translate("music/stop:DESCRIPTION"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("music/stop:DESCRIPTION", null, "uk-UA"),
|
||||
"ru": client.translate("music/stop:DESCRIPTION", null, "ru-RU"),
|
||||
uk: client.translate("music/stop:DESCRIPTION", null, "uk-UA"),
|
||||
ru: client.translate("music/stop:DESCRIPTION", null, "ru-RU"),
|
||||
})
|
||||
.setDMPermission(false),
|
||||
aliases: [],
|
||||
|
|
|
@ -12,18 +12,21 @@ class Volume extends BaseCommand {
|
|||
.setName("volume")
|
||||
.setDescription(client.translate("music/volume:DESCRIPTION"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("music/volume:DESCRIPTION", null, "uk-UA"),
|
||||
"ru": client.translate("music/volume:DESCRIPTION", null, "ru-RU"),
|
||||
uk: client.translate("music/volume:DESCRIPTION", null, "uk-UA"),
|
||||
ru: client.translate("music/volume:DESCRIPTION", null, "ru-RU"),
|
||||
})
|
||||
.setDMPermission(false)
|
||||
.addIntegerOption(option => option.setName("int")
|
||||
.setDescription(client.translate("common:INT"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("common:INT", null, "uk-UA"),
|
||||
"ru": client.translate("common:INT", null, "ru-RU"),
|
||||
})
|
||||
.setRequired(true)
|
||||
.setAutocomplete(true)),
|
||||
.addIntegerOption(option =>
|
||||
option
|
||||
.setName("int")
|
||||
.setDescription(client.translate("common:INT"))
|
||||
.setDescriptionLocalizations({
|
||||
uk: client.translate("common:INT", null, "uk-UA"),
|
||||
ru: client.translate("common:INT", null, "ru-RU"),
|
||||
})
|
||||
.setRequired(true)
|
||||
.setAutocomplete(true),
|
||||
),
|
||||
aliases: [],
|
||||
dirname: __dirname,
|
||||
ownerOnly: false,
|
||||
|
@ -72,8 +75,8 @@ class Volume extends BaseCommand {
|
|||
results.slice(0, 25).map(i => ({
|
||||
name: i,
|
||||
value: i,
|
||||
}),
|
||||
));
|
||||
})),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -13,8 +13,8 @@ class NSFW extends BaseCommand {
|
|||
.setName("nsfw")
|
||||
.setDescription(client.translate("nsfw/nsfw:DESCRIPTION"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("nsfw/nsfw:DESCRIPTION", null, "uk-UA"),
|
||||
"ru": client.translate("nsfw/nsfw:DESCRIPTION", null, "ru-RU"),
|
||||
uk: client.translate("nsfw/nsfw:DESCRIPTION", null, "uk-UA"),
|
||||
ru: client.translate("nsfw/nsfw:DESCRIPTION", null, "ru-RU"),
|
||||
})
|
||||
.setDMPermission(true),
|
||||
aliases: [],
|
||||
|
@ -41,19 +41,15 @@ class NSFW extends BaseCommand {
|
|||
if (interaction.guildId && !interaction.channel.nsfw) return interaction.replyT("misc:NSFW_COMMAND", null, { edit: true });
|
||||
|
||||
const tags = ["hentai", "ecchi", "lewdanimegirls", "hentaifemdom", "animefeets", "animebooty", "biganimetiddies", "sideoppai", "ahegao"].map(tag =>
|
||||
JSON.parse(JSON.stringify({
|
||||
label: tag,
|
||||
value: tag,
|
||||
})),
|
||||
JSON.parse(
|
||||
JSON.stringify({
|
||||
label: tag,
|
||||
value: tag,
|
||||
}),
|
||||
),
|
||||
);
|
||||
|
||||
const row = new ActionRowBuilder()
|
||||
.addComponents(
|
||||
new StringSelectMenuBuilder()
|
||||
.setCustomId("nsfw_select")
|
||||
.setPlaceholder(client.translate("common:NOTHING_SELECTED"))
|
||||
.addOptions(tags),
|
||||
);
|
||||
const row = new ActionRowBuilder().addComponents(new StringSelectMenuBuilder().setCustomId("nsfw_select").setPlaceholder(client.translate("common:NOTHING_SELECTED")).addOptions(tags));
|
||||
|
||||
const msg = await interaction.editReply({
|
||||
content: interaction.translate("common:AVAILABLE_OPTIONS"),
|
||||
|
@ -63,7 +59,7 @@ class NSFW extends BaseCommand {
|
|||
});
|
||||
|
||||
const filter = i => i.user.id === interaction.user.id;
|
||||
const collector = msg.createMessageComponentCollector({ filter, idle: (2 * 60 * 1000) });
|
||||
const collector = msg.createMessageComponentCollector({ filter, idle: 2 * 60 * 1000 });
|
||||
|
||||
collector.on("collect", async i => {
|
||||
if (i.isStringSelectMenu() && i.customId === "nsfw_select") {
|
||||
|
|
|
@ -12,79 +12,101 @@ class Debug extends BaseCommand {
|
|||
.setName("debug")
|
||||
.setDescription(client.translate("owner/debug:DESCRIPTION"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("owner/debug:DESCRIPTION", null, "uk-UA"),
|
||||
"ru": client.translate("owner/debug:DESCRIPTION", null, "ru-RU"),
|
||||
uk: client.translate("owner/debug:DESCRIPTION", null, "uk-UA"),
|
||||
ru: client.translate("owner/debug:DESCRIPTION", null, "ru-RU"),
|
||||
})
|
||||
.setDMPermission(false)
|
||||
.addSubcommand(subcommand => subcommand.setName("set")
|
||||
.setDescription(client.translate("owner/debug:SET"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("owner/debug:SET", null, "uk-UA"),
|
||||
"ru": client.translate("owner/debug:SET", null, "ru-RU"),
|
||||
})
|
||||
.addStringOption(option => option.setName("type")
|
||||
.setDescription(client.translate("owner/debug:TYPE"))
|
||||
.addSubcommand(subcommand =>
|
||||
subcommand
|
||||
.setName("set")
|
||||
.setDescription(client.translate("owner/debug:SET"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("owner/debug:TYPE", null, "uk-UA"),
|
||||
"ru": client.translate("owner/debug:TYPE", null, "ru-RU"),
|
||||
uk: client.translate("owner/debug:SET", null, "uk-UA"),
|
||||
ru: client.translate("owner/debug:SET", null, "ru-RU"),
|
||||
})
|
||||
.setRequired(true)
|
||||
.setChoices(
|
||||
{ name: client.translate("common:LEVEL"), value: "level" },
|
||||
{ name: client.translate("common:XP"), value: "xp" },
|
||||
{ name: client.translate("common:CREDITS"), value: "credits" },
|
||||
{ name: client.translate("economy/transactions:BANK"), value: "bank" },
|
||||
{ name: client.translate("common:REP"), value: "rep" },
|
||||
))
|
||||
.addUserOption(option => option.setName("user")
|
||||
.setDescription(client.translate("common:USER"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("common:USER", null, "uk-UA"),
|
||||
"ru": client.translate("common:USER", null, "ru-RU"),
|
||||
})
|
||||
.setRequired(true))
|
||||
.addIntegerOption(option => option.setName("int")
|
||||
.setDescription(client.translate("common:INT"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("common:INT", null, "uk-UA"),
|
||||
"ru": client.translate("common:INT", null, "ru-RU"),
|
||||
})
|
||||
.setRequired(true)),
|
||||
.addStringOption(option =>
|
||||
option
|
||||
.setName("type")
|
||||
.setDescription(client.translate("owner/debug:TYPE"))
|
||||
.setDescriptionLocalizations({
|
||||
uk: client.translate("owner/debug:TYPE", null, "uk-UA"),
|
||||
ru: client.translate("owner/debug:TYPE", null, "ru-RU"),
|
||||
})
|
||||
.setRequired(true)
|
||||
.setChoices(
|
||||
{ name: client.translate("common:LEVEL"), value: "level" },
|
||||
{ name: client.translate("common:XP"), value: "xp" },
|
||||
{ name: client.translate("common:CREDITS"), value: "credits" },
|
||||
{ name: client.translate("economy/transactions:BANK"), value: "bank" },
|
||||
{ name: client.translate("common:REP"), value: "rep" },
|
||||
),
|
||||
)
|
||||
.addUserOption(option =>
|
||||
option
|
||||
.setName("user")
|
||||
.setDescription(client.translate("common:USER"))
|
||||
.setDescriptionLocalizations({
|
||||
uk: client.translate("common:USER", null, "uk-UA"),
|
||||
ru: client.translate("common:USER", null, "ru-RU"),
|
||||
})
|
||||
.setRequired(true),
|
||||
)
|
||||
.addIntegerOption(option =>
|
||||
option
|
||||
.setName("int")
|
||||
.setDescription(client.translate("common:INT"))
|
||||
.setDescriptionLocalizations({
|
||||
uk: client.translate("common:INT", null, "uk-UA"),
|
||||
ru: client.translate("common:INT", null, "ru-RU"),
|
||||
})
|
||||
.setRequired(true),
|
||||
),
|
||||
)
|
||||
.addSubcommand(subcommand => subcommand.setName("add")
|
||||
.setDescription(client.translate("owner/debug:ADD"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("owner/debug:ADD", null, "uk-UA"),
|
||||
"ru": client.translate("owner/debug:ADD", null, "ru-RU"),
|
||||
})
|
||||
.addStringOption(option => option.setName("type")
|
||||
.setDescription(client.translate("owner/debug:TYPE"))
|
||||
.addSubcommand(subcommand =>
|
||||
subcommand
|
||||
.setName("add")
|
||||
.setDescription(client.translate("owner/debug:ADD"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("owner/debug:TYPE", null, "uk-UA"),
|
||||
"ru": client.translate("owner/debug:TYPE", null, "ru-RU"),
|
||||
uk: client.translate("owner/debug:ADD", null, "uk-UA"),
|
||||
ru: client.translate("owner/debug:ADD", null, "ru-RU"),
|
||||
})
|
||||
.setRequired(true)
|
||||
.setChoices(
|
||||
{ name: client.translate("common:LEVEL"), value: "level" },
|
||||
{ name: client.translate("common:XP"), value: "xp" },
|
||||
{ name: client.translate("common:CREDITS"), value: "credits" },
|
||||
{ name: client.translate("economy/transactions:BANK"), value: "bank" },
|
||||
{ name: client.translate("common:REP"), value: "rep" },
|
||||
))
|
||||
.addUserOption(option => option.setName("user")
|
||||
.setDescription(client.translate("common:USER"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("common:USER", null, "uk-UA"),
|
||||
"ru": client.translate("common:USER", null, "ru-RU"),
|
||||
})
|
||||
.setRequired(true))
|
||||
.addIntegerOption(option => option.setName("int")
|
||||
.setDescription(client.translate("common:INT"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("common:INT", null, "uk-UA"),
|
||||
"ru": client.translate("common:INT", null, "ru-RU"),
|
||||
})
|
||||
.setRequired(true)),
|
||||
.addStringOption(option =>
|
||||
option
|
||||
.setName("type")
|
||||
.setDescription(client.translate("owner/debug:TYPE"))
|
||||
.setDescriptionLocalizations({
|
||||
uk: client.translate("owner/debug:TYPE", null, "uk-UA"),
|
||||
ru: client.translate("owner/debug:TYPE", null, "ru-RU"),
|
||||
})
|
||||
.setRequired(true)
|
||||
.setChoices(
|
||||
{ name: client.translate("common:LEVEL"), value: "level" },
|
||||
{ name: client.translate("common:XP"), value: "xp" },
|
||||
{ name: client.translate("common:CREDITS"), value: "credits" },
|
||||
{ name: client.translate("economy/transactions:BANK"), value: "bank" },
|
||||
{ name: client.translate("common:REP"), value: "rep" },
|
||||
),
|
||||
)
|
||||
.addUserOption(option =>
|
||||
option
|
||||
.setName("user")
|
||||
.setDescription(client.translate("common:USER"))
|
||||
.setDescriptionLocalizations({
|
||||
uk: client.translate("common:USER", null, "uk-UA"),
|
||||
ru: client.translate("common:USER", null, "ru-RU"),
|
||||
})
|
||||
.setRequired(true),
|
||||
)
|
||||
.addIntegerOption(option =>
|
||||
option
|
||||
.setName("int")
|
||||
.setDescription(client.translate("common:INT"))
|
||||
.setDescriptionLocalizations({
|
||||
uk: client.translate("common:INT", null, "uk-UA"),
|
||||
ru: client.translate("common:INT", null, "ru-RU"),
|
||||
})
|
||||
.setRequired(true),
|
||||
),
|
||||
),
|
||||
aliases: [],
|
||||
dirname: __dirname,
|
||||
|
@ -122,7 +144,6 @@ class Debug extends BaseCommand {
|
|||
guildId: interaction.guildId,
|
||||
});
|
||||
|
||||
|
||||
switch (type) {
|
||||
case "level": {
|
||||
memberData.level = int;
|
||||
|
|
|
@ -12,17 +12,20 @@ class Eval extends BaseCommand {
|
|||
.setName("eval")
|
||||
.setDescription(client.translate("owner/eval:DESCRIPTION"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("owner/eval:DESCRIPTION", null, "uk-UA"),
|
||||
"ru": client.translate("owner/eval:DESCRIPTION", null, "ru-RU"),
|
||||
uk: client.translate("owner/eval:DESCRIPTION", null, "uk-UA"),
|
||||
ru: client.translate("owner/eval:DESCRIPTION", null, "ru-RU"),
|
||||
})
|
||||
.setDMPermission(true)
|
||||
.addStringOption(option => option.setName("code")
|
||||
.setDescription(client.translate("owner/eval:CODE"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("owner/eval:CODE", null, "uk-UA"),
|
||||
"ru": client.translate("owner/eval:CODE", null, "ru-RU"),
|
||||
})
|
||||
.setRequired(true)),
|
||||
.addStringOption(option =>
|
||||
option
|
||||
.setName("code")
|
||||
.setDescription(client.translate("owner/eval:CODE"))
|
||||
.setDescriptionLocalizations({
|
||||
uk: client.translate("owner/eval:CODE", null, "uk-UA"),
|
||||
ru: client.translate("owner/eval:CODE", null, "ru-RU"),
|
||||
})
|
||||
.setRequired(true),
|
||||
),
|
||||
aliases: [],
|
||||
dirname: __dirname,
|
||||
ownerOnly: true,
|
||||
|
@ -48,22 +51,24 @@ class Eval extends BaseCommand {
|
|||
const code = interaction.options.getString("code");
|
||||
const result = new Promise(resolve => resolve(eval(code)));
|
||||
|
||||
return result.then(output => {
|
||||
if (typeof output !== "string") output = require("util").inspect(output);
|
||||
if (output.includes(client.token)) output = output.replace(client.token, "T0K3N");
|
||||
return result
|
||||
.then(output => {
|
||||
if (typeof output !== "string") output = require("util").inspect(output);
|
||||
if (output.includes(client.token)) output = output.replace(client.token, "T0K3N");
|
||||
|
||||
interaction.editReply({
|
||||
content: "```js\n" + output + "```",
|
||||
});
|
||||
}).catch(err => {
|
||||
console.log(err);
|
||||
err = err.toString();
|
||||
if (err.includes(client.token)) err = err.replace(client.token, "T0K3N");
|
||||
interaction.editReply({
|
||||
content: "```js\n" + output + "```",
|
||||
});
|
||||
})
|
||||
.catch(err => {
|
||||
console.log(err);
|
||||
err = err.toString();
|
||||
if (err.includes(client.token)) err = err.replace(client.token, "T0K3N");
|
||||
|
||||
interaction.editReply({
|
||||
content: "```js\n" + err + "```",
|
||||
interaction.editReply({
|
||||
content: "```js\n" + err + "```",
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
module.exports = Eval;
|
|
@ -1,7 +1,7 @@
|
|||
const { SlashCommandBuilder } = require("discord.js");
|
||||
const BaseCommand = require("../../base/BaseCommand"),
|
||||
i18next = require("i18next");
|
||||
// autoUpdateDocs = require("../../helpers/autoUpdateDocs");
|
||||
// autoUpdateDocs = require("../../helpers/autoUpdateDocs");
|
||||
|
||||
class Reload extends BaseCommand {
|
||||
/**
|
||||
|
@ -14,18 +14,21 @@ class Reload extends BaseCommand {
|
|||
.setName("reload")
|
||||
.setDescription(client.translate("owner/reload:DESCRIPTION"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("owner/reload:DESCRIPTION", null, "uk-UA"),
|
||||
"ru": client.translate("owner/reload:DESCRIPTION", null, "ru-RU"),
|
||||
uk: client.translate("owner/reload:DESCRIPTION", null, "uk-UA"),
|
||||
ru: client.translate("owner/reload:DESCRIPTION", null, "ru-RU"),
|
||||
})
|
||||
.setDMPermission(true)
|
||||
.addStringOption(option => option.setName("command")
|
||||
.setDescription(client.translate("common:COMMAND"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("common:COMMAND", null, "uk-UA"),
|
||||
"ru": client.translate("common:COMMAND", null, "ru-RU"),
|
||||
})
|
||||
.setRequired(true)
|
||||
.setAutocomplete(true)),
|
||||
.addStringOption(option =>
|
||||
option
|
||||
.setName("command")
|
||||
.setDescription(client.translate("common:COMMAND"))
|
||||
.setDescriptionLocalizations({
|
||||
uk: client.translate("common:COMMAND", null, "uk-UA"),
|
||||
ru: client.translate("common:COMMAND", null, "ru-RU"),
|
||||
})
|
||||
.setRequired(true)
|
||||
.setAutocomplete(true),
|
||||
),
|
||||
aliases: [],
|
||||
dirname: __dirname,
|
||||
ownerOnly: true,
|
||||
|
@ -71,11 +74,14 @@ class Reload extends BaseCommand {
|
|||
results = client.commands.filter(c => c.command.name.includes(command));
|
||||
|
||||
return interaction.respond(
|
||||
results.map(c => c).slice(0, 25).map(c => ({
|
||||
name: c.command.name,
|
||||
value: c.command.name,
|
||||
}),
|
||||
));
|
||||
results
|
||||
.map(c => c)
|
||||
.slice(0, 25)
|
||||
.map(c => ({
|
||||
name: c.command.name,
|
||||
value: c.command.name,
|
||||
})),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -12,23 +12,38 @@ class Say extends BaseCommand {
|
|||
.setName("say")
|
||||
.setDescription(client.translate("owner/say:DESCRIPTION"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("owner/say:DESCRIPTION", null, "uk-UA"),
|
||||
"ru": client.translate("owner/say:DESCRIPTION", null, "ru-RU"),
|
||||
uk: client.translate("owner/say:DESCRIPTION", null, "uk-UA"),
|
||||
ru: client.translate("owner/say:DESCRIPTION", null, "ru-RU"),
|
||||
})
|
||||
.setDMPermission(false)
|
||||
.addStringOption(option => option.setName("message")
|
||||
.setDescription(client.translate("common:MESSAGE"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("common:MESSAGE", null, "uk-UA"),
|
||||
"ru": client.translate("common:MESSAGE", null, "ru-RU"),
|
||||
})
|
||||
.setRequired(true))
|
||||
.addChannelOption(option => option.setName("channel")
|
||||
.setDescription(client.translate("common:CHANNEL"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("common:CHANNEL", null, "uk-UA"),
|
||||
"ru": client.translate("common:CHANNEL", null, "ru-RU"),
|
||||
})),
|
||||
.addStringOption(option =>
|
||||
option
|
||||
.setName("message")
|
||||
.setDescription(client.translate("common:MESSAGE"))
|
||||
.setDescriptionLocalizations({
|
||||
uk: client.translate("common:MESSAGE", null, "uk-UA"),
|
||||
ru: client.translate("common:MESSAGE", null, "ru-RU"),
|
||||
})
|
||||
.setRequired(true),
|
||||
)
|
||||
.addChannelOption(option =>
|
||||
option
|
||||
.setName("channel")
|
||||
.setDescription(client.translate("common:CHANNEL"))
|
||||
.setDescriptionLocalizations({
|
||||
uk: client.translate("common:CHANNEL", null, "uk-UA"),
|
||||
ru: client.translate("common:CHANNEL", null, "ru-RU"),
|
||||
}),
|
||||
)
|
||||
.addAttachmentOption(option =>
|
||||
option
|
||||
.setName("attachment")
|
||||
.setDescription(client.translate("common:ATTACHMENT"))
|
||||
.setDescriptionLocalizations({
|
||||
uk: client.translate("common:ATTACHMENT", null, "uk-UA"),
|
||||
ru: client.translate("common:ATTACHMENT", null, "ru-RU"),
|
||||
}),
|
||||
),
|
||||
aliases: [],
|
||||
dirname: __dirname,
|
||||
ownerOnly: true,
|
||||
|
@ -51,6 +66,7 @@ class Say extends BaseCommand {
|
|||
await interaction.deferReply({ ephemeral: true });
|
||||
|
||||
const message = interaction.options.getString("message"),
|
||||
attachment = interaction.options.getAttachment("attachment"),
|
||||
channel = interaction.options.getChannel("channel");
|
||||
|
||||
if (!channel) {
|
||||
|
@ -59,6 +75,10 @@ class Say extends BaseCommand {
|
|||
setTimeout(function () {
|
||||
interaction.channel.send({
|
||||
content: message,
|
||||
files: attachment ? [{
|
||||
name: attachment.name,
|
||||
attachment: attachment.url,
|
||||
}] : null,
|
||||
});
|
||||
|
||||
interaction.replyT("owner/say:DONE", {
|
||||
|
@ -72,6 +92,10 @@ class Say extends BaseCommand {
|
|||
setTimeout(function () {
|
||||
channel.send({
|
||||
content: message,
|
||||
files: attachment ? [{
|
||||
name: attachment.name,
|
||||
attachment: attachment.url,
|
||||
}] : null,
|
||||
});
|
||||
|
||||
interaction.replyT("owner/say:DONE", {
|
||||
|
|
|
@ -12,8 +12,8 @@ class Servers extends BaseCommand {
|
|||
.setName("servers")
|
||||
.setDescription(client.translate("owner/servers:DESCRIPTION"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("owner/servers:DESCRIPTION", null, "uk-UA"),
|
||||
"ru": client.translate("owner/servers:DESCRIPTION", null, "ru-RU"),
|
||||
uk: client.translate("owner/servers:DESCRIPTION", null, "uk-UA"),
|
||||
ru: client.translate("owner/servers:DESCRIPTION", null, "ru-RU"),
|
||||
})
|
||||
.setDMPermission(true),
|
||||
aliases: [],
|
||||
|
@ -40,21 +40,11 @@ class Servers extends BaseCommand {
|
|||
let currentPage = 0;
|
||||
const embeds = generateServersEmbeds(interaction, client.guilds.cache);
|
||||
|
||||
const row = new ActionRowBuilder()
|
||||
.addComponents(
|
||||
new ButtonBuilder()
|
||||
.setCustomId("servers_prev_page")
|
||||
.setStyle(ButtonStyle.Primary)
|
||||
.setEmoji("⬅️"),
|
||||
new ButtonBuilder()
|
||||
.setCustomId("servers_next_page")
|
||||
.setStyle(ButtonStyle.Primary)
|
||||
.setEmoji("➡️"),
|
||||
new ButtonBuilder()
|
||||
.setCustomId("servers_stop")
|
||||
.setStyle(ButtonStyle.Danger)
|
||||
.setEmoji("⏹️"),
|
||||
);
|
||||
const row = new ActionRowBuilder().addComponents(
|
||||
new ButtonBuilder().setCustomId("servers_prev_page").setStyle(ButtonStyle.Primary).setEmoji("⬅️"),
|
||||
new ButtonBuilder().setCustomId("servers_next_page").setStyle(ButtonStyle.Primary).setEmoji("➡️"),
|
||||
new ButtonBuilder().setCustomId("servers_stop").setStyle(ButtonStyle.Danger).setEmoji("⏹️"),
|
||||
);
|
||||
|
||||
await interaction.editReply({
|
||||
content: `${interaction.translate("common:PAGE")}: **${currentPage + 1}**/**${embeds.length}**`,
|
||||
|
@ -63,7 +53,7 @@ class Servers extends BaseCommand {
|
|||
});
|
||||
|
||||
const filter = i => i.user.id === interaction.user.id;
|
||||
const collector = interaction.guild === null ? (await interaction.user.createDM()).createMessageComponentCollector({ filter, idle: (20 * 1000) }) : interaction.channel.createMessageComponentCollector({ filter, idle: (20 * 1000) });
|
||||
const collector = interaction.guild === null ? (await interaction.user.createDM()).createMessageComponentCollector({ filter, idle: 20 * 1000 }) : interaction.channel.createMessageComponentCollector({ filter, idle: 20 * 1000 });
|
||||
|
||||
collector.on("collect", async i => {
|
||||
if (i.isButton()) {
|
||||
|
@ -119,11 +109,24 @@ function generateServersEmbeds(interaction, servers) {
|
|||
let k = 10;
|
||||
|
||||
for (let i = 0; i < servers.size; i += 10) {
|
||||
const current = servers.sort((a, b) => b.memberCount - a.memberCount).map(g => g).slice(i, k);
|
||||
const current = servers
|
||||
.sort((a, b) => b.memberCount - a.memberCount)
|
||||
.map(g => g)
|
||||
.slice(i, k);
|
||||
let j = i;
|
||||
k += 10;
|
||||
|
||||
const info = current.map(server => `${++j}. ${server.name} | ${server.memberCount} ${interaction.client.functions.getNoun(server.memberCount, interaction.translate("misc:NOUNS:MEMBERS:1"), interaction.translate("misc:NOUNS:MEMBERS:2"), interaction.translate("misc:NOUNS:MEMBERS:5"))}`).join("\n");
|
||||
const info = current
|
||||
.map(
|
||||
server =>
|
||||
`${++j}. ${server.name} | ${server.memberCount} ${interaction.client.functions.getNoun(
|
||||
server.memberCount,
|
||||
interaction.translate("misc:NOUNS:MEMBERS:1"),
|
||||
interaction.translate("misc:NOUNS:MEMBERS:2"),
|
||||
interaction.translate("misc:NOUNS:MEMBERS:5"),
|
||||
)}`,
|
||||
)
|
||||
.join("\n");
|
||||
|
||||
const embed = new EmbedBuilder()
|
||||
.setColor(interaction.client.config.embed.color)
|
||||
|
|
|
@ -12,56 +12,75 @@ class Sendmessage extends BaseCommand {
|
|||
.setName("sendmessage")
|
||||
.setDescription(client.translate("suncountry/sendmessage:DESCRIPTION"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("suncountry/sendmessage:DESCRIPTION", null, "uk-UA"),
|
||||
"ru": client.translate("suncountry/sendmessage:DESCRIPTION", null, "ru-RU"),
|
||||
uk: client.translate("suncountry/sendmessage:DESCRIPTION", null, "uk-UA"),
|
||||
ru: client.translate("suncountry/sendmessage:DESCRIPTION", null, "ru-RU"),
|
||||
})
|
||||
.setDMPermission(true)
|
||||
.addSubcommand(subcommand => subcommand.setName("rpinfo")
|
||||
.setDescription(client.translate("suncountry/sendmessage:RPINFO"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("suncountry/sendmessage:RPINFO", null, "uk-UA"),
|
||||
"ru": client.translate("suncountry/sendmessage:RPINFO", null, "ru-RU"),
|
||||
})
|
||||
.addStringOption(option => option.setName("text")
|
||||
.setDescription(client.translate("common:MESSAGE"))
|
||||
.addSubcommand(subcommand =>
|
||||
subcommand
|
||||
.setName("rpinfo")
|
||||
.setDescription(client.translate("suncountry/sendmessage:RPINFO"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("common:MESSAGE", null, "uk-UA"),
|
||||
"ru": client.translate("common:MESSAGE", null, "ru-RU"),
|
||||
uk: client.translate("suncountry/sendmessage:RPINFO", null, "uk-UA"),
|
||||
ru: client.translate("suncountry/sendmessage:RPINFO", null, "ru-RU"),
|
||||
})
|
||||
.setRequired(true))
|
||||
.addAttachmentOption(option => option.setName("attachment")
|
||||
.setDescription(client.translate("common:ATTACHMENT"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("common:ATTACHMENT", null, "uk-UA"),
|
||||
"ru": client.translate("common:ATTACHMENT", null, "ru-RU"),
|
||||
})),
|
||||
.addStringOption(option =>
|
||||
option
|
||||
.setName("text")
|
||||
.setDescription(client.translate("common:MESSAGE"))
|
||||
.setDescriptionLocalizations({
|
||||
uk: client.translate("common:MESSAGE", null, "uk-UA"),
|
||||
ru: client.translate("common:MESSAGE", null, "ru-RU"),
|
||||
})
|
||||
.setRequired(true),
|
||||
)
|
||||
.addAttachmentOption(option =>
|
||||
option
|
||||
.setName("attachment")
|
||||
.setDescription(client.translate("common:ATTACHMENT"))
|
||||
.setDescriptionLocalizations({
|
||||
uk: client.translate("common:ATTACHMENT", null, "uk-UA"),
|
||||
ru: client.translate("common:ATTACHMENT", null, "ru-RU"),
|
||||
}),
|
||||
),
|
||||
)
|
||||
.addSubcommand(subcommand => subcommand.setName("instalife")
|
||||
.setDescription(client.translate("suncountry/sendmessage:INSTALIFE"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("suncountry/sendmessage:INSTALIFE", null, "uk-UA"),
|
||||
"ru": client.translate("suncountry/sendmessage:INSTALIFE", null, "ru-RU"),
|
||||
})
|
||||
.addStringOption(option => option.setName("name")
|
||||
.setDescription(client.translate("common:USERNAME"))
|
||||
.addSubcommand(subcommand =>
|
||||
subcommand
|
||||
.setName("instalife")
|
||||
.setDescription(client.translate("suncountry/sendmessage:INSTALIFE"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("common:USERNAME", null, "uk-UA"),
|
||||
"ru": client.translate("common:USERNAME", null, "ru-RU"),
|
||||
uk: client.translate("suncountry/sendmessage:INSTALIFE", null, "uk-UA"),
|
||||
ru: client.translate("suncountry/sendmessage:INSTALIFE", null, "ru-RU"),
|
||||
})
|
||||
.setRequired(true))
|
||||
.addStringOption(option => option.setName("text")
|
||||
.setDescription(client.translate("common:MESSAGE"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("common:MESSAGE", null, "uk-UA"),
|
||||
"ru": client.translate("common:MESSAGE", null, "ru-RU"),
|
||||
})
|
||||
.setRequired(true))
|
||||
.addAttachmentOption(option => option.setName("attachment")
|
||||
.setDescription(client.translate("common:ATTACHMENT"))
|
||||
.setDescriptionLocalizations({
|
||||
"uk": client.translate("common:ATTACHMENT", null, "uk-UA"),
|
||||
"ru": client.translate("common:ATTACHMENT", null, "ru-RU"),
|
||||
})),
|
||||
.addStringOption(option =>
|
||||
option
|
||||
.setName("name")
|
||||
.setDescription(client.translate("common:USERNAME"))
|
||||
.setDescriptionLocalizations({
|
||||
uk: client.translate("common:USERNAME", null, "uk-UA"),
|
||||
ru: client.translate("common:USERNAME", null, "ru-RU"),
|
||||
})
|
||||
.setRequired(true),
|
||||
)
|
||||
.addStringOption(option =>
|
||||
option
|
||||
.setName("text")
|
||||
.setDescription(client.translate("common:MESSAGE"))
|
||||
.setDescriptionLocalizations({
|
||||
uk: client.translate("common:MESSAGE", null, "uk-UA"),
|
||||
ru: client.translate("common:MESSAGE", null, "ru-RU"),
|
||||
})
|
||||
.setRequired(true),
|
||||
)
|
||||
.addAttachmentOption(option =>
|
||||
option
|
||||
.setName("attachment")
|
||||
.setDescription(client.translate("common:ATTACHMENT"))
|
||||
.setDescriptionLocalizations({
|
||||
uk: client.translate("common:ATTACHMENT", null, "uk-UA"),
|
||||
ru: client.translate("common:ATTACHMENT", null, "ru-RU"),
|
||||
}),
|
||||
),
|
||||
),
|
||||
aliases: [],
|
||||
dirname: __dirname,
|
||||
|
@ -101,14 +120,18 @@ class Sendmessage extends BaseCommand {
|
|||
.setImage(attachment ? attachment.url : null)
|
||||
.setDescription(text);
|
||||
|
||||
channel.send({
|
||||
content: command === "rpinfo" ? text : null,
|
||||
files: command === "rpinfo" ? (attachment ? [{
|
||||
const content = command === "rpinfo" ? text : null,
|
||||
files = command === "rpinfo" ? (attachment ? [{
|
||||
name: attachment.name,
|
||||
attachment: attachment.url,
|
||||
}] : null) : null,
|
||||
embeds: command === "instalife" ? [embed] : null,
|
||||
}).then(message => {
|
||||
embeds = command === "instalife" ? [embed] : null;
|
||||
|
||||
channel.send({
|
||||
content,
|
||||
files,
|
||||
embeds,
|
||||
}) .then(message => {
|
||||
interaction.success("suncountry/sendmessage:MESSAGE_SENT", {
|
||||
message: message.url,
|
||||
}, { edit: true });
|
||||
|
|
|
@ -2,7 +2,7 @@ module.exports = {
|
|||
/* The token of your Discord Bot */
|
||||
token: "XXXXXXXXXXX",
|
||||
/* ID of Bot's user */
|
||||
user: "XXXXXXXXXXX",
|
||||
userId: "XXXXXXXXXXX",
|
||||
/* Set to true for production */
|
||||
production: true,
|
||||
/* For the support server */
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit b9ef79e4bfd01e89ed8b5eb0a083ff2d759bce23
|
||||
Subproject commit f18f32bc4d4dbb066c8ec24d6f6a648b51a92ddf
|
|
@ -41,7 +41,7 @@ module.exports.load = async client => {
|
|||
const Dashboard = new DBD.Dashboard({
|
||||
port: client.config.dashboard.port,
|
||||
client: {
|
||||
id: client.config.user,
|
||||
id: client.config.userId,
|
||||
secret: client.config.dashboard.secret,
|
||||
},
|
||||
SSL: {
|
||||
|
@ -57,7 +57,7 @@ module.exports.load = async client => {
|
|||
requiredPermissions: PermissionsBitField.Flags.ViewChannel,
|
||||
minimizedConsoleLogs: true,
|
||||
invite: {
|
||||
clientId: client.config.user,
|
||||
clientId: client.config.userId,
|
||||
scopes: ["bot", "applications.commands"],
|
||||
permissions: "8",
|
||||
redirectUri: `${client.config.dashboard.domain}${client.config.dashboard.port !== 80 ? `:${client.config.dashboard.port}` : ""}`,
|
||||
|
|
|
@ -40,10 +40,12 @@ class CommandHandler extends BaseEvent {
|
|||
if (!userData.achievements.firstCommand.achieved) {
|
||||
const args = {
|
||||
content: interaction.user.toString(),
|
||||
files: [{
|
||||
name: "achievement_unlocked2.png",
|
||||
attachment: "./assets/img/achievements/achievement_unlocked2.png",
|
||||
}],
|
||||
files: [
|
||||
{
|
||||
name: "achievement_unlocked2.png",
|
||||
attachment: "./assets/img/achievements/achievement_unlocked2.png",
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
userData.achievements.firstCommand.progress.now = 1;
|
||||
|
@ -54,7 +56,7 @@ class CommandHandler extends BaseEvent {
|
|||
interaction.user.send(args);
|
||||
}
|
||||
|
||||
client.logger.log(`User ${interaction.user.getUsername()} used ${command.command.name} in ${interaction.guild ? interaction.guild.name : "DM"} with arguments: ${interaction.options.data.length > 0 ? interaction.options.data.map(arg => { return `${arg.name}: ${arg.value}`; }).join(", ") : "no args"}`, "cmd");
|
||||
client.logger.log(`User ${interaction.user.getUsername()} used ${command.command.name} in ${interaction.guild ? interaction.guild.name : "DM"} with arguments: ${interaction.options.data.length > 0 ? interaction.options.data.map(arg => { return `${arg.name}: ${arg.value}`; }).join(", ") : "no args" }`, "cmd");
|
||||
|
||||
return command.execute(client, interaction, data);
|
||||
}
|
||||
|
|
|
@ -15,9 +15,7 @@ class GuildCreate extends BaseEvent {
|
|||
* @param {import("discord.js").Guild} guild
|
||||
*/
|
||||
async execute(client, guild) {
|
||||
const userData = await client.findOrCreateUser({
|
||||
id: guild.ownerId,
|
||||
});
|
||||
const userData = await client.findOrCreateUser({ id: guild.ownerId });
|
||||
|
||||
if (!userData.achievements.invite.achieved) {
|
||||
userData.achievements.invite.progress.now = 1;
|
||||
|
@ -39,10 +37,12 @@ class GuildCreate extends BaseEvent {
|
|||
|
||||
const owner = await guild.fetchOwner();
|
||||
owner.send({
|
||||
files: [{
|
||||
name: "unlocked.png",
|
||||
attachment: "./assets/img/achievements/achievement_unlocked7.png",
|
||||
}],
|
||||
files: [
|
||||
{
|
||||
name: "unlocked.png",
|
||||
attachment: "./assets/img/achievements/achievement_unlocked7.png",
|
||||
},
|
||||
],
|
||||
embeds: [thanks],
|
||||
});
|
||||
|
||||
|
|
|
@ -79,13 +79,23 @@ class GuildMemberAdd extends BaseEvent {
|
|||
ctx.fillText(member.user.username, canvas.width - 670, canvas.height - 250);
|
||||
|
||||
// Draw server name
|
||||
ctx.font = applyText(canvas, client.translate("administration/welcome:IMG_WELCOME", {
|
||||
server: member.guild.name,
|
||||
}, guildData.language), 53, 625, "RubikMonoOne");
|
||||
ctx.font = applyText(
|
||||
canvas,
|
||||
client.translate("administration/welcome:IMG_WELCOME", {
|
||||
server: member.guild.name,
|
||||
}, guildData.language),
|
||||
53,
|
||||
625,
|
||||
"RubikMonoOne",
|
||||
);
|
||||
|
||||
ctx.fillText(client.translate("administration/welcome:IMG_WELCOME", {
|
||||
server: member.guild.name,
|
||||
}, guildData.language), canvas.width - 700, canvas.height - 70);
|
||||
ctx.fillText(
|
||||
client.translate("administration/welcome:IMG_WELCOME", {
|
||||
server: member.guild.name,
|
||||
}, guildData.language),
|
||||
canvas.width - 700,
|
||||
canvas.height - 70,
|
||||
);
|
||||
|
||||
// Draw discriminator
|
||||
ctx.font = "35px RubikMonoOne";
|
||||
|
@ -117,9 +127,11 @@ class GuildMemberAdd extends BaseEvent {
|
|||
ctx.closePath();
|
||||
ctx.clip();
|
||||
|
||||
const avatar = await Canvas.loadImage(member.displayAvatarURL({
|
||||
extension: "jpg",
|
||||
}));
|
||||
const avatar = await Canvas.loadImage(
|
||||
member.displayAvatarURL({
|
||||
extension: "jpg",
|
||||
}),
|
||||
);
|
||||
ctx.drawImage(avatar, 45, 90, 270, 270);
|
||||
|
||||
const attachment = new AttachmentBuilder(canvas.toBuffer(), { name: "welcome-image.png" });
|
||||
|
@ -128,8 +140,7 @@ class GuildMemberAdd extends BaseEvent {
|
|||
content: message,
|
||||
files: [attachment],
|
||||
});
|
||||
} else
|
||||
channel.send({ content: message });
|
||||
} else channel.send({ content: message });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -77,13 +77,23 @@ class GuildMemberRemove extends BaseEvent {
|
|||
ctx.fillText(member.user.username, canvas.width - 670, canvas.height - 250);
|
||||
|
||||
// Draw server name
|
||||
ctx.font = applyText(canvas, client.translate("administration/goodbye:IMG_GOODBYE", {
|
||||
server: member.guild.name,
|
||||
}, guildData.language), 53, 625, "RubikMonoOne");
|
||||
ctx.font = applyText(
|
||||
canvas,
|
||||
client.translate("administration/goodbye:IMG_GOODBYE", {
|
||||
server: member.guild.name,
|
||||
}, guildData.language),
|
||||
53,
|
||||
625,
|
||||
"RubikMonoOne",
|
||||
);
|
||||
|
||||
ctx.fillText(client.translate("administration/goodbye:IMG_GOODBYE", {
|
||||
server: member.guild.name,
|
||||
}, guildData.language), canvas.width - 700, canvas.height - 70);
|
||||
ctx.fillText(
|
||||
client.translate("administration/goodbye:IMG_GOODBYE", {
|
||||
server: member.guild.name,
|
||||
}, guildData.language),
|
||||
canvas.width - 700,
|
||||
canvas.height - 70,
|
||||
);
|
||||
|
||||
// Draw discriminator
|
||||
ctx.font = "35px RubikMonoOne";
|
||||
|
@ -91,7 +101,11 @@ class GuildMemberRemove extends BaseEvent {
|
|||
|
||||
// Draw membercount
|
||||
ctx.font = "22px RubikMonoOne";
|
||||
ctx.fillText(`${member.guild.memberCount} ${client.functions.getNoun(member.guild.memberCount, client.translate("misc:NOUNS:MEMBERS:1", null, guildData.language), client.translate("misc:NOUNS:MEMBERS:2", null, guildData.language), client.translate("misc:NOUNS:MEMBERS:5", null, guildData.language))}`, 40, canvas.height - 35);
|
||||
ctx.fillText(
|
||||
`${member.guild.memberCount} ${client.functions.getNoun(member.guild.memberCount, client.translate("misc:NOUNS:MEMBERS:1", null, guildData.language), client.translate("misc:NOUNS:MEMBERS:2", null, guildData.language), client.translate("misc:NOUNS:MEMBERS:5", null, guildData.language))}`,
|
||||
40,
|
||||
canvas.height - 35,
|
||||
);
|
||||
|
||||
// Draw # for discriminator
|
||||
ctx.fillStyle = "#FFFFFF";
|
||||
|
@ -115,10 +129,12 @@ class GuildMemberRemove extends BaseEvent {
|
|||
ctx.closePath();
|
||||
ctx.clip();
|
||||
|
||||
const avatar = await Canvas.loadImage(member.displayAvatarURL({
|
||||
extension: "png",
|
||||
size: 512,
|
||||
}));
|
||||
const avatar = await Canvas.loadImage(
|
||||
member.displayAvatarURL({
|
||||
extension: "png",
|
||||
size: 512,
|
||||
}),
|
||||
);
|
||||
ctx.drawImage(avatar, 45, 90, 270, 270);
|
||||
|
||||
const attachment = new AttachmentBuilder(canvas.toBuffer(), { name: "goodbye-image.png" });
|
||||
|
@ -127,8 +143,7 @@ class GuildMemberRemove extends BaseEvent {
|
|||
content: message,
|
||||
files: [attachment],
|
||||
});
|
||||
} else
|
||||
channel.send({ content: message });
|
||||
} else channel.send({ content: message });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -20,9 +20,7 @@ class GuildMemberUpdate extends BaseEvent {
|
|||
if (oldMember.roles.cache.some(r => r.id === "940149470975365191")) return;
|
||||
|
||||
if (newMember?.roles.cache.some(r => r.id === "940149470975365191")) {
|
||||
const userData = await client.findOrCreateUser({
|
||||
id: newMember.id,
|
||||
});
|
||||
const userData = await client.findOrCreateUser({ id: newMember.id });
|
||||
|
||||
userData.achievements.tip.progress.now = 1;
|
||||
userData.achievements.tip.achieved = true;
|
||||
|
@ -30,10 +28,12 @@ class GuildMemberUpdate extends BaseEvent {
|
|||
await userData.save();
|
||||
|
||||
newMember.send({
|
||||
files: [{
|
||||
name: "achievement_unlocked5.png",
|
||||
attachment: "./assets/img/achievements/achievement_unlocked5.png",
|
||||
}],
|
||||
files: [
|
||||
{
|
||||
name: "achievement_unlocked5.png",
|
||||
attachment: "./assets/img/achievements/achievement_unlocked5.png",
|
||||
},
|
||||
],
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -58,9 +58,14 @@ class MessageCreate extends BaseEvent {
|
|||
.addFields([
|
||||
{
|
||||
name: message.translate("misc:QUOTE_ATTACHED"),
|
||||
value: msg.attachments.size > 0 ? msg.attachments.map(a => {
|
||||
return `[${a.name}](${a.url})`;
|
||||
}).join("\n") : `*${message.translate("common:MISSING")}*`,
|
||||
value:
|
||||
msg.attachments.size > 0
|
||||
? msg.attachments
|
||||
.map(a => {
|
||||
return `[${a.name}](${a.url})`;
|
||||
})
|
||||
.join("\n")
|
||||
: `*${message.translate("common:MISSING")}*`,
|
||||
},
|
||||
])
|
||||
.setFooter({
|
||||
|
@ -69,17 +74,10 @@ class MessageCreate extends BaseEvent {
|
|||
.setColor(client.config.embed.color)
|
||||
.setTimestamp(msg.createdTimestamp);
|
||||
|
||||
const row = new ActionRowBuilder()
|
||||
.addComponents(
|
||||
new ButtonBuilder()
|
||||
.setLabel(message.translate("misc:QUOTE_JUMP"))
|
||||
.setStyle(ButtonStyle.Link)
|
||||
.setURL(msg.url),
|
||||
new ButtonBuilder()
|
||||
.setCustomId("quote_delete")
|
||||
.setEmoji("1102200816582000750")
|
||||
.setStyle(ButtonStyle.Danger),
|
||||
);
|
||||
const row = new ActionRowBuilder().addComponents(
|
||||
new ButtonBuilder().setLabel(message.translate("misc:QUOTE_JUMP")).setStyle(ButtonStyle.Link).setURL(msg.url),
|
||||
new ButtonBuilder().setCustomId("quote_delete").setEmoji("1102200816582000750").setStyle(ButtonStyle.Danger),
|
||||
);
|
||||
|
||||
const reply = await message.reply({
|
||||
embeds: [embed],
|
||||
|
@ -87,18 +85,17 @@ class MessageCreate extends BaseEvent {
|
|||
});
|
||||
|
||||
const filter = i => i.user.id === message.author.id;
|
||||
const collector = message.channel.createMessageComponentCollector({ filter, time: (60 * 1000) });
|
||||
const collector = message.channel.createMessageComponentCollector({ filter, time: 60 * 1000 });
|
||||
|
||||
collector.on("collect", async i => {
|
||||
if (i.isButton() && i.customId === "quote_delete")
|
||||
if (reply.deletable) await reply.delete();
|
||||
if (i.isButton() && i.customId === "quote_delete") if (reply.deletable) reply.delete();
|
||||
});
|
||||
}
|
||||
|
||||
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)) {
|
||||
await message.error("administration/automod:DELETED");
|
||||
await message.error("administration/automod:DELETED", null, { mention: true });
|
||||
message.delete();
|
||||
}
|
||||
|
||||
|
@ -114,9 +111,7 @@ class MessageCreate extends BaseEvent {
|
|||
}
|
||||
|
||||
message.mentions.users.forEach(async u => {
|
||||
const userData = await client.findOrCreateUser({
|
||||
id: u.id,
|
||||
});
|
||||
const userData = await client.findOrCreateUser({ id: u.id });
|
||||
|
||||
if (userData.afk) message.replyT("general/afk:IS_AFK", { user: u.getUsername(), reason: userData.afk }, { ephemeral: true });
|
||||
});
|
||||
|
@ -138,10 +133,9 @@ async function updateXp(client, msg, memberData) {
|
|||
level = parseInt(memberData.level),
|
||||
isInCooldown = xpCooldown[msg.author.id];
|
||||
|
||||
if (isInCooldown)
|
||||
if (isInCooldown > Date.now()) return;
|
||||
if (isInCooldown) if (isInCooldown > Date.now()) return;
|
||||
|
||||
const toWait = Date.now() + (60 * 1000); // 1 min
|
||||
const toWait = Date.now() + 60 * 1000; // 1 min
|
||||
xpCooldown[msg.author.id] = toWait;
|
||||
|
||||
const won = client.functions.randomNum(1, 2);
|
||||
|
|
|
@ -38,7 +38,6 @@ class messageUpdate extends BaseEvent {
|
|||
embeds: [embed],
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@ class Ready extends BaseEvent {
|
|||
|
||||
client.logger.log(`Loaded a total of ${commands.length} command(s).`, "ready");
|
||||
client.logger.log(`${client.user.getUsername()}, ready to serve ${tUsers} members 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");
|
||||
|
||||
console.timeEnd("botReady");
|
||||
|
||||
|
|
|
@ -24,9 +24,7 @@ module.exports.update = function (client) {
|
|||
// })
|
||||
|
||||
categories.sort().forEach(cat => {
|
||||
const categoriesArray = [
|
||||
["Название", "Описание", "Использование", "Разрешено использование"],
|
||||
];
|
||||
const categoriesArray = [["Название", "Описание", "Использование", "Разрешено использование"]];
|
||||
const cmds = [...new Map(commands.filter(cmd => cmd.category === cat).map(v => [v.constructor.name, v])).values()];
|
||||
|
||||
text += `### ${cat} (${cmds.length} ${client.functions.getNoun(cmds.length, "команда", "команды", "команд")})\n\n`;
|
||||
|
|
|
@ -13,57 +13,55 @@ module.exports.init = async function (client) {
|
|||
currentYear = date.getFullYear();
|
||||
|
||||
client.guilds.cache.forEach(async guild => {
|
||||
const guildData = await client.findOrCreateGuild({
|
||||
id: guild.id,
|
||||
});
|
||||
const guildData = await client.findOrCreateGuild({ id: guild.id });
|
||||
|
||||
if (guildData.plugins.birthdays) {
|
||||
const channel = client.channels.cache.get(guildData.plugins.birthdays);
|
||||
if (channel) {
|
||||
client.usersData.find({ birthdate: { $gt: 1 } })
|
||||
.then(async users => {
|
||||
for (const user of users) {
|
||||
if (guild.members.cache.find(m => m.id === user.id)) {
|
||||
const userDate = new Date(user.birthdate);
|
||||
const day = userDate.getDate();
|
||||
const month = userDate.getMonth();
|
||||
const year = userDate.getFullYear();
|
||||
const age = currentYear - year;
|
||||
client.usersData.find({ birthdate: { $gt: 1 } }).then(async users => {
|
||||
for (const user of users) {
|
||||
if (guild.members.cache.find(m => m.id === user.id)) {
|
||||
const userDate = new Date(user.birthdate);
|
||||
const day = userDate.getDate();
|
||||
const month = userDate.getMonth();
|
||||
const year = userDate.getFullYear();
|
||||
const age = currentYear - year;
|
||||
|
||||
if (currentMonth === month && currentDay === day) {
|
||||
const embed = new EmbedBuilder()
|
||||
.setAuthor({
|
||||
name: client.user.username,
|
||||
iconURL: client.user.displayAvatarURL({
|
||||
extension: "png",
|
||||
size: 512,
|
||||
if (currentMonth === month && currentDay === day) {
|
||||
const embed = new EmbedBuilder()
|
||||
.setAuthor({
|
||||
name: client.user.username,
|
||||
iconURL: client.user.displayAvatarURL(),
|
||||
})
|
||||
.setColor(client.config.embed.color)
|
||||
.setFooter({
|
||||
text: client.config.embed.footer,
|
||||
})
|
||||
.addFields([
|
||||
{
|
||||
name: client.translate("economy/birthdate:HAPPY_BIRTHDAY"),
|
||||
value: client.translate("economy/birthdate:HAPPY_BIRTHDAY_MESSAGE", {
|
||||
name: user.username,
|
||||
user: user.id,
|
||||
age: `**${age}** ${client.functions.getNoun(age, client.translate("misc:NOUNS:AGE:1"), client.translate("misc:NOUNS:AGE:2"), client.translate("misc:NOUNS:AGE:5"))}`,
|
||||
}),
|
||||
})
|
||||
.setColor(client.config.embed.color)
|
||||
.setFooter({
|
||||
text: client.config.embed.footer,
|
||||
})
|
||||
.addFields([
|
||||
{
|
||||
name: client.translate("economy/birthdate:HAPPY_BIRTHDAY"),
|
||||
value: client.translate("economy/birthdate:HAPPY_BIRTHDAY_MESSAGE", {
|
||||
name: user.username,
|
||||
user: user.id,
|
||||
age: `**${age}** ${client.functions.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],
|
||||
});
|
||||
await msg.react("🎉");
|
||||
}
|
||||
const msg = await channel.send({
|
||||
embeds: [embed],
|
||||
});
|
||||
await msg.react("🎉");
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}, null, true, "Europe/Moscow");
|
||||
},
|
||||
null,
|
||||
true,
|
||||
"Europe/Moscow",
|
||||
);
|
||||
};
|
|
@ -6,14 +6,12 @@ const moment = require("moment");
|
|||
* @param {import("../base/JaBa")} client
|
||||
*/
|
||||
module.exports.init = function (client) {
|
||||
client.usersData
|
||||
.find({ reminds: { $gt: [] } })
|
||||
.then(users => {
|
||||
for (const user of users) {
|
||||
if (!client.users.cache.has(user.id)) client.users.fetch(user.id);
|
||||
client.databaseCache.usersReminds.set(user.id, user);
|
||||
}
|
||||
});
|
||||
client.usersData.find({ reminds: { $gt: [] } }).then(users => {
|
||||
for (const user of users) {
|
||||
if (!client.users.cache.has(user.id)) client.users.fetch(user.id);
|
||||
client.databaseCache.usersReminds.set(user.id, user);
|
||||
}
|
||||
});
|
||||
|
||||
setInterval(async function () {
|
||||
const dateNow = Date.now();
|
||||
|
@ -30,9 +28,11 @@ module.exports.init = function (client) {
|
|||
.setAuthor({
|
||||
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"),
|
||||
}))
|
||||
.setDescription(
|
||||
client.translate("general/remindme:CREATED", {
|
||||
time: moment(r.createdAt).locale(client.defaultLanguage).format("dddd, Do MMMM YYYY, HH:mm:ss"),
|
||||
}),
|
||||
)
|
||||
.addFields([
|
||||
{
|
||||
name: client.translate("common:MESSAGE"),
|
||||
|
@ -49,7 +49,7 @@ module.exports.init = function (client) {
|
|||
});
|
||||
user.reminds = user.reminds.filter(r => r.sendAt >= dateNow);
|
||||
user.markModified("reminds");
|
||||
user.save();
|
||||
await user.save();
|
||||
|
||||
if (user.reminds.length === 0) client.databaseCache.usersReminds.delete(user.id);
|
||||
}
|
||||
|
|
|
@ -20,7 +20,7 @@ function setDaysTimeout(callback, days) {
|
|||
*/
|
||||
module.exports.init = async function (client) {
|
||||
setDaysTimeout(async () => {
|
||||
const timestamp = Date.now() + (29 * 24 * 60 * 60 * 1000); // 29 days
|
||||
const timestamp = Date.now() + 29 * 24 * 60 * 60 * 1000; // 29 days
|
||||
const members = client.membersData.find({ transactions: { $gt: [] } });
|
||||
|
||||
for (const member of members) {
|
||||
|
|
|
@ -18,7 +18,7 @@ module.exports = {
|
|||
async createInvite(client, guildId) {
|
||||
const guild = client.guilds.cache.get(guildId);
|
||||
const member = guild.members.me;
|
||||
const channel = guild.channels.cache.find(ch => ch.permissionsFor(member.id).has(PermissionsBitField.Flags.CreateInstantInvite) && ch.type === ChannelType.GuildText || ch.type === "GUILD_VOICE");
|
||||
const channel = guild.channels.cache.find(ch => (ch.permissionsFor(member.id).has(PermissionsBitField.Flags.CreateInstantInvite) && ch.type === ChannelType.GuildText) || ch.type === "GUILD_VOICE");
|
||||
if (channel) return (await channel.createInvite()).url || "No channels found or missing permissions";
|
||||
},
|
||||
|
||||
|
@ -46,7 +46,7 @@ module.exports = {
|
|||
return array.sort(function (a, b) {
|
||||
const x = a[key];
|
||||
const y = b[key];
|
||||
return ((x < y) ? 1 : ((x > y) ? -1 : 0));
|
||||
return x < y ? 1 : x > y ? -1 : 0;
|
||||
});
|
||||
},
|
||||
|
||||
|
@ -59,7 +59,8 @@ module.exports = {
|
|||
const array = [];
|
||||
pArray.forEach(element => array.push(element));
|
||||
let currentIndex = array.length,
|
||||
temporaryValue, randomIndex;
|
||||
temporaryValue,
|
||||
randomIndex;
|
||||
|
||||
while (currentIndex !== 0) {
|
||||
randomIndex = Math.floor(Math.random() * currentIndex);
|
||||
|
@ -82,7 +83,6 @@ module.exports = {
|
|||
randomNum(min, max) {
|
||||
min = Math.ceil(min);
|
||||
max = Math.floor(max);
|
||||
|
||||
return Math.floor(Math.random() * (max - min + 1) + min);
|
||||
},
|
||||
|
||||
|
@ -97,10 +97,7 @@ module.exports = {
|
|||
printDate(client, date, format = "", locale = client.defaultLanguage) {
|
||||
const languageData = client.languages.find(language => language.name === locale);
|
||||
if (format === "" || format === null) format = languageData.defaultMomentFormat;
|
||||
|
||||
return moment(new Date(date))
|
||||
.locale(languageData.moment)
|
||||
.format(format);
|
||||
return moment(new Date(date)).locale(languageData.moment).format(format);
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -115,8 +112,7 @@ module.exports = {
|
|||
convertTime(client, time, type = false, noPrefix = false, locale = this.defaultLanguage) {
|
||||
const languageData = client.languages.find(language => language.name === locale);
|
||||
const m = moment(time).locale(languageData.moment);
|
||||
|
||||
return (type ? m.toNow(noPrefix) : m.fromNow(noPrefix));
|
||||
return type ? m.toNow(noPrefix) : m.fromNow(noPrefix);
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
|
@ -8,13 +8,21 @@ function dateTimePad(value, digits) {
|
|||
}
|
||||
|
||||
function format(tDate) {
|
||||
return (dateTimePad((tDate.getDate()), 2) + "-" +
|
||||
dateTimePad((tDate.getMonth() + 1), 2) + "-" +
|
||||
dateTimePad(tDate.getFullYear(), 2) + " " +
|
||||
dateTimePad(tDate.getHours(), 2) + ":" +
|
||||
dateTimePad(tDate.getMinutes(), 2) + ":" +
|
||||
dateTimePad(tDate.getSeconds(), 2) + "." +
|
||||
dateTimePad(tDate.getMilliseconds(), 3));
|
||||
return (
|
||||
dateTimePad(tDate.getDate(), 2) +
|
||||
"-" +
|
||||
dateTimePad(tDate.getMonth() + 1, 2) +
|
||||
"-" +
|
||||
dateTimePad(tDate.getFullYear(), 2) +
|
||||
" " +
|
||||
dateTimePad(tDate.getHours(), 2) +
|
||||
":" +
|
||||
dateTimePad(tDate.getMinutes(), 2) +
|
||||
":" +
|
||||
dateTimePad(tDate.getSeconds(), 2) +
|
||||
"." +
|
||||
dateTimePad(tDate.getMilliseconds(), 3)
|
||||
);
|
||||
}
|
||||
|
||||
module.exports = class Logger {
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue