add structure for simplifie creation of global command

This commit is contained in:
Arthur Puechberty
2026-01-17 15:13:22 +01:00
parent 08647924e3
commit d5f0f4c30b
11 changed files with 593 additions and 17 deletions
+16
View File
@@ -0,0 +1,16 @@
const db = require("../db.js");
module.exports = async function getPrefix(guildId) {
const prefix = await new Promise((resolve, reject) => {
db.get(
`SELECT prefix FROM prefix WHERE guildId = ?`,
[guildId],
(err, row) => {
if (err) reject(err);
resolve(row);
},
);
});
return prefix ? prefix.prefix : "!";
};