-
Notifications
You must be signed in to change notification settings - Fork 23
Improve /match usability #29
Comments
The first point is a good idea. About the second point, some research should be done in order to check what kind of support python has for that. Unfortunately, it's not as simple as using tabs. It could be done manually, by having a fixed max width and forcing that but I'd rather avoid it. Open to suggestions |
Taking a look at this one at the moment, and it looks like the formatting may not be possible. The Bot seems to override the amount of whitespace when messaging a user, regardless of what text you send it. I started by finding the length of the longest 'localized_name' of all heroes in the list returned by the dota API (only when main.py is run, not every time this info is needed), and then creating a string using The string.ljust() method to create a 'padded' string with length of the longest heroes name (currently KOTL), plus a tab character. The KDA info would be appended to the end of this string for every hero, and would be consistently spaced. That is... until we pass the formatted string to the bot (via either bot.send_message or bot.reply_to). Using print statements right up until the bot is called to action showed correct formatting in the terminal, including the full "Winner / Radiant / Dire " string. Once the Bot took the string though, the spacing was suddenly inconsistent on the other end (as a user talking to the bot). Tried with different parse methods too (HTML instead of Markdown), but still no dice. I've thrown in a PR for the first part anyway (/match with no ID handling). PR #59 |
Thanks for resolving the first part. I remember the bot ignoring whitespace in messages and I think I'm fine with using underscores or whatever looks fine. However there are at least 2 more things to consider with this issue:
|
/match
, without any match ID, the bot doesn't respond at all.It should do one of these things instead:
1.a) Notify the user that he has to use the following format:
/match ID
, or1.b) Ask the user for a match ID and process it directly.
Screenshot of the current output:
The text was updated successfully, but these errors were encountered: