make ?xkcd only accept ints as arg

fixes #376
This commit is contained in:
Abigail G 2021-03-24 21:43:51 -04:00
parent 89e26dbd2b
commit 24d1528d5a
No known key found for this signature in database
GPG Key ID: 6BE0755918A4C7F5
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
- lacked of input sanitization 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):