Guest User

Untitled

a guest
Apr 19th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.48 KB | None | 0 0
  1. elif botlib.check_found(self.data, "!python"):
  2.         command = self.data.rstrip("\r\n").partition("!python ")[2]
  3.         if command != "":
  4.                 if botlib.disable == True:
  5.                         self.protocol.privmsg(self.channel, "12[PYTHON]4 ERROR: Python math shell has been disabled.")
  6.                 elif "import" in command:
  7.                         self.protocol.privmsg(self.channel, "12[PYTHON]4 ERROR: For security reasons, use of 'import' is not permitted.")
  8.                 elif "help" in command:
  9.                         self.protocol.privmsg(self.channel, "12[PYTHON]4 ERROR: Use of 'help' is not permitted because it freezes up the bot.")
  10.                 elif "self.protocol" in command:
  11.                         self.protocol.privmsg(self.channel, "12[PYTHON]4 ERROR: Use of any IRC protocol functions is not permitted.")
  12.                 elif "sys." in command:
  13.                         self.protocol.privmsg(self.channel, "12[PYTHON]4 ERROR: For security reasons, use of any system commands is not permitted.")
  14.                 else:
  15.                         try:
  16.                                 self.protocol.privmsg(self.channel, "12[PYTHON]7 " + command + " == " + str(eval(command)))
  17.                         except:
  18.                                 self.protocol.privmsg(self.channel, "12[PYTHON]4 ERROR: Cannot evaluate " + command)
  19.          else:
  20.                 self.protocol.privmsg(self.channel, "12[PYTHON]4 ERROR: Cannot evaluate an empty string.")
Add Comment
Please, Sign In to add comment