Added error handling for bad arguments
This commit is contained in:
parent
cb0154c077
commit
656990686b
3
bot.py
3
bot.py
|
@ -54,6 +54,9 @@ async def on_command_error(error, ctx):
|
|||
if isinstance(error, commands.CommandNotFound):
|
||||
fmt = "That is not a valid command! If you need asistance on what command to use, please enter '!help'"
|
||||
await bot.send_message(ctx.message.channel, fmt)
|
||||
elif isinstance(error, commands.BadArgument):
|
||||
fmt = "Please provide a valid argument to pass to the command: {}:".format(error)
|
||||
await bot.send_message(ctx.message.channel, fmt)
|
||||
else:
|
||||
fmt = 'An error occurred while processing this request: ```py\n{}: {}\n```'
|
||||
await bot.send_message(ctx.message.channel, fmt.format(type(error).__name__, error))
|
||||
|
|
|
@ -36,7 +36,7 @@ async def checkChannels(bot):
|
|||
await bot.send_message(server, "{} has just gone offline! Catch them next time they stream at {}"
|
||||
.format(member.name, url))
|
||||
config.closeConnection()
|
||||
await asyncio.sleep(180)
|
||||
await asyncio.sleep(60)
|
||||
|
||||
|
||||
class Twitch:
|
||||
|
@ -117,7 +117,7 @@ class Twitch:
|
|||
ctx.message.author.mention))
|
||||
config.closeConnection()
|
||||
|
||||
@commands.group(pass_context=True, no_pm=True, invoke_without_command=True)
|
||||
@twitch.group(pass_context=True, no_pm=True, invoke_without_command=True)
|
||||
async def notify(self, ctx):
|
||||
"""This can be used to turn notifications on or off"""
|
||||
pass
|
||||
|
|
Loading…
Reference in a new issue