Alzalia
DIAdiscord.js - Imagine an app
•Created by Alzalia on 8/11/2023 in #djs-questions
Edit a database when mute/warn is over
So, I did a command to mute (using timeout method, no problem, it works), same for warn (simple message).
For each and every sanction made by a moderator, it's stored in a SQLite database with some useful infos. Now i can have the infos stored in the db, and the message of "warn/mute executed".
What i'm stuck onto is how to make a long period timeout ? Say 3 months ? I tried, on ChatGPT recommandation (so like, worst idea I could have had but who knows) to use node-cron and 'events' so that an event is emitted, and another file receive it, and launch a cron.schedule to the said date, and then it executes the code of updating the db and sending a message saying the sanction is over.
(Files in next message)
11 replies
DIAdiscord.js - Imagine an app
•Created by Alzalia on 7/25/2023 in #djs-questions
Error after following the cooldown guide
Hi. New to discord.js, I thus followed the guide. Everything worked well, but I then arrived to the cooldown part. And now, I get this error when running
node index.js
:
And here is my client on event create part :
But my code is basically the exact same as the guide one, so... I really don't get what happens ;-;
Thank you for your time ^^6 replies
DIAdiscord.js - Imagine an app
•Created by Alzalia on 7/24/2023 in #djs-questions
Keep the bot online
So, this is probably a VERY stupid question.
I have a VPS, opened an SSH session using PuTTy, and executed
node index.js
. The bot became online, and commands worked beautiful. So I closed PuTTy.
But after a few minutes, the bot went offline again. I though it would be as simple as just running the file, and then go go bot, but apparently not. Do I need to install a program like pm2 ? (Because this programm was used for pcs where I found it, so I don't know)
Thank you very much for your time !4 replies