GrafeasGroup / buttercup

Our personal assistant in Discord
MIT License
5 stars 2 forks source link

Escape usernames in leaderboard #187

Open TimJentzsch opened 2 years ago

TimJentzsch commented 2 years ago

The usernames in the response for the /leaderboard command are currently not escaped, that means that formatting characters in the usernames (e.g. / or *) mess up the formatting.

The fix should be very easy:

Edit this line to be username = escape_formatting(user["username"]): https://github.com/GrafeasGroup/buttercup/blob/e2d69b286d5ad7f009aa6a428104e8def1df26a9/buttercup/cogs/leaderboard.py#L32

And don't forget to import the corresponding function from the helper file: https://github.com/GrafeasGroup/buttercup/blob/e2d69b286d5ad7f009aa6a428104e8def1df26a9/buttercup/cogs/helpers.py#L134-L136