diff options
| author | Amygdala Peanut-Almond <amygdala@almond.desloratadyna.net> | 2026-04-22 22:49:01 +0200 |
|---|---|---|
| committer | Amygdala Peanut-Almond <amygdala@almond.desloratadyna.net> | 2026-04-22 22:49:01 +0200 |
| commit | 3572b97661a3f7c6c29e958b63c20d9f2ef936ac (patch) | |
| tree | b3ee056039cf792edd467e5172feee25a07dd56c /libs/webhook.js | |
initialise repository
Signed-off-by: Amygdala Peanut-Almond <amygdala@almond.desloratadyna.net>
Diffstat (limited to 'libs/webhook.js')
| -rw-r--r-- | libs/webhook.js | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/libs/webhook.js b/libs/webhook.js new file mode 100644 index 0000000..5c89f12 --- /dev/null +++ b/libs/webhook.js @@ -0,0 +1,11 @@ +const Discord = require("discord.js"); + +module.exports = { + async getWebhook(guildId) { + const result = await database.query("SELECT * FROM amygdala_webhook WHERE guildId = $1;", [guildId]); + if (result.rows.length !== 1) return null; + + return new Discord.WebhookClient({ url: result.rows[0].webhookurl }); + } +} + |
