Zuk
Zuk
DIAdiscord.js - Imagine an app
Created by Zuk on 10/10/2024 in #djs-questions
Ephemeral replay to a channel message
Hey is it possible to replay to a message with an ephemeral or something similar (so only the user can see it, and it's not part of the channel message). From this event: client.on(Events.MessageCreate, (msg) => {}) Thanks!
8 replies
DIAdiscord.js - Imagine an app
Created by Zuk on 10/6/2024 in #djs-questions
Database connection
Hey I have a mysql database, I can connect to it and run CRUD actions. But I feel like the setup is wrong. I have this function:
export const db = mysql.createConnection({
host: process.env.DB_HOST,
user: process.env.DB_USER,
password: process.env.DB_PASSWORD,
database: process.env.DB_NAME,
});
export const db = mysql.createConnection({
host: process.env.DB_HOST,
user: process.env.DB_USER,
password: process.env.DB_PASSWORD,
database: process.env.DB_NAME,
});
and I call the db for running queries. But that means I create a connection on any query, what would be the correct way to connection the bot on startup and have a live connection?
13 replies
DIAdiscord.js - Imagine an app
Created by Zuk on 10/5/2024 in #djs-questions
Message periodic scanner
Hey! I am trying to figure out if I there is a better way to handle my case: User can create suggestion on my server. The suggestion is creates using a form and return an embedded message. Each suggestion has and expiry date and users can vote on it, once the expiry date has been reached the suggestion is removed from the channel and moved to approved/ denied channels. All of that is currently working, but I feel that my solution can be improved. Currently the bot scans every x amount of time the messages in the channel and see the suggestions expiry date has reached to handle it. I am trying to find a better way of handling it like cron jobs or another bot that only run scans and triggers actions on the main bot. Thanks you for the help!
6 replies