Skip to content

Discord bot for Clash of Clans discord servers written in Python

Notifications You must be signed in to change notification settings

Westo48/clash-discord

Repository files navigation

ClashCommander

Discord bot for Clash of Clans discord servers written in Python

Table of Contents

Introduction

ClashCommander is a discord bot written in Python that, while having a great many uses and commands, focuses primarily on discord member management. This entails, but is not limited to, adding an uninitiated role to incoming members, allowing members to give themselves roles based on their clash of clans profile, sending out announcements, updating discord user nicknames based on their player name, and focusing on discord server security.

Non-management commands include, but are also not limited to, returning player, clan, war, or CWL information. You can use ClashCommander to get player troop levels, clan donations, clan member war preference, war attacks and open bases, cwl scoreboard and lineups, and much much more!

Setup

Getting ClashCommander set up in your discord server can be somewhat confusing, but never fear for I am here.

  1. invite ClashCommander to your discord server

  2. claim your user in ClashCommander

    • client user claim
      • this will claim you as a user
  3. claim your discord server

    • admin guild claim
      • this will claim your discord server and add you as the guild admin within ClashCommander
      • guild is what the discord API calls a server
  4. link a player to your user

    • client player claim player tag api key
      • claims the requested player and links it to your discord user
      • getting your api key is annoying, but for everyone’s security this is necessary
  5. link a clan to your guild

    • admin clan claim clan tag
      • claims a clan and links it to the claimed guild
      • a linked player must be in the clan
        • this is also for security
  6. link existing roles to your server

    A. claim clan roles

    • admin clanrole claim clan tag role mention
      • links the clan role to a claimed clan

    B. claim rank roles

    • admin rankrole claim rank name role mention
      • links the rank role to a discord role
        • leader
        • co-leader
        • elder
        • member
        • uninitiated
          • this means they aren't verified or they aren't in a claimed clan
  7. Use ClashCommander, you are set up!

Setup Summary

  • invite Clash Discord to your server
  • claim your discord user
  • claim the guild
  • claim your player
  • claim your clan
  • claim the necessary roles

Usage

ClashCommander is largely command focused, meaning it doesn't do anything that it is not told to do. The only exception to this is when a member joins. If a server has claimed an uninitiated role, then they will be given that role, otherwise nothing will happen. The other action ClashCommander will take is if it detects a role being deleted from discord it will delete the database instance of that role.

Once setup is complete you will be able to interact with ClashCommander using the prefix / and run the commands as desired.

