mirror of
https://github.com/arthur-pbty/selfbot-discord.git
synced 2026-06-03 15:07:35 +02:00
corrige bug
This commit is contained in:
@@ -9,24 +9,20 @@ module.exports = {
|
|||||||
utilisation: '',
|
utilisation: '',
|
||||||
|
|
||||||
async execute(message: Message, args: string[], client: Client) {
|
async execute(message: Message, args: string[], client: Client) {
|
||||||
|
message.delete();
|
||||||
db.all(`SELECT * FROM task`, (err: any, rows: any) => {
|
db.all(`SELECT * FROM task`, (err: any, rows: any) => {
|
||||||
if (err) {
|
if (err) {
|
||||||
console.error(err.message);
|
console.error(err.message);
|
||||||
}
|
}
|
||||||
let tasks = '';
|
let tasks = '# Voici la liste des tâches :';
|
||||||
rows.forEach((row: any) => {
|
rows.forEach((row: any) => {
|
||||||
|
if (tasks.length + row.id.toString().length + row.name.length + row.time.toString().length > 1970) {
|
||||||
|
message.channel.send(tasks);
|
||||||
|
tasks = '';
|
||||||
|
}
|
||||||
tasks += `\n- ${row.id} - ${row.name} : ${row.time} minutes`;
|
tasks += `\n- ${row.id} - ${row.name} : ${row.time} minutes`;
|
||||||
});
|
});
|
||||||
|
message.channel.send(tasks);
|
||||||
const tasksChunks = tasks.match(/.{1,2000}/g);
|
|
||||||
|
|
||||||
if (tasksChunks) {
|
|
||||||
tasksChunks.forEach((chunk: string) => {
|
|
||||||
message.edit(`# Liste des tâches :${chunk}`);
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
message.edit(`# Liste des tâches :${tasks}`);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
Reference in New Issue
Block a user