93679f8828c804d81ed200c44f3a0f5d7d82a2f2
VRBattles Discord Bot (Development)
This is the development version of the VRBattles Discord Bot. It connects to the VRBattles API and provides various commands for users to interact with VRBattles data through Discord.
Setup
- Clone the repository:
git clone <repository-url>
cd discord-bot
- Install dependencies:
npm install
- Create a
.envfile based on.env.example:
cp .env.example .env
- Set up your development environment:
- Create a new Discord Application at https://discord.com/developers/applications
- Create a new bot for your application
- Get your bot token and client ID
- Create a new Supabase project at https://supabase.com
- Get your Supabase URL and anon key
- Update your
.envfile with the development credentials:
DISCORD_TOKEN=your_dev_bot_token
CLIENT_ID=your_dev_client_id
SUPABASE_URL=your_dev_supabase_url
SUPABASE_KEY=your_dev_supabase_key
NODE_ENV=development
Development
Start the bot in development mode:
npm run dev
Deploy slash commands to your development Discord server:
npm run deploy-commands:dev
Available Commands
/ping- Test bot connectivity/finduser- Find a user by username/matchhistory- View match history/findteam- Find a team by name/subscribe- Subscribe to game notifications (Admin only)/unsubscribe- Unsubscribe from game notifications (Admin only)/register_server- Register Discord server with BattleBot (Admin only)/list_subscriptions- List all game subscriptions (Admin only)
API Integration
The bot connects to the following APIs:
- VRBattles API (
https://www.vrbattles.gg/api/) - Discord API (via discord.js)
- Supabase Database
Contributing
- Create a new branch for your feature:
git checkout -b feature/your-feature-name
- Make your changes and commit them:
git add .
git commit -m "Description of your changes"
- Push to your branch:
git push origin feature/your-feature-name
- Create a Pull Request to merge into the dev branch
Description
Languages
JavaScript
98.2%
Shell
1.4%
Dockerfile
0.4%