Handling testing exception in the cog for now
This commit is contained in:
parent
edaa480aef
commit
ce1077bcd9
3
bot.py
3
bot.py
|
@ -3,7 +3,6 @@
|
|||
import discord
|
||||
from discord.ext import commands
|
||||
from cogs.utils import config
|
||||
import traceback
|
||||
|
||||
extensions = ['cogs.interaction',
|
||||
'cogs.core',
|
||||
|
@ -64,8 +63,6 @@ async def on_command_error(error, ctx):
|
|||
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,str(traceback.format_exc()))
|
||||
traceback.print_exc(file=open("/home/phxntx5/public_html/Bonfire/bot_error","a"))
|
||||
await bot.send_message(ctx.message.channel, fmt.format(type(error).__name__, error))
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
|
|
@ -92,6 +92,7 @@ class Mod:
|
|||
@perms.command(name="add", aliases=["setup,create"], pass_context=True)
|
||||
@commands.has_permissions(manage_server=True)
|
||||
async def add_perms(self, ctx, command: str, permissions: str):
|
||||
try:
|
||||
for checks in self.bot.commands.get(command).checks:
|
||||
if "isOwner" == checks.__name__:
|
||||
await self.bot.say("This command cannot have custom permissions setup!")
|
||||
|
@ -119,7 +120,8 @@ class Mod:
|
|||
cursor.execute("update %s set perms=%s where command=%s",(ctx.message.server.id,perms,command))
|
||||
|
||||
config.closeConnection()
|
||||
|
||||
except:
|
||||
traceback.print_exc(file=open("/home/phxntx5/public_html/Bonfire/bot_error","a"))
|
||||
|
||||
|
||||
def setup(bot):
|
||||
|
|
Loading…
Reference in a new issue