use webhooks

This commit is contained in:
legop3
2026-01-12 01:19:58 -05:00
parent 870fdc63be
commit 3b67e81451
4 changed files with 110 additions and 28 deletions
+3 -1
View File
@@ -45,7 +45,7 @@ function getGuildConfig(guildId) {
return store[String(guildId)] || null;
}
function setGuildConfig(guildId, { channelId, mode }) {
function setGuildConfig(guildId, { channelId, mode, webhookId, webhookToken }) {
if (!guildId) {
throw new Error('guildId required');
}
@@ -57,6 +57,8 @@ function setGuildConfig(guildId, { channelId, mode }) {
guildId: key,
channelId: channelId != null ? String(channelId) : prev?.channelId || null,
mode: normalizeMode(mode, prev?.mode || 'global'),
webhookId: webhookId != null ? String(webhookId) : prev?.webhookId || null,
webhookToken: webhookToken != null ? String(webhookToken) : prev?.webhookToken || null,
createdAt: prev?.createdAt || now,
updatedAt: now,
};