A Discord bot for tracking Clash of Clans clan participation and scoring with embeds and slash commands.
- 🎮 Discord Slash Commands: Modern Discord integration with embeds
- 💰 Donation Scoring: Calculate scores based on clan member donations
- 🏛️ Capital Raid Scoring: Score members based on capital raid performance
- ⚔️ War League Scoring: Comprehensive scoring for clan war league performance
- 🛡️ Regular War Scoring: Score members based on regular war performance
- 🏆 Monthly Leaderboard: Combined scoring across all categories for the current month
- Go to Discord Developer Portal
- Create a new application
- Go to "Bot" section and create a bot
- Copy the bot token
- Go to "OAuth2" > "URL Generator"
- Select "bot" and "applications.commands" scopes
- Select "Send Messages", "Use Slash Commands" permissions
- Use the generated URL to invite the bot to your server
-
Copy
.env.exampleto.env:cp .env.example .env
-
Fill in your environment variables:
DISCORD_BOT_TOKEN=your_discord_bot_token_here DISCORD_CLIENT_ID=your_discord_client_id_here DISCORD_GUILD_ID=your_discord_guild_id_here # Optional: for faster testing COC_API_TOKEN=your_clash_of_clans_api_token_here
-
Install dependencies:
npm install
-
Deploy slash commands:
npm run deploy
-
Start the bot:
npm start
/cwl-scores- Get most recent Clan War League scores/donation-scores- Get donation scores for this current season/raid-scores- Get raid scores for most recent Clan Capital raid/war-scores- Get scores for the current regular war/leaderboard- Get combined leaderboard summing all category scores for this month/war-history- Get historical war data for the clan/update-scores- Update and save all clan scores to files/help- Show help information and commands
/clan-scores #2LV0CCP9P
/player-info #98CYUGLP
/help
- 10,000+: 15 points
- 7,500+: 10 points
- 5,000+: 7 points
- 2,500+: 5 points
- 500+: 3 points
- 25,000+: 5 points
- 20,000+: 3 points
- 15,000+: 2 points
- 10,000+: 1 point
- Perfect stars:
- 3+ Attacks: 30 points
- 2 Attack2: 20 points
- 1 Attack: 10 points
- 2+ avg stars + 80%+ destruction: 25 points
- 2+ avg stars + 70%+ destruction: 20 points
- 2+ avg stars + 60%+ destruction: 15 points
- 2+ avg stars + 50%+ destruction: 15 points
- 1+ avg stars: 5 points
- 6 stars (perfect): 3 points
- 4-5 stars: 2 points
- 2-3 stars: 1 point
The leaderboard combines scores from:
- All donation activity for the current month
- All raid activity for the current month
- All CWL activity for the current month
- All regular war activity for the current month