-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathtest.py
36 lines (31 loc) · 885 Bytes
/
test.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
34
35
36
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('>')