-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdevstuff.py
33 lines (28 loc) · 982 Bytes
/
devstuff.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
from pprint import pformat
from io import BytesIO
import core
import settings
PLUGINVERSION = 2
# Always name this variable as `plugin`
# If you dont, module loader will fail to load the plugin!
plugin = core.Plugin()
@plugin.command(command="//msgdump",
hidden=True)
def dump(bot, update, user, args):
text = pformat(update.message.to_dict())
text_obj = BytesIO()
text_obj.name = "%s.txt" % update.update_id
text_obj.write(bytes(text, "utf-8"))
text_obj.seek(0)
return core.message(file=text_obj)
@plugin.command(command="//delmsg",
inline_supported=False,
hidden=True)
def msgdel(bot, update, user, args):
if user.id == settings.ADMIN:
update.message.reply_to_message.delete()
@plugin.command(command="//exec",
hidden=True)
def docode(bot, update, user, args):
if user.id == settings.ADMIN:
return core.message(eval(" ".join(update.message.text.split(" ")[1:])))