Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- elif botlib.check_found(self.data, "!python"):
- command = self.data.rstrip("\r\n").partition("!python ")[2]
- if command != "":
- if botlib.disable == True:
- self.protocol.privmsg(self.channel, "12[PYTHON]4 ERROR: Python math shell has been disabled.")
- elif "import" in command:
- self.protocol.privmsg(self.channel, "12[PYTHON]4 ERROR: For security reasons, use of 'import' is not permitted.")
- elif "help" in command:
- self.protocol.privmsg(self.channel, "12[PYTHON]4 ERROR: Use of 'help' is not permitted because it freezes up the bot.")
- elif "self.protocol" in command:
- self.protocol.privmsg(self.channel, "12[PYTHON]4 ERROR: Use of any IRC protocol functions is not permitted.")
- elif "sys." in command:
- self.protocol.privmsg(self.channel, "12[PYTHON]4 ERROR: For security reasons, use of any system commands is not permitted.")
- else:
- try:
- self.protocol.privmsg(self.channel, "12[PYTHON]7 " + command + " == " + str(eval(command)))
- except:
- self.protocol.privmsg(self.channel, "12[PYTHON]4 ERROR: Cannot evaluate " + command)
- else:
- self.protocol.privmsg(self.channel, "12[PYTHON]4 ERROR: Cannot evaluate an empty string.")
Add Comment
Please, Sign In to add comment