Senouy -bot developement
NoFaTe -providing API
This Discord bot retrieves and displays player statistics for Battlefield: Bad Company 2 using the Emulator Nexus API.
- Node.js
- Discord.js@latest
- Axios
- Dotenv
- A Discord Bot Token
-
Clone this repository to your local machine.
git clone https://github.com/S3nouy/bfbc2-botstats.git
-
Change directory to bfbc2-botstats and install the required dependencies using npm:
npm install discord.js@latest axios dotenv
-
Edit the .env file
BOT_TOKEN=
your_bot_token_here
CLIENT_ID=
owner_discord_id
GUILD_ID=
discord_server_id
-
Edit the config.json file
"token": "
your_bot_token_here
","clientId": "
owner_discord_id
","guildId": "
discord_server_id
" -
Upload commands to Discord by using the following command:
node register-commands.js
-
Finally start the bot using the following command:
node index.js
/stats player_name
Replace player_name
with the Battlefield: Bad Company 2 player name you want to retrieve stats for.
/score playername
Replace player_name
with the Battlefield: Bad Company 2 player name you want to retrieve score for.
Check index.js if you want to protect your stats from being show to other users. It will look like this.
If you have any questions, suggestions, or need assistance, feel free to reach out to me on Discord.
Discord Username: CptYounes#1716
Happy coding! 🚀