use discord.js in TypeScript to create discord bot
conda create -n {ENV_NAME} python=3.10 nodejs=20
npm i
pip install -r pip_requirements.txt
gcloud auth application-default set-quota-project <PROJECT_ID>
gcloud auth application-default login
cp .env.sample .env
set your environment variable according to your app
npm run build
npm run start
or use npm run dev
for developing
Discord Developer Portal https://discord.com/developers/applications
- Create an application in developer portal
- Copy
CLIENT_ID
fromOAuth2
tab - Copy
Token
fromBot
tab - Copy
GUILD_ID
from your channel
- In developer portal
OAuth2
->URL Generator
- Check
bot
option in scopes section - Check the permissions your want to set for your bot
(
Send Messages
,Use Slash Commands
for example) - Copy the generated URL
- Visit the link you copied in step4
- Select the channel you want to add the bot
- Run the bot application and enjoy it