A Discord bot that automatically updates user nicknames with their gaming statistics from CSWatch.in. The bot displays FACEIT level, ELO, and CS2 Premier rank with fully configurable display options.
- Automatically scrapes gaming stats from cswatch.in
- Updates Discord nicknames with FACEIT level, ELO, and CS2 Premier rank
- Fully configurable display options (show/hide any combination of stats)
- Supports multiple users with individual Steam IDs
- Per-user configuration overrides
- Configurable update intervals
- Handles missing data gracefully
- Rate limiting to avoid being blocked
- Node.js (version 16 or higher)
- A Discord bot token
- Discord server with "Manage Nicknames" permission for the bot
npm install- Copy the example environment file:
cp .env.example .env- Edit
.envwith your configuration:
DISCORD_BOT_TOKEN=your_discord_bot_token_here
GUILD_ID=your_discord_server_id_here
# Global display settings (defaults for all users)
SHOW_FACEIT_INFO=true
SHOW_FACEIT_ELO=true
SHOW_PREMIER_INFO=true
USER_1_DISCORD_ID=123456789012345678
USER_1_STEAM_ID=123456789012345678
USER_1_NICKNAME=ShyaM
USER_2_DISCORD_ID=123456789012345678
USER_2_STEAM_ID=123456789012345678
USER_2_NICKNAME=PlayerTwo
# Optional: Override global settings for this user
USER_2_SHOW_FACEIT_ELO=false
UPDATE_INTERVAL_MINUTES=30- Go to https://discord.com/developers/applications
- Create a new application and bot
- Copy the bot token to your
.envfile - Invite the bot to your server with "Manage Nicknames" permission
npm startDISCORD_BOT_TOKEN: Your Discord bot tokenGUILD_ID: The Discord server ID where the bot will operateUPDATE_INTERVAL_MINUTES: How often to update nicknames (default: 30 minutes)
SHOW_FACEIT_INFO: Show FACEIT level/ELO section (default: true)SHOW_FACEIT_ELO: Show ELO number when FACEIT info is enabled (default: true)SHOW_PREMIER_INFO: Show CS2 Premier rank (default: true)
USER_X_DISCORD_ID: Discord user ID for each userUSER_X_STEAM_ID: Steam ID for each user (found in their Steam profile URL)USER_X_NICKNAME: Preferred nickname base for each user
USER_X_SHOW_FACEIT_INFO: Override global FACEIT info setting for this userUSER_X_SHOW_FACEIT_ELO: Override global FACEIT ELO setting for this userUSER_X_SHOW_PREMIER_INFO: Override global Premier info setting for this user
To find a Steam ID:
- Go to the user's Steam profile
- Copy the number from the URL (e.g.,
132456789fromhttps://cswatch.in/player/123456789)
The bot will format nicknames based on your configuration:
ShyaM[Lvl9-1796Elo][Prem22767]PlayerTwo[Lvl7-1245Elo][Prem18234]
ShyaM[Lvl9][Prem22767]
ShyaM[Prem22767]
ShyaM[Lvl9-1796Elo]
ShyaM
- Make sure the bot has "Manage Nicknames" permission
- Verify Steam IDs are correct (18-digit numbers starting with 765)
- Check that CSWatch.in has data for the provided Steam IDs
- The bot needs time to scrape data - first update may take a few minutes
If you encounter issues, check the console logs for error messages. Common issues include:
- Invalid Discord bot token
- Missing permissions
- Incorrect Steam IDs
- CSWatch.in being temporarily unavailable