Skip to content

Commit

Permalink
Update worker.js
Browse files Browse the repository at this point in the history
  • Loading branch information
Lulalaby committed Dec 29, 2023
1 parent c403771 commit d06d4f8
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ app.post('/token', async (c) => {
body: params,
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
'User-Agent': 'DiscordBot (https://github.com/Aiko-IT-Systems/cloudflare-discord-oidc-worker, v2.0.0)'
'User-Agent': 'DiscordBot (https://github.com/Aiko-IT-Systems/cloudflare-discord-oidc-worker, v3.0.0)'
}
}).then(res => res.json())

Expand All @@ -101,7 +101,7 @@ app.post('/token', async (c) => {
const userInfo = await fetch('https://discord.com/api/users/@me', {
headers: {
'Authorization': 'Bearer ' + r['access_token'],
'User-Agent': 'DiscordBot (https://github.com/Aiko-IT-Systems/cloudflare-discord-oidc-worker, v2.0.0)'
'User-Agent': 'DiscordBot (https://github.com/Aiko-IT-Systems/cloudflare-discord-oidc-worker, v3.0.0)'
}
}).then(res => res.json())

Expand All @@ -111,7 +111,7 @@ app.post('/token', async (c) => {
const serverResp = await fetch('https://discord.com/api/users/@me/guilds', {
headers: {
'Authorization': 'Bearer ' + r['access_token'],
'User-Agent': 'DiscordBot (https://github.com/Aiko-IT-Systems/cloudflare-discord-oidc-worker, v2.0.0)'
'User-Agent': 'DiscordBot (https://github.com/Aiko-IT-Systems/cloudflare-discord-oidc-worker, v3.0.0)'
}
})

Expand Down Expand Up @@ -142,7 +142,7 @@ app.post('/token', async (c) => {
let memberPromise = fetch(`https://discord.com/api/users/@me/guilds/${guildId}/member`, {
headers: {
'Authorization': 'Bearer ' + r['access_token'],
'User-Agent': 'DiscordBot (https://github.com/Aiko-IT-Systems/cloudflare-discord-oidc-worker, v2.0.0)'
'User-Agent': 'DiscordBot (https://github.com/Aiko-IT-Systems/cloudflare-discord-oidc-worker, v3.0.0)'
}
})

Expand All @@ -160,7 +160,7 @@ app.post('/token', async (c) => {
let memberPromise = fetch(`https://discord.com/api/guilds/${guildId}/members/${userInfo['id']}`, {
headers: {
'Authorization': 'Bot ' + c.env.DISCORD_TOKEN,
'User-Agent': 'DiscordBot (https://github.com/Aiko-IT-Systems/cloudflare-discord-oidc-worker, v2.0.0)'
'User-Agent': 'DiscordBot (https://github.com/Aiko-IT-Systems/cloudflare-discord-oidc-worker, v3.0.0)'
}
})

Expand Down Expand Up @@ -231,7 +231,7 @@ async function cacheRoles(event, env) {
}).toString(), {
headers: {
'Authorization': 'Bot ' + env.DISCORD_TOKEN,
'User-Agent': 'DiscordBot (https://github.com/Aiko-IT-Systems/cloudflare-discord-oidc-worker, v2.0.0)'
'User-Agent': 'DiscordBot (https://github.com/Aiko-IT-Systems/cloudflare-discord-oidc-worker, v3.0.0)'
}
})
let incrMemberResp = await incrMemberPromise
Expand Down

0 comments on commit d06d4f8

Please sign in to comment.