Refer to https://support-dev.discord.com/hc/en-us/articles/42261641635351-Game-Stats-Widget-Experiment for more info
Before running the script, you will need to register applications on both developer portals:
- osu! API Credentials: Go to your osu! Account Settings, scroll down to OAuth Applications, and click New Application. Copy your
Client IDandClient Secret. - Discord App Credentials: Go to the Discord Developer Portal, create an application, and retrieve your
Application ID(App ID) and BotToken.
Clone the repository and install the required dependencies:
pnpm install
Ensure you have your TypeScript configuration set up if you are compiling manually, or use ts-node / tsx to execute the file directly.
Copy .env.example to a new file named .env in the root directory and populate it with your environment variables. In src/index.ts replace OSU_USERNAME with yours.
To execute the synchronization pipeline once:
pnpm dlx tsx src/index.ts
This repository includes a pre-configured GitHub Actions workflow that automatically runs the profile synchronization script every day at midnight UTC. You can also trigger it manually at any time via the Actions tab in your repository.
To make the automated workflow work, push your code to GitHub and add your environment variables in your repository settings (Settings -> Secrets and variables -> Actions):
Repository Secrets:
DISCORD_TOKEN- Your Discord bot token.OSU_CLIENT_SECRET- Your osu! application client secret.
Repository Variables:
APP_ID- Your Discord application ID.DISCORD_USER_ID- Your personal Discord User ID.OSU_CLIENT_ID- Your osu! application client ID.OSU_NAME- Your osu! username.OSU_MODE- Your preferred osu! game mode (e.g.,STD,MANIA,TAIKO,CATCH).
- Support for discord application slashcommands (User identity refreshing via command)



