summary refs log tree commit diff
path: root/libs/webhook.js
blob: 5c89f12c07425eb082c75e8fb8d0baf37c9b337d (plain)
1
2
3
4
5
6
7
8
9
10
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 });
	}
}