Merge branch 'patch-6' of https://github.com/blha303/CloudBot into blha303-patch-6

This commit is contained in:
Luke Rogers 2013-09-10 15:26:51 +12:00
commit 79f06b034e

12
plugins/plpaste.py Normal file
View file

@ -0,0 +1,12 @@
from util import hook, web
@hook.command(adminonly=True)
def plpaste(inp):
if "/" in inp and inp.split("/")[0] != "util":
return "Invalid input"
try:
with open("plugins/%s.py" % inp) as f:
return web.haste(f.read(), ext='py')
except IOError:
return "Plugin not found (must be in plugins folder)"