Skip to content

Instantly share code, notes, and snippets.

@ivanpepelko
Last active April 7, 2016 10:48
Show Gist options
  • Save ivanpepelko/7b365f2359c96dc33fe6567dcbc83ca9 to your computer and use it in GitHub Desktop.
Save ivanpepelko/7b365f2359c96dc33fe6567dcbc83ca9 to your computer and use it in GitHub Desktop.
PotatoBot detailed description

PotatoBot

###Default help message

Bot automatically responds with match stats to text messages containing Dotabuff or YASP link.

<> - required parameters
[] - optional parameters

Commands:
!potato match <match_id>        Returns match stats for match with <match_id> id.

!potato channel <add|rem>       Adds or removes current channel.
        
!potato player <steamId32>      Get player summary.

!potato help                    This help text.

More about me: https://git.io/vV48a.
If I cause any trouble or misbehave, contact my Master Potatoman666.

Automatic functions

If Dotabuff or Yasp link is found in text message (https?:\/\/(www.)?(dotabuff|yasp).com?\/matches/\d+\/?), match command is automatically run.

match command

I don't think this needs an explanation.

channel command

Since private messages work the same way channels work, this allows you to use bot in private messages (also, text channels in EU Discord other than #masterrace).

player command

This command uses the crawler (type of program Google uses to read the contents of web pages) to get data from http://www.dotabuff.com/players/<id>/heroes. Currently only 'Most significant heroes' is returned, but some other informations are going to be added in the future. 'Most significant heroes' are top 25% + 1 (when 25% is reached, 1 more hero is added - that is the percentage in the brackets after 'Data for x matches') picked by player. Only heroes played last 3 months are considered.

Hero stats on Dotabuff are only from pub games. There are 3 possible ways of getting the data for all matches:

  1. Getting it from Dotabuff - requires extensive use of crawler, web servers don't really like crawlers in private parts (DB robots.txt).

  2. Storing the data on my computer and redoing all the stuff Dotabuff already does (I migth be crazy, but not that much).

  3. Slowing down the crawler so I don't get blocked by DB firewall - depending on number of games, this could take long.

  4. There probably is 4, but I didn't figure it out yet.

Future updates

  • register command which will allow you to bind your Discord account id to Steam id. This also includes extending player command to accept @mention instead of typing id manually.
  • since I'm currently working on a signature generator, I think it would be a nice feature to add to the bot. Soon™
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment