To set up the self-hosted version of the bot, the following are required:
- Node.js v16.9.0 or higher
- Discord.js v14
To start, clone the git repository and install all required dependencies:
git clone https://github.com/richardscull/RichardsCoffeeShop
cd RichardsCoffeeShop
npm install
But before we can start the bot, we will need:
- A Discord application. If you don't know how to make one, check this guide!
- An Ngrok account for free URL hosting
- An osu! account to create an app for sending osu!API v2 requests
After obtaining these, create and fill in the .env file with the required information:
# Bot information
DISCORD_SECRET= Discord application secret
DISCORD_TOKEN= Discord application token
DISCORD_ID= Discord application ID
# Osu information
OSU_SECRET= Osu client secret
OSU_ID= Osu client id
# Web server
NGROK_TOKEN= Ngrok authtoken
NGROK_PORT= Ngrok port #By default is 3000
# Yours GitHub working branch
GITHUB_BRANCH_URL= #By default is /master
After that, you can successfully run bot by typing npm run build:start
or yarn build:start
!
Warning: Don't forget to configure callbacks after starting the bot. Refer to the section below for instructions.
To set up the web server for user login, you will need to set up callbacks.
Note: The use of Ngrok to expose a local development server may cause the need to change URLs if the bot is restarted.
For Discord Application, you will need to go on Developer portal to your application, open OAuth2 and add Redirect to https://YOUR-NGROK-URL.ngrok.io/callback
To change the osu! client URL, go to your client, and change yours Application Callback URL to https://YOUR-NGROK-URL.ngrok.io/