make ?xkcd only accept ints as arg (#379)

fixes #376

* Update CHANGELOG.md

Co-authored-by: 0x5c <dev@0x5c.io>
This commit is contained in:
classabbyamp 2021-03-26 08:04:54 -04:00 committed by GitHub
parent bb3ee319b6
commit 1cb7ef5861
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View File

@ -8,6 +8,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
### Added
- `?tex` command to render a LaTeX expression.
- Configuration option to use another rTeX instance for `?tex`.
### Fixed
- Lack of input sanitisation in `?xkcd`.
## [2.6.0] - 2021-03-18

View File

@ -27,9 +27,9 @@ class FunCog(commands.Cog):
self.words = words_file.read().lower().splitlines()
@commands.command(name="xkcd", aliases=["x"], category=cmn.cat.fun)
async def _xkcd(self, ctx: commands.Context, number: str):
async def _xkcd(self, ctx: commands.Context, number: int):
"""Looks up an xkcd comic by number."""
await ctx.send("http://xkcd.com/" + number)
await ctx.send("http://xkcd.com/" + str(number))
@commands.command(name="tar", category=cmn.cat.fun)
async def _tar(self, ctx: commands.Context):