This Python script provides functionalities to interact with the Clash of Clans API. It allows users to retrieve information about players, clans, and clan war leagues.
- Retrieve player information including name, tag, trophies, level, best trophies, clan name, clan tag, and clan level.
- Get information about clan members including their name, rank, town hall level, and role.
- Access clan war league information including town hall levels distribution within the clan.
- Python 3.x installed on your system.
- Install the required Python packages using pip:
pip install requests python-dotenv matplotlib discord.py
- Player Information
- Enter choice
1. - Provide the player tag when prompted.
- Clan Information
- Enter choice
2. - Provide the clan tag when prompted.
- Clan War League Information
- Enter choice
3. - Provide the clan tag when prompted.
- Exit
- Enter choice
4.
Ensure to set the following environmental variables:
CLASH_TOKEN: Your Clash of Clans API token.DISCORD_TOKEN: Your Discord bot token (if you're using the Discord bot).
- Navigate to the directory containing the Python script.
- Run the script using the following command:
This Discord bot extends the functionality of the Clash of Clans Python script to provide real-time interaction within Discord servers.
- Responds to user queries in Discord channels.
- Supports commands for retrieving player information, clan information, and clan war league details.
- Restricts the bot's response to a maximum of 2000 characters to prevent message overflow.
- Python 3.x installed on your system.
- Discord account for creating and deploying bots.
- Install the required Python packages using pip:
pip install discord.py requests python-dotenv matplotlib
- Create a Discord Bot
- Go to the Discord Developer Portal and create a new application.
- Navigate to the "Bot" tab and click on "Add Bot" to create a bot user.
- Copy the bot token to use later.
- Environmental Variables
- Set the following environmental variables:
DISCORD_TOKEN: Your Discord bot token.CLASH_TOKEN: Your Clash of Clans API token.
- Run the Bot
- Run the Discord bot script using the following command:
python discord_bot.py
?clan [CLAN_TAG]: Retrieves information about the specified clan.?war [CLAN_TAG]: Retrieves clan war league information for the specified clan.?player [PLAYER_TAG]: Retrieves information about the specified player.
- Invite the bot to your Discord server using the generated bot invite link.
- Use the specified commands in any text channel to interact with the bot.
Feel free to customize and extend the functionality of the provided scripts to suit your needs! 🚀


