Fix issue #19: Add unified campaign sync
This commit is contained in:
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user