Fix issue #19: Add unified campaign sync

This commit is contained in:
Gitea OpenCode Agent
2026-10-14 14:07:52 +00:00
parent 9d9738b2b4
commit 0a8452b3c8
22 changed files with 1469 additions and 921 deletions

View File

@@ -47,11 +47,23 @@ function createDragonrollApi(config) {
return payload;
}
// The backend hands out the sign-up link the person opens to pick a campaign,
// so the bot never builds one itself: every service shows the same link.
async function startAuthorization(guildId, guildName, discordUserId, discordUserName) {
return request('/discord/link/start', {
const payload = await request('/link/start', {
method: 'POST',
body: JSON.stringify({ guildId, guildName, discordUserId, discordUserName })
body: JSON.stringify({
service: 'discord',
target: {
id: String(guildId),
name: guildName,
user: discordUserName,
meta: { userId: String(discordUserId) }
}
})
});
if (!payload.linkUrl) throw new Error('Dragonroll did not provide a sign-up link. Update the Dragonroll backend.');
return payload;
}
async function claimLinkNotifications() {