forked from AmiyaBot/Amiya-Bot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathquickStart.py
executable file
·42 lines (34 loc) · 989 Bytes
/
quickStart.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
37
38
39
40
41
42
from message.messageHandler import MessageHandler
from modules.config import get_config
message = MessageHandler()
def on_message(text, sender_id, group_id):
message.on_message({
'type': 'GroupMessage',
'messageChain': [
{
'type': 'Plain',
'text': text
}
],
'sender': {
'id': sender_id,
'permission': 'OWNER',
'nickname': 'OWNER',
'memberName': 'OWNER',
'remark': 'none',
'group': {
'id': group_id
}
}
})
if __name__ == '__main__':
print('Testing started.')
print('Enter a message and press enter to interact.')
config = get_config()
try:
while True:
message_text = input()
if message_text:
on_message(message_text, config['admin_id'], config['close_beta']['group_id'])
except KeyboardInterrupt:
pass