mirror of
https://github.com/JonnyBro/JaBa.git
synced 2024-11-21 20:54:58 +05:00
Фикс queue
This commit is contained in:
parent
ca1c011bbc
commit
80bbc69d82
4 changed files with 35 additions and 13 deletions
|
@ -7,7 +7,7 @@ class Queue extends Command {
|
|||
super(client, {
|
||||
name: "queue",
|
||||
dirname: __dirname,
|
||||
enabled: false,
|
||||
enabled: true,
|
||||
guildOnly: true,
|
||||
aliases: ["qu"],
|
||||
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 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`);
|
||||
|
||||
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])
|
||||
.setChannel(message.channel)
|
||||
.setElementsPerPage(5)
|
||||
.setDeleteOnTimeout(true)
|
||||
.setPageIndicator(true)
|
||||
.formatField("Очередь", (track) => `[${track.name}](${track.url})\n*Добавил ${track.member}*\n`);
|
||||
|
||||
FieldsEmbed.build();
|
||||
.formatField("Очередь", (track) => `[${track.name}](${track.url})\n*Добавил ${track.member}*\n`)
|
||||
.build();
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -193,6 +193,32 @@
|
|||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<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
|
||||
-----------------------------------------------------------------------------------------
|
||||
|
|
7
index.js
7
index.js
|
@ -40,7 +40,6 @@ const client = new JaBa({
|
|||
});
|
||||
|
||||
const init = async () => {
|
||||
// Search for all commands
|
||||
const directories = await readdir("./commands/");
|
||||
client.logger.log(`Loading a total of ${directories.length} categories.`, "log");
|
||||
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/");
|
||||
client.logger.log(`Loading a total of ${evtFiles.length} events.`, "log");
|
||||
evtFiles.forEach((file) => {
|
||||
|
@ -64,9 +62,8 @@ const init = async () => {
|
|||
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, {
|
||||
useNewUrlParser: true,
|
||||
useUnifiedTopology: true
|
||||
|
@ -85,11 +82,9 @@ const init = async () => {
|
|||
|
||||
init();
|
||||
|
||||
// if there are errors, log them
|
||||
client.on("disconnect", () => client.logger.log("Bot is disconnecting...", "warn"))
|
||||
.on("reconnecting", () => client.logger.log("Bot reconnecting...", "log"))
|
||||
.on("error", (e) => client.logger.log(e, "error"))
|
||||
.on("warn", (info) => client.logger.log(info, "warn"));
|
||||
|
||||
// if there is an unhandledRejection, log them
|
||||
process.on("unhandledRejection", (err) => console.error(err));
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "jaba",
|
||||
"version": "3.1.4",
|
||||
"version": "3.2",
|
||||
"description": "A very complete Discord bot (more than 100 commands) that uses the Discord.js",
|
||||
"main": "index.js",
|
||||
"private": true,
|
||||
|
@ -33,6 +33,7 @@
|
|||
"discord-canvas": "^1.3.2",
|
||||
"discord-giveaway": "^1.1.5",
|
||||
"discord-giveaways": "^4.4.3",
|
||||
"discord-paginationembed": "github:gazmull/discord-paginationembed#v3",
|
||||
"discord-tictactoe": "^2.2.0",
|
||||
"discord-together": "^1.3.25",
|
||||
"discord.js": "^13.5.0",
|
||||
|
|
Loading…
Reference in a new issue