To start contributing, you either need to install Bun
-
Install Bun using curl
curl -fsSL https://bun.sh/install | bash
or if you're on Windows:powershell -c "irm bun.sh/install.ps1 | iex"
-
Install npm.
-
Clone the repository.
git clone https://github.com/yorunoken/hanamibot
-
Navigate inside the directory and install the dev, and normal dependencies.
cd hanamibot && npm install -D
-
Install ESLint as an extension in your IDE to help with types.
-
Fill out
.env.local
with your API keys (see below to see how). -
You can use
bun start
to start the bot and test your code.
You need to fill .env.local
with the approriate API keys to make the bot work. Here's how:
-
Go to Discord's developer portal and create a new application.
-
Navigate to the
Bot
tab, seen on the left. -
Reset its token and get the new one.
-
You should also enable all 3 of the privilaged intents for the bot to function.
-
Go to osu!s home page and press f12 to open up the developer page.
-
Navigate to the
Storage
tab. If you don't see it, click on the arrow and reveal the dropout box. -
Inside
Storage
tab, click oncookies
andhttps://osu.ppy.sh
-
Search for an item named
osu_session
-
Copy its value, that's your
OSU_SESSION
key.
-
Go to osu! account settings and scroll until you see
OAuth
section. -
Create a new OAuth application, give it a name (you can leave Callback URL part blank) and register it.
-
Edit your newly made application.
-
Copy its Client ID and Client secret and you're good to go.
This one is a little tricky, because you will need to host a website.
-
Hosting websites are free using Vercel.
-
Create a new project in the free hosting platform, Vercel and select the
Import Third-Party Git Repository
option. -
Input my template repo https://github.com/YoruNoKen/hanamiVerifier and build the website.
-
Copy the URL, add it to
Application Callback URLs
in your osu! Application and your .env.local file.