mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-11-09 13:44:29 +08:00
impr: pass lboptout to bot linking command
!nuf
This commit is contained in:
parent
bc6777f949
commit
2c13284528
2 changed files with 12 additions and 3 deletions
|
|
@ -652,6 +652,7 @@ export async function linkDiscord(
|
|||
const userInfo = await UserDAL.getPartialUser(uid, "link discord", [
|
||||
"banned",
|
||||
"discordId",
|
||||
"lbOptOut",
|
||||
]);
|
||||
if (userInfo.banned) {
|
||||
throw new MonkeyError(403, "Banned accounts cannot link with Discord");
|
||||
|
|
@ -690,7 +691,7 @@ export async function linkDiscord(
|
|||
|
||||
await UserDAL.linkDiscord(uid, discordId, discordAvatar);
|
||||
|
||||
await GeorgeQueue.linkDiscord(discordId, uid);
|
||||
await GeorgeQueue.linkDiscord(discordId, uid, userInfo.lbOptOut ?? false);
|
||||
void addImportantLog("user_discord_link", `linked to ${discordId}`, uid);
|
||||
|
||||
return new MonkeyResponse("Discord account linked", {
|
||||
|
|
|
|||
|
|
@ -30,9 +30,17 @@ class GeorgeQueue extends MonkeyQueue<GeorgeTask> {
|
|||
await this.add(taskName, updateDiscordRoleTask);
|
||||
}
|
||||
|
||||
async linkDiscord(discordId: string, uid: string): Promise<void> {
|
||||
async linkDiscord(
|
||||
discordId: string,
|
||||
uid: string,
|
||||
lbOptOut: boolean
|
||||
): Promise<void> {
|
||||
const taskName = "linkDiscord";
|
||||
const linkDiscordTask = buildGeorgeTask(taskName, [discordId, uid]);
|
||||
const linkDiscordTask = buildGeorgeTask(taskName, [
|
||||
discordId,
|
||||
uid,
|
||||
lbOptOut,
|
||||
]);
|
||||
await this.add(taskName, linkDiscordTask);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue