XZZ/test.py
2021-01-27 11:33:32 +08:00

36 lines
885 B
Python
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

from worker import emmm
debug = True
def de(e):
if debug:
print('DEBUG '+str(e))
print("开始测试咯,在 '>' 后面输入n你的消息不用加 '/'")
inp = input('>')
while(inp):
parms = str.split(inp)
worker = parms[0]
try:
package = __import__(name='worker.' + worker, fromlist=worker)
Ans_ = getattr(package, 'Ans')
except Exception as e:
de(e)
Ans_ = emmm.Ans
de(Ans_)
try:
Ans = Ans_(parms, uid=0, gid=0, role='owner', mid=1001, raw_msg={'message': [
{
"data": {
"text": f"/{inp}"
},
"type": "text"
}
], 'message_id': '1001', 'raw_message': f"/{inp}"})
Message = Ans.GETMSG()
except Exception as e:
Message = ' Error:\n'+str(e)
print(Message)
inp = input('>')