From 3572b97661a3f7c6c29e958b63c20d9f2ef936ac Mon Sep 17 00:00:00 2001 From: Amygdala Peanut-Almond Date: Wed, 22 Apr 2026 22:49:01 +0200 Subject: initialise repository Signed-off-by: Amygdala Peanut-Almond --- libs/webhook.js | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 libs/webhook.js (limited to 'libs/webhook.js') 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 }); + } +} + -- cgit 1.4.1