浏览代码

try catch key

tBKwtWS 7 年之前
父节点
当前提交
f16040f842
共有 1 个文件被更改,包括 3 次插入1 次删除
  1. 3 1
      irc/bot.py

+ 3 - 1
irc/bot.py

@@ -156,8 +156,10 @@ class PyRot(irc.bot.SingleServerIRCBot):
                 connection.join(event.arguments[0].split(' ')[3], event.arguments[0].split(' ')[5][:-1])
         except:
             pass
-        if event.source.nick:
+        try:
             Inform.owners(self, connection, "PM from " + red + red + event.source.nick + grey + ": " + reset + event.arguments[0] + ".")
+        except:
+            pass
     
     def on_action(self, connection, event):
         events.on_action.process_event(self, connection, event)