mirror of
https://github.com/arthur-pbty/LazyBot.git
synced 2026-06-07 14:55:08 +02:00
add structure for simplifie creation of global command
This commit is contained in:
@@ -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 : "!";
|
||||
};
|
||||
Reference in New Issue
Block a user