Skip to content

swordfishtr/RankingBot

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ranking Bot: An ELO tracking Discord bot for Pokemon Showdown replays

Set up

  • Clone this git repository to your local machine
  • Create a .env file with the following variables:
    • DISCORD_TOKEN: Generated bot token
    • DISCORD_GUILD: Name of Discord server
    • MATCH_PREFIX: Replay prefix used to match valid replays (e.g. https://replay.pokemonshowdown.com)
    • MATCH_CHANNEL: Channel where replays are posted
  • Run the main file: python Main.py
    • If this is successful, the console should say {Bot name} is connected to the following guild: {Discord server name}(id: {Discord server id})
    • Bot will start to initialize by reading all message history in that channel and scanning for replays
      • This will take a long time depending on how active the server is; Assume 5-15 minutes at least
      • This is a one time action. Once the messages have been scanned, all replays will be stored in DB
      • Even if bot is taken offline, data will persist and account for all missing replays when started again

Bot commands

  • +ranking
    • Parameters:
      • rank_type: Takes values of month or all, defaults to month
      • unranked: Takes values of unranked or ranked, defaults to unranked
      • limit: Takes any integer value, defaults to 20
      • format: Takes a string value, defaults to gen9nationaldexag
    • Return:
      • List of elo and ranking for all users
        • If month, shows only elo/rank based on current month. If all, shows all time elo/rank
        • If unranked, includes unranked users in ranking. If ranked, only shows ranked users
  • +past_ranking
    • Parameters:
      • month: Takes any two digit integer, defaults to 01
      • year: Takes any four digit integer, defaults to 1970
      • unranked: Takes values of unranked or ranked, defaults to unranked
      • limit: Takes any integer value, defaults to 20
      • format: Takes a string value, defaults to gen9nationaldexag
    • Return:
      • List of elo and ranking for all users from a previous month/year
        • If unranked, includes unranked users in ranking. If ranked, only shows ranked users
  • +show_rank
    • Parameters:
      • username: Takes any showdown username
      • rank_type: Takes values of month or all, defaults to month
      • format: Takes a string value, defaults to gen9nationaldexag
    • Return:
      • Elo of user
        • If all, shows all time elo. If month, shows current month elo
  • +pokemon_usage
    • Parameters:
      • username: Takes any showdown username or all, defaults to all
      • usage_type: Takes values of most, win, or lose, defaults to most
      • rank_type: Takes values of month or all, defaults to month
      • limit: Takes any integer value, defaults to 20
      • format: Takes a string value, defaults to gen9nationaldexag
    • Return:
      • Most common pokemon used
        • If all, shows most common pokemon across all users. If specific username, shows most common pokemon for that user
        • If most, shows most common pokemon in all matches. If win, shows most common pokemon in winning matches. If lose, shows most common pokemon in losing matches.
        • If all, shows most common pokemon of all time. If month, shows most common pokemon of current month
  • +pokemon_usage_one
    • Parameters:
      • pokemon: Takes any pokemon name, no default
      • usage_type: Takes values of most, win, or lose, defaults to most
      • rank_type: Takes values of month or all, defaults to month
      • format: Takes a string value, defaults to gen9nationaldexag
    • Return:
      • Pokemon usage for one pokemon
        • If most, shows pokemon usage in all matches. If win, shows pokemon usage in winning matches. If lose, shows pokemon usage in losing matches.
        • If all, shows pokemon usage of all time. If month, shows pokemon usage of current month
  • +past_pokemon_usage
    • Parameters:
      • username: Takes any showdown username or all, defaults to all
      • usage_type: Takes values of most, win, or lose, defaults to most
      • month: Takes any two digit integer, defaults to 01
      • year: Takes any four digit integer, defaults to 1970
      • limit: Takes any integer value, defaults to 20
      • format: Takes a string value, defaults to gen9nationaldexag
    • Return:
      • Most common pokemon used from past meta
        • If all, shows most common pokemon across all users. If specific username, shows most common pokemon for that user
        • If most, shows most common pokemon in all matches. If win, shows most common pokemon in winning matches. If lose, shows most common pokemon in losing matches.
  • +rival
    • Parameters:
      • username: Takes any showdown username
      • rival_type: Takes values of most, win, or lose, defaults to most
      • rank_type: Takes values of month or all, defaults to month
    • Return:
      • Most common user played against
        • If most, shows most common rival in all matches. If win, shows most common rival in winning matches. If lose, shows most common rival in losing matches.
        • If all, shows most common pokemon of all time. If month, shows most common pokemon of current month

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%