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: '',
|
||||
|
||||
async execute(message: Message, args: string[], client: Client) {
|
||||
message.delete();
|
||||
db.all(`SELECT * FROM task`, (err: any, rows: any) => {
|
||||
if (err) {
|
||||
console.error(err.message);
|
||||
}
|
||||
let tasks = '';
|
||||
let tasks = '# Voici la liste des tâches :';
|
||||
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`;
|
||||
});
|
||||
|
||||
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}`);
|
||||
}
|
||||
message.channel.send(tasks);
|
||||
});
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user