Advertisement
Aha2Y

Untitled

Feb 5th, 2012
3,140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PyCon 0.36 KB | None | 0 0
  1. #The way a bot will not disconnect/crash on a crash.
  2. # By Aha2Y <3
  3. ##
  4. import traceback
  5. try:
  6. <bot shit crap here>
  7. except:
  8.       fp = StringIO.StringIO()
  9.       traceback.print_exc(file=fp)
  10.       message = fp.getvalue()
  11.       # Send Error to the IRC channel. (Of underscorex3 :P)
  12.       irc.send('privmsg underscorex3 :error occured. %s\r\n' % (repr(message))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement