Фикс queue

This commit is contained in:
JonnyBro 2022-01-04 23:34:43 +05:00
parent ca1c011bbc
commit 80bbc69d82
4 changed files with 35 additions and 13 deletions

View file

@ -7,7 +7,7 @@ class Queue extends Command {
super(client, { super(client, {
name: "queue", name: "queue",
dirname: __dirname, dirname: __dirname,
enabled: false, enabled: true,
guildOnly: true, guildOnly: true,
aliases: ["qu"], aliases: ["qu"],
memberPermissions: [], memberPermissions: [],
@ -18,7 +18,7 @@ class Queue extends Command {
}); });
} }
async run(message, args, data) { async run(message, args, data, interaction) {
const voice = message.member.voice.channel; const voice = message.member.voice.channel;
const queue = this.client.player.getQueue(message); const queue = this.client.player.getQueue(message);
@ -52,15 +52,15 @@ class Queue extends Command {
}) })
.addField(message.translate("music/np:CURRENTLY_PLAYING"), `[${queue.songs[0].name}](${queue.songs[0].url})\n*Добавил ${queue.songs[0].member}*\n`); .addField(message.translate("music/np:CURRENTLY_PLAYING"), `[${queue.songs[0].name}](${queue.songs[0].url})\n*Добавил ${queue.songs[0].member}*\n`);
FieldsEmbed.setArray(queue.songs[1] ? queue.songs.slice(1, queue.songs.length) : []) FieldsEmbed
.setArray(queue.songs[1] ? queue.songs.slice(1, queue.songs.length) : [])
.setAuthorizedUsers([message.author.id]) .setAuthorizedUsers([message.author.id])
.setChannel(message.channel) .setChannel(message.channel)
.setElementsPerPage(5) .setElementsPerPage(5)
.setDeleteOnTimeout(true) .setDeleteOnTimeout(true)
.setPageIndicator(true) .setPageIndicator(true)
.formatField("Очередь", (track) => `[${track.name}](${track.url})\n*Добавил ${track.member}*\n`); .formatField("Очередь", (track) => `[${track.name}](${track.url})\n*Добавил ${track.member}*\n`)
.build();
FieldsEmbed.build();
} }
}; };

View file

@ -193,6 +193,32 @@
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-md-12">
<pre class="brush: html"> <pre class="brush: html">
-----------------------------------------------------------------------------------------
JaBa v3.2
-----------------------------------------------------------------------------------------
Изменения
- Переход на discord.js v13.
Обновление очень большое, обязательно сообщайте мне если найдёте ошибку!
Примечания
- tictactoe отключена до обновления модуля на discord.js 13!
-----------------------------------------------------------------------------------------
JaBa v3.1.6
-----------------------------------------------------------------------------------------
Исправления
- Некорректное описание seek.
- Некорректная работа seek.
- Некорректное описание unban.
- Мелкие правки в локализации.
(Спасибо Добрый Спецназ#8801 за помощь в поиске багов)
-----------------------------------------------------------------------------------------
JaBa v3.1.5
-----------------------------------------------------------------------------------------
Изменено
- Откат изменений из v3.1.4.
----------------------------------------------------------------------------------------- -----------------------------------------------------------------------------------------
JaBa v3.1.4 JaBa v3.1.4
----------------------------------------------------------------------------------------- -----------------------------------------------------------------------------------------

View file

@ -40,7 +40,6 @@ const client = new JaBa({
}); });
const init = async () => { const init = async () => {
// Search for all commands
const directories = await readdir("./commands/"); const directories = await readdir("./commands/");
client.logger.log(`Loading a total of ${directories.length} categories.`, "log"); client.logger.log(`Loading a total of ${directories.length} categories.`, "log");
directories.forEach(async (dir) => { directories.forEach(async (dir) => {
@ -53,7 +52,6 @@ const init = async () => {
}); });
}); });
// Then we load events, which will include our message and ready event.
const evtFiles = await readdir("./events/"); const evtFiles = await readdir("./events/");
client.logger.log(`Loading a total of ${evtFiles.length} events.`, "log"); client.logger.log(`Loading a total of ${evtFiles.length} events.`, "log");
evtFiles.forEach((file) => { evtFiles.forEach((file) => {
@ -64,9 +62,8 @@ const init = async () => {
delete require.cache[require.resolve(`./events/${file}`)]; delete require.cache[require.resolve(`./events/${file}`)];
}); });
client.login(client.config.token); // Log in to the discord api client.login(client.config.token);
// connect to mongoose database
mongoose.connect(client.config.mongoDB, { mongoose.connect(client.config.mongoDB, {
useNewUrlParser: true, useNewUrlParser: true,
useUnifiedTopology: true useUnifiedTopology: true
@ -85,11 +82,9 @@ const init = async () => {
init(); init();
// if there are errors, log them
client.on("disconnect", () => client.logger.log("Bot is disconnecting...", "warn")) client.on("disconnect", () => client.logger.log("Bot is disconnecting...", "warn"))
.on("reconnecting", () => client.logger.log("Bot reconnecting...", "log")) .on("reconnecting", () => client.logger.log("Bot reconnecting...", "log"))
.on("error", (e) => client.logger.log(e, "error")) .on("error", (e) => client.logger.log(e, "error"))
.on("warn", (info) => client.logger.log(info, "warn")); .on("warn", (info) => client.logger.log(info, "warn"));
// if there is an unhandledRejection, log them
process.on("unhandledRejection", (err) => console.error(err)); process.on("unhandledRejection", (err) => console.error(err));

View file

@ -1,6 +1,6 @@
{ {
"name": "jaba", "name": "jaba",
"version": "3.1.4", "version": "3.2",
"description": "A very complete Discord bot (more than 100 commands) that uses the Discord.js", "description": "A very complete Discord bot (more than 100 commands) that uses the Discord.js",
"main": "index.js", "main": "index.js",
"private": true, "private": true,
@ -33,6 +33,7 @@
"discord-canvas": "^1.3.2", "discord-canvas": "^1.3.2",
"discord-giveaway": "^1.1.5", "discord-giveaway": "^1.1.5",
"discord-giveaways": "^4.4.3", "discord-giveaways": "^4.4.3",
"discord-paginationembed": "github:gazmull/discord-paginationembed#v3",
"discord-tictactoe": "^2.2.0", "discord-tictactoe": "^2.2.0",
"discord-together": "^1.3.25", "discord-together": "^1.3.25",
"discord.js": "^13.5.0", "discord.js": "^13.5.0",