Malarne / discord_cogs

GNU General Public License v3.0
26 stars 25 forks source link

[Heist] wait_for : TimeoutError #51

Closed Obliviatum closed 4 years ago

Obliviatum commented 4 years ago

This:

response = await self.bot.wait_for('MESSAGE', timeout=15, check=lambda x: x.author == author)

if response is None:
    await ctx.send("You took too long. canceling transaction.")
    return

Should be written like this:

try:
    response = await self.bot.wait_for("message", timeout=15, check=lambda x: x.author == author)
except asyncio.TimeoutError:
    await ctx.send("You took too long. canceling transaction.")
    return