Command List

  • Help

    • help
      • displays relevant help-text regarding what commands can be run
      • react to the help message to parse through command groups
  • Client

    • client info

      • overview for the client
    • client user

      • client user options
        • options for client user command
        • profile default - return your user profile
        • player list - list claimed players
          • this command is great for copying tags from mobile
        • update - updates the requested player as your active player
          • values needed - player tag
        • sync - syncs your player information with LinkAPI centralized data
        • claim - claim your user
        • remove - removes your user
          • also removes all linked players
    • client player

      • client player options
        • options for client player command
        • claim - links a specified player to your user
          • values needed - player tag api key
        • remove - removes the linked player from your user
          • values needed - player tag
    • client clan

      • client clan options
        • options for client clan command
        • show default - return all claimed clans
  • Admin

    • all admin commands require ClashCommander server admin access

    • admin user

      • admin user options
        • options for admin player command
        • profile default - return specified user profile
        • player list - list claimed players for specified user
          • this command is great for copying tags from mobile
        • sync - syncs player information with LinkAPI centralized data for user
        • update - updates the requested player as the active player for the user
          • values needed - player tag
    • admin player

      • admin player options
        • options for admin player command
        • claim - links a player to the user
        • remove - removes the player from the user
    • admin clan

      • admin clan options
        • options for admin clan command
        • show default - return all claimed clans
        • claim - links a specified clan to your guild
          • values needed - clan tag
        • remove - removes the linked clan from your guild
          • values needed - clan tag
    • admin role

      • admin role options
        • options for admin role command
        • show default - return all linked roles
        • remove - removes claim on the mentioned role
          • values needed - role mention
    • admin clanrole

      • admin clanrole options
        • options for admin clanrole command
        • claim - links a specified clanrole the specified guild's claimed clan
          • values needed - role mention clan tag
    • admin rankrole

      • admin rankrole options
        • options for admin rankrole command
        • claim - links a specified rankrole the specified Clash of Clans rank
          • values needed - role mention rank name
          • rank names
            • leader
            • co-leader
            • elder
            • member
            • uninitiated
              • this means they aren't verified or they aren't in a claimed clan
    • admin guild

      • claims the guild by discord guild id within ClashCommander
      • sets the user who called the command as the guild admin within ClashCommander
        • if the guild has already been claimed, then nothing will happen
  • Discord

    • discord role

      • update roles
      • discord role options
        • options for discord role command
        • me default - updating your (author's) roles
        • member - updates the specified user's roles
          • restricted to leaders and co-leaders
          • user must be specified
        • all - updates ALL guild user's roles
          • restricted to ClashCommander server admin
    • discord nickname

      • update nicknames
      • discord nickname options
        • options for discord nickname command
        • me default - updating your (author's) nickname
        • member - updates the specified user's nickname
          • restricted to leaders and co-leaders
          • user must be specified
        • all - updates ALL guild user's nickname
          • restricted to ClashCommander server admin
    • discord emoji coc_name

      • sends specified emoji
    • discord user

      • returns the user linked to a requested player
      • discord user options
        • options for discord user command
        • player - finding the linked user to the specified player
          • player tag must be specified
        • clan default - finding the linked user for each member in the clan
          • restricted to leaders and co-leaders
          • if no clan role is specified, then the user's active player's clan will be used
  • Announce

    • announce options

      • options for announce commands
      • channel - specify a channel to send the announcement to that channel
        • if no channel is specified, then the announcement will be sent to the current channel
    • announce message channel message

      • announces message to specified channel
      • restricted to leaders and co-leaders
    • announce player channel message player tag

      • announces message to specified channel, pings the requested player's user
      • restricted to leaders and co-leaders
    • announce donate channel message unit name

      • announces message to specified channel, pings all users that can donate the requested
      • announce donate options
        • options for announce donate command
          • clan_role - mention a role linked to a clan to get that clan's information
            • if no clan role is specified, then the user's active player's clan will be used
    • announce supertroop channel message super troop name

      • announces message to specified channel, pings all users that have the requested super troop active
      • announce supertroop options
        • options for announce supertroop command
          • clan_role - mention a role linked to a clan to get that clan's information
            • if no clan role is specified, then the user's active player's clan will be used
    • announce war channel message

      • announces message to specified channel, pings all in current war
      • restricted to leaders and co-leaders
      • announce war options
        • options for announce war command
          • clan_role - mention a role linked to a clan to get that clan's information
            • if no clan role is specified, then the user's active player's clan will be used
          • cwl_war_selection - only for cwl specify whether to look for the previous, current, or upcoming war
            • defaults to current
    • announce warmissingattacks channel message

      • announces message to channel, pings all in war missing attacks
      • restricted to leaders and co-leaders
      • announce warmissingattacks options
        • options for announce warmissingattacks command
          • clan_role - mention a role linked to a clan to get that clan's information
            • if no clan role is specified, then the user's active player's clan will be used
          • missed_attacks - returns players who missed exactly the specified missed attack count
            • if not specified, then it will simply return all who are or have missed attacks
          • cwl_war_selection - only for cwl specify whether to look for the previous, current, or upcoming war
            • defaults to current
  • Player

    • player options

      • options for player commands
      • user - mention a user to get their active player's information
        • if no user is specified, then the user's active player will be used
      • tag - specify a player's tag for that player's information
        • if no tag is specified, then the user's active player will be used
    • player info

      • shows player information based on your active player
    • player recruit

      • displays player recruit information for requested player tag
    • player unit all

      • shows the level your units based on the specified type
    • player unit find unit name

      • shows the level, town hall max, and overall max levels for the requested unit
      • you can search troops, spells, and heroes
      • example
        • /player unit find hog rider
        • /player unit find jump spell
        • /player unit find archer queen
    • player supertroop

      • shows the super troops you have active
  • Clan

    • clan options

      • options for clan commands
      • clan_role - mention a role linked to a clan to get that clan's information
        • if no clan role is specified, then the user's active player's clan will be used
      • tag - specify a clan's tag for that clan's information
        • if no tag is specified, then the user's active player's clan will be used
    • clan info

      • displays clan information
    • clan lineup

      • displays clan town hall lineup
      • clan lineup options
        • options for clan lineup command
        • overview default - returns an overview of the clan's town hall lineup
        • member - returns each member of the clan and their town hall and their hero levels
        • count - returns a count of the clan's town hall lineup
    • clan warpreference

      • displays rundown of clan member's war preference
      • clan warpreference options
        • options for clan warpreference command
        • overview default - returns each member of the clan and their war preference
        • count - returns a count of those that are in and out
    • clan donate unit name

      • search the clan for available donors for a specified unit
      • examples
        • /clan donate hog rider
        • /clan donate freeze spell
    • clan supertroop

      • shows all active super troops in the clan
      • clan supertroop option
        • option for clan supertroop command
        • super_troop - if a super troop is specified, then it will search the clan and show who has the specified super troop active
  • War

    • war options

      • options for war commands
      • clan_role - mention a role linked to a clan to get that clan's war information
        • if no clan role is specified, then the user's active player's clan will be used
      • cwl_war_selection - only for cwl specify whether to look for the previous, current, or upcoming war
        • defaults to current
    • war info

      • displays war information
    • war missingattacks

      • lists players that missed attacks in war
      • war missingattacks option
        • option for war missingattacks command
        • missed_attacks - returns players who missed exactly the specified missed attack count
          • if not specified, then it will simply return all who are or have missed attacks
    • war open

      • show opponent bases that are open
      • war open option
        • star_count - star count selection for open bases
          • if not specified, then it show all open bases that haven't been 3 starred
    • war stars

      • show all war members and their stars
      • war stars options
        • options for war stars command
        • stars default - returns all war members and their stars
        • member - show all war members and their attacks
    • war score user

      • user's active player's war score
      • war score user option
        • option for war score user command
        • user - returns the mentioned user's active player's war score
          • if not specified, then it will return the author's active player's war score
    • war score clan

      • every clan member's war score
      • restricted to leaders and co-leaders
    • war lineup

      • war town hall lineup
      • war lineup options
        • options for war lineup command
        • overview - short overview of the war's lineup
        • clan default - war lineup for each clan
        • member - lineup for every member in war
  • CWL

    • cwl options

      • options for cwl commands
      • clan_role - mention a role linked to a clan to get that clan's cwl information
        • if no clan role is specified, then the user's active player's clan will be used
    • cwl info

      • CWL info
    • cwl lineup

      • CWL town hall lineup
      • cwl lineup options
        • options for cwl lineup command
        • overview - short overview of the cwl's lineup
        • clan default - cwl lineup for each clan
        • member - lineup for every member in each clan in cwl
    • cwl scoreboard

      • CWL scoreboard
      • cwl scoreboard options
        • options for cwl scoreboard command
        • group default - cwl scoreboard for the group
        • rounds - cwl scoreboard for each round
        • clan - cwl scoreboard for each clan member
    • cwl missingattacks

      • lists players that missed attacks in cwl
    • cwl score user

      • user's active player's cwl score
      • cwl score user option
        • option for cwl score user command
        • user - returns the mentioned user's active player's cwl score
          • if not specified, then it will return the author's active player's cwl score
    • cwl score clan

      • every clan member's cwl score
      • restricted to leaders and co-leaders

Contributing

If you would like to contribute to this project please message me on discord or email me. I currently do not have any contribution instruction and will figure that out when the time comes if someone would like to.

Requirements

There aren't many required packages, but here are the few that are required and the versions I am using.

Links and Contact

Official ClashCommander Server

Email: [email protected]

About

Discord bot for Clash of Clans discord servers written in Python

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages