1
0
Fork 0
mirror of synced 2024-06-28 03:00:55 +12:00

Made sure that we're in a server when checking for permissions

This commit is contained in:
Phxntxm 2017-01-28 14:15:08 -06:00
parent 2baf153ae3
commit 2048865b26

View file

@ -172,13 +172,13 @@ class Core:
cmd = None
page = 1
perms = ctx.message.server.me.permissions_in(ctx.message.channel)
if not (perms.embed_links and perms.add_reactions):
fmt = "I need the permissions `embed_links` and `add_reactions` to send my help message! " \
" Otherwise you can use this link to view available commands {}".format(
"http://bonfirebot.readthedocs.io/en/latest/")
await self.bot.say(fmt)
if ctx.message.server:
perms = ctx.message.server.me.permissions_in(ctx.message.channel)
if not (perms.embed_links and perms.add_reactions):
fmt = "I need the permissions `embed_links` and `add_reactions` to send my help message! " \
" Otherwise you can use this link to view available commands {}".format(
"http://bonfirebot.readthedocs.io/en/latest/")
await self.bot.say(fmt)
if message is not None:
# If something is provided, it can either be the page number or a command