mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-04-25 07:32:19 -05:00
* Mode Map Pool picker component initial
* Component in settings
* Lottery initial
* Fix tests
* useTrusters as perf optimization
* unionAll -> union
* Fancy picker for tournaments
* Map pools memento
* FC's initial
* Friend code when registering for tournament
* FC in flows
* SHow FC in places
* Add catch in case
* Fix disabling
* Show ELO changed
* Wiggle MapPool button if already selected
* CSS vars typing
* Rechallenging
* Team (all) leaderboard
* Preview groups
* Fix chat width changing
* Solid reported weapons
* Clearer cancel requested header
* Dynamic revalidates
* spDiff from memento
* (Partly) Revert "Remove screen banning"
This reverts commit 076cabfbfa.
* Screen indicators in looking view
* FC i18n
* noscreen = 0
* E2E test
* E2E 2
28 lines
888 B
TypeScript
28 lines
888 B
TypeScript
/* eslint-disable no-console */
|
|
import "dotenv/config";
|
|
import invariant from "tiny-invariant";
|
|
import { ADMIN_ID } from "~/constants";
|
|
import { FRIEND_CODE_REGEXP } from "~/features/sendouq/q-constants";
|
|
import * as UserRepository from "~/features/user-page/UserRepository.server";
|
|
|
|
async function main() {
|
|
const discordId = process.argv[2]?.trim();
|
|
|
|
invariant(discordId, "discord id is required (argument 1)");
|
|
|
|
const newFriendCode = process.argv[3]?.trim();
|
|
|
|
invariant(discordId, "friend code is required (argument 2)");
|
|
|
|
invariant(FRIEND_CODE_REGEXP.test(newFriendCode), "Invalid friend code");
|
|
|
|
await UserRepository.insertFriendCode({
|
|
friendCode: newFriendCode,
|
|
submitterUserId: ADMIN_ID,
|
|
userId: await UserRepository.findByIdentifier(discordId).then((u) => u!.id),
|
|
});
|
|
console.log(`Friend code updated: ${discordId} - ${newFriendCode}`);
|
|
}
|
|
|
|
void main();
|