浏览代码

fixed error with a try catch

tags/v2.2.2
Roxie Gibson 5 年前
父节点
当前提交
6ffe4db607
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. +2
    -2
      roxbot/cogs/customcommands.py

+ 2
- 2
roxbot/cogs/customcommands.py 查看文件

@@ -128,15 +128,15 @@ class CustomCommands(commands.Cog):
with db_session:
if msg.startswith(self.bot.command_prefix):
command_name = msg.split(self.bot.command_prefix)[1]
command = CCCommands.get(name=command_name, guild_id=message.guild.id)
try:
command = CCCommands.get(name=command_name, guild_id=message.guild.id)
if command.type == 1:
output = self._get_output(command.output)
return await channel.send(output)
elif command.type == 2:
embed = self._cc_to_embed(command.output)
return await channel.send(embed=embed)
except AttributeError:
except (ValueError, AttributeError):
pass
else:
try:

正在加载...
取消
保存