-
Notifications
You must be signed in to change notification settings - Fork 2
/
QQBot-Pubilc.py
2430 lines (2422 loc) · 208 KB
/
QQBot-Pubilc.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# -*- coding: UTF-8 -*-import receive
import base64
import WebFurApi
import WebMediaApi
import BCMCreator
import SMM2API
import socket
import json
import requests
import random
import urllib
import time
#出于纪念就不覆盖了awa
import os
import filetype
import demjson
import ffmpeg
import hashlib
from ast import Continue
from cmath import exp
from keyword import kwlist
savelist=['DebugGroupID','QQID','DebugQQID','adminQQ','superadmin','weatherKEY','onemingKey','BcmcreatorOA','furauthKey','furauthqq','ZlibUserEmail','ZlibPassword','privateblacklist','groupblacklist','bcxVIPid','bcxjson','bcxVIPCode',"ChatLastTime","ChatLastID",'ChatMessageAllow','ChatUserIDJson'] #需要存读的变量
def crashlogsave(text):
if os.path.exists(os.getcwd()+r'/botcrashlog.txt')==True:
print('日志文件存在,开始保存错误')
crashlogfile = open(os.getcwd()+r'/botcrashlog.txt', mode='r+')
elif os.path.exists(os.getcwd()+r'/botcrashlog.txt')==False:
print('日志文件不存在,开始自动创建')
crashlogfile = open(os.getcwd()+r'/botcrashlog.txt', mode='w+')
else:
print('日志文件存取失败:出现异常错误')
exit()
if str(crashlogfile.read()) == '':
crashlogfile.write(crashlogfile.read()+"("+str(time.asctime( time.localtime(time.time()) ))+")"+str(text)+"\n")
else:
crashlogfile.write(crashlogfile.read()+"("+str(time.asctime( time.localtime(time.time()) ))+")"+str(text)+"\n")
crashlogfile.close()
print("日志保存完毕")
def save_save(): #保存存档
try: #尝试执行代码
savefile = open(os.getcwd()+r'/botsave.txt', mode='w+') #打开文件
#print(savefile)
globallist = globals() #读取全局变量
#print(globallist)
savedict ={} #预设需要保存的变量字典
#print(savedict)
for val in savelist: #从需要要保存的变量的列表中读取出变量名到val变量直到读取完毕
#print(val)
savetempdict={val:globallist[val]} #设置缓存列表为(变量名:变量的内容)
#print(savetempdict)
savedict.update(savetempdict) #添加缓存列表数据到变量字典
#print(savedict)
savefile.write(demjson.encode(savedict)) #将字典转换成json之后写入文件
#print(json.dumps(savedict))
savefile.close() #关闭文件
print('存档完毕')
except BaseException as error: #抓取try代码中所有错误的类型和原因给error并执行代码
print('发生错误QAQ:'+str(error))
send_msg({'msg_type':str(messagetype),'number':int(superadmin),'msg':'代码执行时发送了错误QAQ:'+str(error)}) #发送消息模块
crashlogsave("保存存档:"+str(error)) #保存日志文件
def save_read(): #读取存档
try: #尝试执行代码
savefile = open(os.getcwd()+r'/botsave.txt', mode='r+') #读取文件
savereaddata = demjson.decode(savefile.read()) #读取文件中的json并转换成字典
#print(savereaddata)
for val in savereaddata: #从字典中找出变量并赋值给val直至查找完毕
#print(val)
#print(evalcommand)
#print('global '+val+';'+val+'='+str(savereaddata[val]))
#print(str(type(savereaddata[val])))
if str(type(savereaddata[val])) == "<class 'str'>": #判断要存档的变量是不是字符串类型,如果是就在代码中加引号。反之不加
exec('global '+val+' ; '+val+"='"+str(savereaddata[val])+"'") #以全局模式调用代码(是字符串类型,而不是在函数里调用代码)
else:
exec('global '+val+' ; '+val+"="+str(savereaddata[val])) #以全局模式调用代码(非字符串类型,而不是在函数里调用代码)
savefile.close() #关闭文件
#print( locals())
print('读档完毕')
except IOError: #捕获输入/出错误和原因给error并执行代码
print('没有存档文件QWQ')
crashlogsave("读取存档:没有存档文件QWQ") #保存日志文件
send_msg({'msg_type':str(messagetype),'number':int(superadmin),'msg':'代码执行时发送了错误QAQ:没有存档文件'}) #发送消息模块
except BaseException as error: #捕获所有错误和原因给error并执行代码
print('发生错误QAQ:'+str(error))
crashlogsave("读取存档:"+str(error)) #保存日志文件
send_msg({'msg_type':str(messagetype),'number':int(superadmin),'msg':'代码执行时发送了错误QAQ:'+str(error)}) #发送消息模块
#下面是一些配置。
Debug = 0
DebugGroupID = 0
DebugQQID = 0
QQID="" #机器人的QQ号
adminQQ = [''] #管理员QQ列表
superadmin = '' #超级管理员(机主)
TuYaApiID = "" #涂鸦找找ID
TuYaApiKey = "" #涂鸦找找Key
weatherKEY = '' #和风天气WebAPI的KEY
#onemingKey = '' #一铭API(https://api.wer.plus/)密钥
BcmcreatorOA = '' #编创协OA密钥
furauthKey = '' #绒狸开源机器人KEY,若没有请联系官方获取(密钥仅V2需使用,V1不受影响)
furauthqq = '' #绒狸开源机器人QQ,若没有请联系官方获取(密钥仅V2需使用,V1不受影响)
ZlibUserEmail = '' #服务器出现问题(或者说被墙了),暂时停止维护
ZlibPassword = '' #服务器出现问题(或者说被墙了),暂时停止维护
cqhttpserverip = '127.0.0.1' #CQ-Http服务器地址(Go-Cqhttp)
cqhttpserveriphost = 5700 #CQ-Http服务器地址端口(Go-Cqhttp)
cqhttpposthost = 1234 #CQ-Http服务器反向Post端口
cqhttpaccesstoken = '' #连接CQ-Http服务器用的access_token,没有则留空
proxyserverip = "127.0.0.1" #HTTP代理服务器的IP地址
proxyserverhost = 33210 #HTTP代理服务器的端口号
MintBotVersion = 'MintBot V20230104' #机器人版本号
BotName = '薄荷本兽' #机器人名字
ZlibraryURL = 'zh.cn1lib.vip' #服务器可以链接到Zlibrary的地址(无须加 http:// 或 https:// )(检查可用链接请访问:https://zh.1lib.domains/?redirectUrl=/ 或 https://a.fuyeor.com/to-zlibrary) #服务器出现问题(或者说被墙了),暂时停止维护
menulist = ['---通知类---',BotName+',赞助名单 ---返回从头以来的所有捐助记录','---搜图类---',BotName+',涂鸦找找(名字) ---在涂鸦宇宙中查找小伙伴并随机返回小伙伴的图片',BotName+',绒狸找找(名字) ---在绒狸API中查找兽兽并随机返回毛图',BotName+',绒狸来只毛 ---随机在绒狸API获取一张毛图片',BotName+',云绒来只毛 ---随机在兽云祭API获取一张毛图片',BotName+',云绒找找---在兽云祭API中查找兽兽并随机返回毛图',BotName+',丢(/赞/爬/摸摸)(QQ号) ---(维护中,API商跑路了XwX。后续打算手动移植)发送自定义表情','---日常类---',BotName+',今日早报 ---查看今日的60秒早报',BotName+',(城市)天气 ---在和风天气查找对应城市的实时天气',BotName+',(音乐平台)搜歌(歌名) ---在音乐搜索器API搜索歌曲(若不知道支持平台可以把平台名字留空后发送查看)',BotName+',摸鱼日历 ---[维护中(不稳),等待多线程功能中)]调用韩小韩API获取今日摸鱼日历','---安全类---',BotName+',沙盒分析 ---[开发中]调用微步在线API进行文件分析','---娱乐类---',BotName+',网络天才 ---[开发和爬虫中]让你不用下载软件和梯子就可以玩?(但是真做的话麻烦qwq)',BotName+',马造找找(ID) ---通过外网API查找马里奥制造2的关卡或者作者的信息','---注意事项---','1.功能备注加方框的为暂时无法使用的功能,通常都在维护或者开发中(也有可能遇到了bug)','2.本机器人大部分功能都取自于互联网的API,信息不一定准确。仅供参考','3.禁止使用机器人进行刷屏、骚扰等进行一些违法违纪的事情,本机器人有权限制您的功能但不限于拉入黑名单','4.本机器人拥有一些专属功能,一般不外透','5.本机器人因开发需要,拥有公开的控制机器人发言API。如果有因为机器人被控制而发言出异常的行为,均可对机器人做出禁言或踢出的行为'] #机器人目前支持的功能
pokelist = [' 嗷呜OwO',' 呜呜不要再戳了QwQ',' 哇啊好痛QAQ',' awa',' 喵呜OwO',' ~~'," 好痛QAQ"] #机器人被戳一戳后会随机发送的消息
songlist = ['网易云','QQ音乐','(维护中)酷狗','酷我','千千','一听','咪咕','荔枝','蜻蜓','喜马拉雅','5sing原创','5sing翻唱','全民K歌'] #目前音乐搜索器支持的音乐平台
zanzhutime = "" #被赞助时间
zanzhurenlist = [""] #赞助人列表
bcxmenulist = ['......绑定菜单......','#登录 [code] (仅限官群)','#退出登录 (仅限官群)','......数据查询......','#同步编程猫昵称','#个人数据','#查询数据 [@SomeBody]','#日志 [@SomeBody或编程猫ID]','#委员日志 [@SomeBody或编程猫ID]','#全局日志(仅限管理)','#本周排名(仅限管理)','#查询Null精神状态',"#开启聊天室收发信","#关闭聊天室收发信","#展示最新文章",'......温馨提示......','1.绑定Code获取:'+r'https://bcmcreator.cn/index.php?mod=OAuth','2.全局日志和本周排名只有管理和群主才能使用,因为有刷屏的风险','3.账号一旦绑定了机器人后,本机器人有权保存由编创协API返回您的账号的资料以便后续进行您需要的操作,想要删除资料只需退出登陆即可。但是!!在退群后仍然会保存在数据库中,如有异议可以联系耀西或冷鱼进行协调','4.除特殊声明外,您可以把机器人拉进您拥有管理或者群主权限的群(记得跟耀西说一声,不说也行awa)以使用管理员专属功能(但是禁止对机器人进行占用或刷屏)','5.一般情况下,使用本机器人功能如果遇到刷屏等其他异常现象,只要非故意行为且没有触犯群规均可饶恕','6.因为本机器人有对外公开的发送消息API,所以。。。如果咱说了什么奇怪的话。。。尽量原谅咱QwQ','7.#号请用半角(英文符号)的,不要用全角(中文符号)XwX','8.<本菜单下所有功能的最终解释权由编创协所属>']
privateblacklist = [0] #私聊黑名单
groupblacklist = [0] #群聊黑名单
bcxjson = {}
bcxVIPid = {}
bcxVIPCode = []
ChatLastTime = ""
ChatLastID = ""
ChatLastIDList = []
ChatMessageAllow = 1
ChatUserIDJson = {}
#上面是一些配置
if os.path.exists(os.getcwd()+r'/botsave.txt')==True:
print('检测到存档文件,开始读档')
save_read()
elif os.path.exists(os.getcwd()+r'/botsave.txt')==False:
print('存档不存在,开始自动创建')
save_save()
else:
print('读取失败:出现错误')
crashlogsave("读取存档失败:出现错误?("+os.path.exists(os.getcwd()+r'/botsave.txt')+")")
exit()
ListenSocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
ListenSocket.bind((str(cqhttpserverip), int(cqhttpposthost)))
ListenSocket.listen(100)
HttpResponseHeader = '''HTTP/1.1 200 OK
Host: 127.0.0.1
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.61 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9
Accept-Encoding: gzip, deflate
Accept-Language: en-US,en;q=0.9
Connection: close
'''
str(QQID)
print('机器人QQ号:'+str(QQID))
print('超级管理员QQ:'+str(superadmin))
print('和风天气API的KEY:'+weatherKEY)
#print('一铭API密钥:'+str(onemingKey))
print('Z-library链接:'+ZlibraryURL) #服务器出现问题(或者说被墙了),暂时停止维护
print('Z-library登录邮箱:'+ZlibUserEmail) #服务器出现问题(或者说被墙了),暂时停止维护
print('Z-library登录密码:'+ZlibPassword) #服务器出现问题(或者说被墙了),暂时停止维护
print('CQ-HTTP服务端IP:'+cqhttpserverip)
print('CQ-HTTP服务端IP端口:'+str(cqhttpserveriphost))
print('CQ-HTTP服务端反向Post端口:'+str(cqhttpposthost))
print('CQ-HTTP服务端access_token:' + str(cqhttpaccesstoken))
print('机器人名字:'+BotName)
print('机器人版本:'+MintBotVersion)
print('私聊黑名单:'+str(privateblacklist))
print('群聊黑名单:'+str(groupblacklist))
print('编创协会员列表:'+str(bcxVIPid))
print('编创协已使用的会员证:'+str(bcxVIPCode))
print('配置加载完成,若信息错误请自己修改配置信息。')
def request_to_json(msg):
for i in range(len(msg)):
if msg[i]=="{" and msg[-1]=="\n":
return json.loads(msg[i:])
return None
#需要循环执行,返回值为json格式
def rev_msg():# json or None
Client, Address = ListenSocket.accept()
Request = Client.recv(1024).decode(encoding='utf-8')
rev_json=request_to_json(Request)
#Client.sendall((HttpResponseHeader).encode(encoding='utf-8'))
Client.sendall((HttpResponseHeader).encode(encoding='utf-8'))
Client.close()
messageRefresh = 1
return rev_json
def send_msg(resp_dict):
client = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
client.connect((str(cqhttpserverip), int(cqhttpserveriphost)))
msg_type = resp_dict['msg_type'] # 回复类型(群聊/私聊)
number = resp_dict['number'] # 回复账号(群号/好友号)
msg = resp_dict['msg'] # 要回复的消息
# 将字符中的特殊字符进行url编码
msg = urllib.parse.quote(msg)
try:
msg = msg.replace(" ", "%20")
except BaseException as error:
#print('所有异常的基类:'+str(error))
Continue
try:
msg = msg.replace("\n", "%0a")
except BaseException as error:
#print('所有异常的基类:'+str(error))
Continue
try:
msg = msg.replace("&", "%26")
except BaseException as error:
#print('所有异常的基类:'+str(error))
Continue
try:
msg = msg.replace("[","[")
except BaseException as error:
#print('所有异常的基类:'+str(error))
Continue
try:
msg = msg.replace("]","]")
except BaseException as error:
#print('所有异常的基类:'+str(error))
Continue
try:
msg = msg.replace("[","%26#91;")
except BaseException as error:
#print('所有异常的基类:'+str(error))
Continue
try:
msg = msg.replace("]","%26#93;")
except BaseException as error:
#print('所有异常的基类:'+str(error))
Continue
if msg_type == 'group':
if cqhttpaccesstoken != '':
payload = "GET /send_group_msg?access_token="+str(cqhttpaccesstoken)+"&group_id=" + str(
number) + "&message=" + msg + " HTTP/1.1\r\nHost:" + str(cqhttpserverip) + ":"+str(cqhttpserveriphost)+"\r\nConnection: close\r\n\r\n"
else:
payload = "GET /send_group_msg?group_id=" + str(
number) + "&message=" + msg + " HTTP/1.1\r\nHost:" + str(cqhttpserverip) + ":"+str(cqhttpserveriphost)+"\r\nConnection: close\r\n\r\n"
elif msg_type == 'private':
if cqhttpaccesstoken != '':
try:
msg = msg.replace("[CQ:at,qq="+str(searchsongQQ)+"]", "您好")
Continue
except BaseException as error:
#print('所有异常的基类:'+str(error))
Continue
try:
msg = msg.replace('[CQ:at,qq='+str(qq)+']',"您好")
Continue
except BaseException as error:
#print('所有异常的基类:'+str(error))
Continue
try:
msg = msg.replace("[CQ:at,qq="+str(searchsongQQ)+"]","您好")
Continue
except BaseException as error:
#print('所有异常的基类:'+str(error))
Continue
try:
msg = msg.replace("[CQ:face,id=156]","")
Continue
except BaseException as error:
#print('所有异常的基类:'+str(error))
Continue
try:
msg = msg.replace("[CQ:face,id=74]","")
Continue
except BaseException as error:
#print('所有异常的基类:'+str(error))
Continue
try:
msg = msg.replace("[CQ:face,id=161]","")
Continue
except BaseException as error:
#print('所有异常的基类:'+str(error))
Continue
try:
msg = msg.replace("[CQ:face,id=157]","")
Continue
except BaseException as error:
#print('所有异常的基类:'+str(error))
Continue
try:
msg = msg.replace("[CQ:face,id=160]","")
Continue
except BaseException as error:
#print('所有异常的基类:'+str(error))
Continue
try:
msg = msg.replace("[CQ:face,id=162]","")
Continue
except BaseException as error:
#print('所有异常的基类:'+str(error))
Continue
payload = "GET /send_private_msg?access_token="+str(cqhttpaccesstoken)+"&user_id=" + str(
number) + "&message=" + msg + " HTTP/1.1\r\nHost:" + str(cqhttpserverip) + ":"+str(cqhttpserveriphost)+"\r\nConnection: close\r\n\r\n"
else:
try:
msg = msg.replace("[CQ:at,qq="+str(searchsongQQ)+"]", "您好")
Continue
except BaseException as error:
#print('所有异常的基类:'+str(error))
Continue
try:
msg = msg.replace('[CQ:at,qq='+str(qq)+']',"您好")
Continue
except BaseException as error:
#print('所有异常的基类:'+str(error))
Continue
try:
msg = msg.replace("[CQ:at,qq="+str(searchsongQQ)+"]","您好")
Continue
except BaseException as error:
#print('所有异常的基类:'+str(error))
Continue
try:
msg = msg.replace("[CQ:face,id=156]","")
Continue
except BaseException as error:
#print('所有异常的基类:'+str(error))
Continue
try:
msg = msg.replace("[CQ:face,id=74]","")
Continue
except BaseException as error:
#print('所有异常的基类:'+str(error))
Continue
try:
msg = msg.replace("[CQ:face,id=161]","")
Continue
except BaseException as error:
#print('所有异常的基类:'+str(error))
Continue
try:
msg = msg.replace("[CQ:face,id=157]","")
Continue
except BaseException as error:
#print('所有异常的基类:'+str(error))
Continue
try:
msg = msg.replace("[CQ:face,id=160]","")
Continue
except BaseException as error:
#print('所有异常的基类:'+str(error))
Continue
try:
msg = msg.replace("[CQ:face,id=162]","")
Continue
except BaseException as error:
#print('所有异常的基类:'+str(error))
Continue
payload = "GET /send_private_msg?user_id=" + str(
number) + "&message=" + msg + " HTTP/1.1\r\nHost:" + str(cqhttpserverip) + ":"+str(cqhttpserveriphost)+"\r\nConnection: close\r\n\r\n"
print("发送" + payload)
client.send(payload.encode("utf-8"))
client.close()
return 0
def get_group(id):
if cqhttpaccesstoken != '':
response = requests.post('http://'+str(cqhttpserverip)+':'+str(cqhttpserveriphost)+'/get_group_member_list?access_token='+str(cqhttpaccesstoken)+'&group_id='+str(id)).json()
else:
response = requests.post('http://'+str(cqhttpserverip)+':'+str(cqhttpserveriphost)+'/get_group_member_list?group_id='+str(id)).json()
for i in response['data']:
if(i['card']!=''):
print(i['card']+str(i['user_id']))
else:
print(i['nickname']+str(i['user_id']))
def sea_mp3(songpagefun):
try:
songaddress = 'http://www.xmsj.org/'
songnamelist = []
songimagelist = []
songlinklist = []
songmp3list = []
songidlist = []
messagescucess = 0
songlistline = 0
songpage = int(songpagefun)
songheader = {'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4515.159 Safari/537.36','X-Requested-With':'XMLHttpRequest','Content-Type':'application/x-www-form-urlencoded; charset=UTF-8','Accept':'application/json, text/javascript, */*; q=0.01','Connection':'keep-alive'}
songdata = {'input':str(songname),'filter':'name','type':str(songtype),'page':int(songpage)}
print(songdata)
#songgetrequestscookies = requests.get('http://ia.51.la/go1?id=19997613').cookies
#print(songgetrequestscookies)
#songpostrequests = requests.post(songaddress, data=songdata,cookies=songgetrequestscookies,headers=songheader).text
songpostrequests = requests.post(songaddress, data=songdata,headers=songheader).text
print(songpostrequests)
songjson = demjson.decode(songpostrequests)
if songjson.get("code") == 200:
songmessage = "[CQ:face,id=12]嗷呜OwO,这是搜索到的歌曲:" + str('\n')
for songline in songjson.get("data"):
songnamelist.append(songline.get("title")+'---'+songline.get('author'))
print(songline.get("title")+'---'+songline.get('author'))
songimagelist.append(songline.get("pic"))
print(songline.get("pic"))
songidlist.append(songline.get("songid"))
print(songline.get("songid"))
songlinklist.append(songline.get("link"))
print(songline.get("link"))
songmp3list.append(songline.get("url"))
print(songline.get("url"))
songmessage = songmessage + '歌名:'+ str(songline.get("title"))+'---'+str(songline.get('author')) + str("\n") + '歌曲ID:'+ str(songline.get("songid")) + str("\n") + '[CQ:image,file='+str(songline.get("pic"))+']'+str("\n") + '歌曲链接:' + str(songline.get("link")) + str("\n")
songlistline = songlistline +1
print(songlistline)
songmessage = songmessage + str('"音乐API来自音乐搜索器,请根据对应序号回复对应阿拉伯数字.当前为第'+str(songpage)+'页,你可以回复"'+BotName+',下一页"进行翻页操作(你有1分钟的操作时间,在此期间其他人无法进行操作,除非使用人执行"停止"命令或超时(任何人都可以回复"'+BotName+',停止操作"中止执行人操作))(音乐是语音与Mp3链接一起发出,若没有受到语音可直接点击Mp3链接进行在线试听)(不支持购买播放和一份中试听,这一类的歌曲会导致语音和mp3链接一起失效)。"'+str('\n')+"-------------------"+str('\n')+MintBotVersion)
send_msg({'msg_type':str(messagetype),'number':sendid,'msg':songmessage})
return 200
elif songjson.get("code") == 404:
print(songjson.get("error"))
send_msg({'msg_type':str(messagetype),'number':sendid,'msg':"[CQ:at,qq="+str(searchsongQQ)+"][CQ:face,id=9]呜呜,找不到对应的歌曲QAQ"+str('\n')+"-------------------"+str('\n')+MintBotVersion})
return 404
else:
print(songjson.get("error"))
thesearchmusiccode=str(songjson.get("code"))
send_msg({'msg_type':str(messagetype),'number':sendid,'msg':"[CQ:at,qq="+str(searchsongQQ)+"][CQ:face,id=9]呜呜,出错了QAQ:"+str(songjson.get("error"))+str('\n')+"-------------------"+str('\n')+MintBotVersion})
crashlogsave("音乐搜索:(这是调用API时发生的错误)"+f"({thesearchmusiccode})"+str(songjson.get("error")))
return songjson.get("code")
except BaseException as error:
send_msg({'msg_type':str(messagetype),'number':sendid,'msg':"[CQ:at,qq="+str(searchsongQQ)+"][CQ:face,id=9]呜呜,出错了QAQ:API可能出现了异常"+str('\n')+"-------------------"+str('\n')+MintBotVersion})
crashlogsave("音乐搜索:(这是在用户执行下一页或上一页时发生的错误)"+str(error))
class mythread(threading.Thread):
def __init__(self,defun,threadID,name,delay):
threading.Thread.__init__(self)
self.threadID = 1
self.name = "waittime"
self.delay = 1
def run(self,defun):
print ("开始线程:" + self.name)
defun()
print ("退出线程:" + self.name)
try:
#ChatLastTimerequests = BCMCreator.GetChat_local(11,15)
ChatLastTimerequests = BCMCreator.GetChat(11,15)
print(ChatLastTimerequests)
ChatLastTimeJson = demjson.decode(ChatLastTimerequests)
for line1 in range(1,len(ChatLastTimeJson)+1):
line = ChatLastTimeJson[int(line1)*-1]
ChatLastTime = str(line.get("time"))
ChatLastID = str(line.get("id"))
ChatLastIDList.append(str(line.get("id")))
#print(ChatLastID)
#print(ChatLastTime)
print("BCMcreator:初始化完毕")
except BaseException as error:
ChatMessageAllow =0
crashlogsave("BCMcreator(聊天室收发):"+str(error))
print("BCMcreator:初始化失败,已关闭聊天室收发消息功能")
def chatfind():
messagetype = "group"
sendid = "982923687"
#sendid = "1009481093"
#print("BCMcreator:开始检查消息")
while True:
if str(ChatMessageAllow) == "1":
#print("BCMcreator:时间已到,开始检查消息")
time.sleep(10)
#chatjson = json.loads(BCMCreator.GetChat_local(19,1))
#chatjson = demjson.decode(BCMCreator.GetChat_local(11,15))
chatjson = demjson.decode(BCMCreator.GetChat(11,15))
chattmpmessage = ""
#print(chatjson)
for line1 in range(1,len(chatjson)+1):
line = chatjson[int(line1)*-1]
#print(line)
#if str(line.get("time"))[len(str(line.get("time")))-8:len(str(line.get("time")))] >= ChatLastTime[len(ChatLastTime)-8:len(ChatLastTime)]:
if str(line.get("time")) >= ChatLastTime:
if str(line.get("sender_id")) != "19":
#print(str(line.get("id")))
if str(line.get("id")) != str(ChatLastID):
if str(str(line.get("id")) in ChatLastIDList) == "False":
print("BCMcreator:获得到最新消息:"+line.get("message"))
try:
#for user in demjson.decode(BCMCreator.getChatUser_user_name_local(line.get("sender_id"))):
for user in demjson.decode(BCMCreator.getChatUser_user_name(line.get("sender_id"))):
sendname = user.get("first_name")
except:
sendname = "未知用户(无法通过ID正确查找到该用户)"
chatuserid = str(line.get("sender_id"))
if chattmpmessage != "":
chattmpmessage = chattmpmessage + "\n" + f'网络聊天室[{sendname}(ID:{chatuserid})]:'+line.get("message")
else:
chattmpmessage = chattmpmessage + f'网络聊天室[{sendname}(ID:{chatuserid})]:'+line.get("message")
lasttime = line.get("time")
lastid = str(line.get("id"))
exec(f"global ChatLastTime;ChatLastTime = '{lasttime}'")
exec(f"global ChatLastID;ChatLastID = '{lastid}'")
exec(f"global ChatLastIDList;ChatLastIDList.append({lastid})")
save_save()
if chattmpmessage != "":
send_msg({'msg_type':str(messagetype),'number':sendid,'msg':chattmpmessage})
#print("BCMcreator:检查完毕,开始等待3秒")
def getfile2tempfilelink(QQID):
send_msg({'msg_type':str(messagetype),'number':sendid,'msg':f"[CQ:at,qq={QQID}] 请发送文件到群文件中"})
def MoYuDayDef(messagetype,sendid,qq):
MoYuJsonGet = WebMediaApi.MoYuDayVVHan("json")
MoYuJson = demjson.decode(MoYuJsonGet)
MoYuFile = requests.get(MoYuJson.get("url"))
MoYuFileType = filetype.guess(MoYuFile.content).extension
with open(os.getcwd()+"\MoYuimage."+MoYuFileType,'wb') as f:
f.write(MoYuFile.content)
send_msg({'msg_type':str(messagetype),'number':sendid,'msg':f"[CQ:at,qq={qq}][CQ:face,id=12]摸鱼时间~~"+str("\n")+"[CQ:image,file=file:///"+os.getcwd()+"\MoYuimage."+MoYuFileType+"]"})
for i in range(1):
t = threading.Thread(target=chatfind)
t.start()
print('接受端口为'+str(cqhttpposthost)+',请自行在Bot服务端中设置反向HTTP POST地址。')
Zliblogin = 0
print('加载完毕,欢迎使用MintBot!')
while True:
try:
rev = rev_msg()
print(rev)
if rev == None:
continue
except:
continue
if rev["post_type"] == "message":
#print(rev) #需要功能自己DIY
try:
if rev["message_type"] == "group" or rev["message_type"] == "private": #群聊和私聊
if rev["message_type"] == "group":
sendid = rev['group_id']
message = rev["raw_message"]
qq=rev['sender']['user_id']
messagetype = 'group'
wmsucessful = 1
if str(sendid) == "" and str(ChatMessageAllow) == "1":
if message[0:1] == "#" or message[0:len(BotName)] == str(BotName) or message[0:len(message)] == "[CQ:at,qq="+QQID+"]" or message[0:len(message)] == "[CQ:at,qq="+QQID+"] ":
pass
else:
if str(qq) in bcxVIPid:
print("BCMcreator:该会员已和机器人绑定")
try:
final = json.loads(BCMCreator.RoomChat_meid(bcxVIPid.get(str(qq)),"11",message,"114514"))
#print(final)
if str(final.get("code")) != "200":
print("BCMcreator:使用该会员ID时无法发送消息,已自动转用19:"+str(final))
peoplename = rev["sender"]["nickname"]
final = json.loads(BCMCreator.RoomChat_meid("19","11",f"{peoplename}:{message}","114514"))
print(final)
else:
Bcxlastid = final.get("uid")
ChatLastIDList.append(Bcxlastid)
print("BCMcreator:使用会员ID发送消息成功,消息ID为:"+str(Bcxlastid))
save_save()
except:
print("BCMcreator:编创协会员ID获取失败")
peoplename = rev["sender"]["nickname"]
final = json.loads(BCMCreator.RoomChat_meid("19","11",f"{peoplename}:{message}","114514"))
else:
peoplename = rev["sender"]["nickname"]
final = json.loads(BCMCreator.RoomChat_meid("19","11",f"{peoplename}:{message}","114514"))
#print(final)
if rev["message_type"] == "private":
sendid = rev['sender']['user_id']
message = rev["raw_message"]
qq = rev['sender']['user_id']
messagetype = 'private'
try:
send_msg({'msg_type':str(messagetype),'number':int(superadmin),'msg':'收到来自'+str(sendid)+'的消息:'+str(message)})
Continue
except BaseException as error:
crashlogsave("私聊转发管理:"+str(error))
send_msg({'msg_type':str(messagetype),'number':int(superadmin),'msg':'收到消息但发送了错误QAQ:'+str(error)})
Continue
wmsucessful =1
#print('消息为群消息类')
print('消息为群聊和私聊消息类')
if "[CQ:at,qq="+QQID+"]" in message:
if rev['raw_message'][len(rev['raw_message'])-2:len(rev['raw_message'])]=='在吗':
send_msg({'msg_type':str(messagetype),'number':sendid,'msg':'[CQ:poke,qq={}]'.format(qq)})
send_msg({'msg_type':str(messagetype),'number':sendid,'msg':'[CQ:face,id=147]'})
elif message[0:4] == '#登录 ' or message[0:4] == '#登陆 ' or message[0:4] == '#登入 ' or message[0:4] == '#绑定 ':
logininbcxgroup = 0
if messagetype == 'group':
if str(sendid) == "114514" or str(sendid) == "114514" or str(sendid) == "114514":
logininbcxgroup = 1
else:
send_msg({'msg_type':str(messagetype),'number':sendid,'msg':"[CQ:at,qq="+str(qq)+"]"+'[CQ:face,id=9]呜呜,目前这个功能只能在官方协会群使用。如有疑问可以直接私聊留言'})
continue
else:
send_msg({'msg_type':str(messagetype),'number':sendid,'msg':"[CQ:at,qq="+str(qq)+"]"+'[CQ:face,id=9]呜呜,目前这个功能只能在官方协会的群使用。如有疑问可以直接私聊留言'})
continue
try:
bcxcode = message[4:len(message)]
print(bcxcode)
if bcxcode.isdigit() == False:
send_msg({'msg_type':str(messagetype),'number':sendid,'msg':"[CQ:at,qq="+str(qq)+"]"+'[CQ:face,id=9]呜呜,您输入的code格式不正确XwX'})
continue
bcxcodejson=demjson.decode(BCMCreator.user_info_code_Plus(bcxcode))
if str(bcxcodejson.get("code")) == '200':
bcxjson[str(qq)]=demjson.encode(bcxcodejson)
bcxVIPid[str(qq)] = bcxcodejson.get("uid")
save_save()
print(str(BCMCreator.user_destroyCode(bcxcode)))
send_msg({'msg_type':str(messagetype),'number':sendid,'msg':"[CQ:at,qq="+str(qq)+"]"+'[CQ:face,id=147]账号与本机器人绑定成功\n[CQ:image,file='+bcxcodejson.get("picture")+']\n会员昵称:'+str(bcxcodejson.get("name"))})
else:
send_msg({'msg_type':str(messagetype),'number':sendid,'msg':"[CQ:at,qq="+str(qq)+"]"+'[CQ:face,id=9]绑定失败('+str(bcxcodejson.get('code'))+'):'+str(bcxcodejson.get('msg'))+'\n友情提示:code不是编程猫ID,如果您不知道code或者没有code,请去'+r'https://bcmcreator.cn/index.php?mod=OAuth'+'申请code'})
except BaseException as error:
crashlogsave("BCMcreator(#登录):"+str(error))
send_msg({'msg_type':str(messagetype),'number':sendid,'msg':"[CQ:at,qq="+str(qq)+"]"+'[CQ:face,id=9]绑定失败(连接服务器失败):'+str(error)})
send_msg({'msg_type':str(messagetype),'number':int(superadmin),'msg':'代码执行时发送了错误QAQ:'+str(error)})
elif message[0:3] == '#登录' or message[0:3] == '#登陆' or message[0:3] == '#登入' or message[0:3] == '#绑定':
logininbcxgroup = 0
if messagetype == 'group':
if str(sendid) == "599683567" or str(sendid) == "982923687" or str(sendid) == "1009481093":
logininbcxgroup = 1
else:
send_msg({'msg_type':str(messagetype),'number':sendid,'msg':"[CQ:at,qq="+str(qq)+"]"+'[CQ:face,id=9]呜呜,目前这个功能只能在官方协会群使用。如有疑问可以直接私聊留言'})
continue
else:
send_msg({'msg_type':str(messagetype),'number':sendid,'msg':"[CQ:at,qq="+str(qq)+"]"+'[CQ:face,id=9]呜呜,目前这个功能只能在官方协会的群使用。如有疑问可以直接私聊留言'})
continue
try:
bcxcode = message[3:len(message)]
print(bcxcode)
if bcxcode.isdigit() == False:
send_msg({'msg_type':str(messagetype),'number':sendid,'msg':"[CQ:at,qq="+str(qq)+"]"+'[CQ:face,id=9]呜呜,您输入的code格式不正确XwX'})
continue
bcxcodejson=demjson.decode(BCMCreator.user_info_code_Plus(bcxcode))
if str(bcxcodejson.get("code")) == '200':
bcxjson[str(qq)]=demjson.encode(bcxcodejson)
bcxVIPid[str(qq)] = bcxcodejson.get("uid")
save_save()
print(str(BCMCreator.user_destroyCode(bcxcode)))
send_msg({'msg_type':str(messagetype),'number':sendid,'msg':"[CQ:at,qq="+str(qq)+"]"+'[CQ:face,id=147]账号与本机器人绑定成功\n[CQ:image,file='+bcxcodejson.get("picture")+']\n会员昵称:'+str(bcxcodejson.get("name"))})
else:
send_msg({'msg_type':str(messagetype),'number':sendid,'msg':"[CQ:at,qq="+str(qq)+"]"+'[CQ:face,id=9]绑定失败('+str(bcxcodejson.get('code'))+'):'+str(bcxcodejson.get('msg'))+'\n友情提示:code不是编程猫ID,如果您不知道code或者没有code,请去'+r'https://bcmcreator.cn/index.php?mod=OAuth'+'申请code'})
except BaseException as error:
crashlogsave("BCMcreator(#登录):"+str(error))
send_msg({'msg_type':str(messagetype),'number':sendid,'msg':"[CQ:at,qq="+str(qq)+"]"+'[CQ:face,id=9]绑定失败(连接服务器失败):'+str(error)})
send_msg({'msg_type':str(messagetype),'number':int(superadmin),'msg':'代码执行时发送了错误QAQ:'+str(error)})
elif message[0:5] == '#退出登录' or message[0:5] == '#退出登陆' or message[0:5] == '#退出登入':
logininbcxgroup = 0
if messagetype == 'group':
if str(sendid) == "114514" or str(sendid) == "114514" or str(sendid) == "114514":
logininbcxgroup = 1
else:
send_msg({'msg_type':str(messagetype),'number':sendid,'msg':"[CQ:at,qq="+str(qq)+"]"+'[CQ:face,id=9]呜呜,目前这个功能只能在官方协会群使用。如有疑问可以直接私聊留言'})
continue
else:
send_msg({'msg_type':str(messagetype),'number':sendid,'msg':"[CQ:at,qq="+str(qq)+"]"+'[CQ:face,id=9]呜呜,目前这个功能只能在官方协会的群使用。如有疑问可以直接私聊留言'})
continue
try:
del bcxjson[str(qq)]
del bcxVIPid[str(qq)]
send_msg({'msg_type':str(messagetype),'number':sendid,'msg':"[CQ:at,qq="+str(qq)+"]"+'[CQ:face,id=147]退出登录(删除本地数据库数据)成功'})
except:
send_msg({'msg_type':str(messagetype),'number':sendid,'msg':"[CQ:at,qq="+str(qq)+"]"+'[CQ:face,id=9]删除失败:可能您的账号没有与机器人绑定,咱在自己的数据库找不到您的信息哇QwQ'})
continue
elif message[0:5] == '#个人数据' or message[0:5] == '#个人资料' or message[0:5] == '#个人信息':
try:
try:
bcmcode = bcxVIPid[str(qq)]
except:
send_msg({'msg_type':str(messagetype),'number':sendid,'msg':"[CQ:at,qq="+str(qq)+"]"+'[CQ:face,id=9]查找失败:可能您的账号没有与机器人绑定,咱在自己的数据库找不到您的信息哇QwQ'})
continue
bcxinfo = json.loads(BCMCreator.user_info(bcmcode), strict=False)
if bcxinfo.get("code") == '200':
send_msg({'msg_type':str(messagetype),'number':sendid,'msg':"[CQ:at,qq="+str(qq)+"]"+'[CQ:face,id=147]您好哇!awa\n[CQ:image,file='+bcxinfo.get("picture")+']\n会员昵称:'+str(bcxinfo.get("name"))+'\n会员积分:'+str(bcxinfo.get("integral"))+'\n会员等级:'+str(bcxinfo.get("Membershipgrade"))+'\n会员头衔:'+str(bcxinfo.get('title'))+'\n会员的帅气签名[CQ:face,id=12]:'+str(bcxinfo.get('introduce'))})
elif bcxinfo.get("code") == '404':
send_msg({'msg_type':str(messagetype),'number':sendid,'msg':"[CQ:at,qq="+str(qq)+"]"+'[CQ:face,id=9]查找失败:咱没有在服务器数据库找到您哇,要不问问鱼鱼QwQ?'})
else:
send_msg({'msg_type':str(messagetype),'number':sendid,'msg':"[CQ:at,qq="+str(qq)+"]"+'[CQ:face,id=9]查找失败('+str(bcxinfo.get('code'))+'):'+str(bcxinfo.get('msg'))})
send_msg({'msg_type':str(messagetype),'number':int(superadmin),'msg':'代码执行时发送了错误QAQ:('+str(bcxinfo.get('code'))+'):'+str(bcxinfo.get('msg'))})
except BaseException as error:
crashlogsave("BCMcreator(#个人资料):"+str(error))
send_msg({'msg_type':str(messagetype),'number':sendid,'msg':"[CQ:at,qq="+str(qq)+"]"+'[CQ:face,id=9]查找失败:'+str(error)})
send_msg({'msg_type':str(messagetype),'number':int(superadmin),'msg':'代码执行时发送了错误QAQ:'+str(error)})
elif message[0:6] == '#查询数据 ' or message[0:6] == '#查询资料 ' or message[0:6] == '#查询信息 ' or message[0:6] == '#查找数据 ' or message[0:6] == '#查找资料 ' or message[0:6] == '#查找信息 ':
try:
bcxguess = message[6:len(message)]
bcxqq = bcxguess[bcxguess.rfind('=')+1:bcxguess.rfind(']')]
print(bcxqq)
try:
bcmcode = bcxVIPid[str(bcxqq)]
except:
send_msg({'msg_type':str(messagetype),'number':sendid,'msg':"[CQ:at,qq="+str(qq)+"]"+'[CQ:face,id=9]查找失败:可能您要查找的账号没有与机器人绑定(或许您提供的信息是编程猫ID或者是空?我们目前只接受从QQ的@获取到的QQ号),咱在自己的数据库找不到您的信息哇QwQ'})
continue
bcxinfo = demjson.decode(BCMCreator.user_info(bcmcode))
if bcxinfo.get("code") == '200':
send_msg({'msg_type':str(messagetype),'number':sendid,'msg':"[CQ:at,qq="+str(qq)+"]"+'[CQ:face,id=147]已经为您查询到我此会员了!awa\n[CQ:image,file='+bcxinfo.get("picture")+']\n会员昵称:'+str(bcxinfo.get("name"))+'\n会员积分:'+str(bcxinfo.get("integral"))+'\n会员等级:'+str(bcxinfo.get("Membershipgrade"))+'\n会员头衔:'+str(bcxinfo.get('title'))+'\n会员的帅气签名[CQ:face,id=12]:'+str(bcxinfo.get('introduce'))})
elif bcxinfo.get("code") == '404':
send_msg({'msg_type':str(messagetype),'number':sendid,'msg':"[CQ:at,qq="+str(qq)+"]"+'[CQ:face,id=9]查找失败:咱没有在服务器数据库找到您要找的人哇,要不问问鱼鱼QwQ?'})
else:
send_msg({'msg_type':str(messagetype),'number':sendid,'msg':"[CQ:at,qq="+str(qq)+"]"+'[CQ:face,id=9]查找失败('+str(bcxinfo.get('code'))+'):'+str(bcxinfo.get('msg'))})
send_msg({'msg_type':str(messagetype),'number':int(superadmin),'msg':'代码执行时发送了错误QAQ:('+str(bcxinfo.get('code'))+'):'+str(bcxinfo.get('msg'))})
except BaseException as error:
crashlogsave("BCMcreator(#查询资料):"+str(error))
send_msg({'msg_type':str(messagetype),'number':sendid,'msg':"[CQ:at,qq="+str(qq)+"]"+'[CQ:face,id=9]查找失败:'+str(error)})
send_msg({'msg_type':str(messagetype),'number':int(superadmin),'msg':'代码执行时发送了错误QAQ:'+str(error)})
elif message[0:5] == '#查询数据' or message[0:5] == '#查询资料' or message[0:5] == '#查询信息' or message[0:5] == '#查找数据' or message[0:5] == '#查找资料' or message[0:5] == '#查找信息':
try:
bcxguess = message[5:len(message)]
bcxqq = bcxguess[bcxguess.rfind('=')+1:bcxguess.rfind(']')]
print(bcxqq)
try:
bcmcode = bcxVIPid[str(bcxqq)]
except:
send_msg({'msg_type':str(messagetype),'number':sendid,'msg':"[CQ:at,qq="+str(qq)+"]"+'[CQ:face,id=9]查找失败:可能您要查找的账号没有与机器人绑定(或许您提供的信息是编程猫ID或者是空?我们目前只接受从QQ的@获取到的QQ号),咱在自己的数据库找不到您的信息哇QwQ'})
continue
bcxinfo = demjson.decode(BCMCreator.user_info(bcmcode))
if bcxinfo.get("code") == '200':
send_msg({'msg_type':str(messagetype),'number':sendid,'msg':"[CQ:at,qq="+str(qq)+"]"+'[CQ:face,id=147]已经为您查询到我此会员了!awa\n[CQ:image,file='+bcxinfo.get("picture")+']\n会员昵称:'+str(bcxinfo.get("name"))+'\n会员积分:'+str(bcxinfo.get("integral"))+'\n会员等级:'+str(bcxinfo.get("Membershipgrade"))+'\n会员头衔:'+str(bcxinfo.get('title'))+'\n会员的帅气签名[CQ:face,id=12]:'+str(bcxinfo.get('introduce'))})
elif bcxinfo.get("code") == '404':
send_msg({'msg_type':str(messagetype),'number':sendid,'msg':"[CQ:at,qq="+str(qq)+"]"+'[CQ:face,id=9]查找失败:咱没有在服务器数据库找到您要找的人哇,要不问问鱼鱼QwQ?'})
else:
send_msg({'msg_type':str(messagetype),'number':sendid,'msg':"[CQ:at,qq="+str(qq)+"]"+'[CQ:face,id=9]查找失败('+str(bcxinfo.get('code'))+'):'+str(bcxinfo.get('msg'))})
send_msg({'msg_type':str(messagetype),'number':int(superadmin),'msg':'代码执行时发送了错误QAQ:('+str(bcxinfo.get('code'))+'):'+str(bcxinfo.get('msg'))})
except BaseException as error:
crashlogsave("BCMcreator(#查询资料):"+str(error))
send_msg({'msg_type':str(messagetype),'number':sendid,'msg':"[CQ:at,qq="+str(qq)+"]"+'[CQ:face,id=9]查找失败:'+str(error)})
send_msg({'msg_type':str(messagetype),'number':int(superadmin),'msg':'代码执行时发送了错误QAQ:'+str(error)})
elif message[0:4] == '#日志 ':
try:
bcxguess = message[4:len(message)]
print(bcxguess)
if 'CQ:at' in bcxguess:
bcxqq = bcxguess[bcxguess.rfind('=')+1:bcxguess.rfind(']')]
else:
bcxqq = bcxguess
print(bcxqq)
if 'CQ:at' in bcxguess:
try:
bcmcode = bcxVIPid[str(bcxqq)]
except:
send_msg({'msg_type':str(messagetype),'number':sendid,'msg':"[CQ:at,qq="+str(qq)+"]"+'[CQ:face,id=9]查找失败:可能您要查找的账号没有与机器人绑定(或许您提供的信息是编程猫ID或者是空?我们目前只接受从QQ的@获取到的QQ号),咱在自己的数据库找不到您的信息哇QwQ'})
continue
else:
bcmcode = bcxqq
print(bcmcode)
bcxloginfo = json.loads(BCMCreator.association_log_id(bcmcode,3), strict=False)
if 'code' in bcxloginfo:
if bcxloginfo.get("code") == '404':
send_msg({'msg_type':str(messagetype),'number':sendid,'msg':"[CQ:at,qq="+str(qq)+"]"+'[CQ:face,id=9]查找失败:咱没有在服务器数据库找到您要找的人的日志哇,要不问问鱼鱼QwQ?'})
else:
bxclogmessage = "[CQ:at,qq="+str(qq)+"]\n成功查询到关于此人的日志awa:\n"
bxclogmessageline = 1
for line in bcxloginfo:
bxclogmessage = bxclogmessage + '------第'+str(bxclogmessageline)+'条------\n时间:' + str(line.get('time')) + '\n委员:' + str(line.get("name")) + '\n原因:' + str(line.get('yy')) +'\n'
bxclogmessageline = bxclogmessageline + 1
send_msg({'msg_type':str(messagetype),'number':sendid,'msg':bxclogmessage})
except BaseException as error:
crashlogsave("BCMcreator(#日志):"+str(error))
send_msg({'msg_type':str(messagetype),'number':sendid,'msg':"[CQ:at,qq="+str(qq)+"]"+'[CQ:face,id=9]查找失败:'+str(error)})
send_msg({'msg_type':str(messagetype),'number':int(superadmin),'msg':'代码执行时发送了错误QAQ:'+str(error)})
elif message[0:3] == '#日志':
try:
bcxguess = message[3:len(message)]
print(bcxguess)
if 'CQ:at' in bcxguess:
bcxqq = bcxguess[bcxguess.rfind('=')+1:bcxguess.rfind(']')]
else:
bcxqq = bcxguess
print(bcxqq)
if 'CQ:at' in bcxguess:
try:
bcmcode = bcxVIPid[str(bcxqq)]
except:
send_msg({'msg_type':str(messagetype),'number':sendid,'msg':"[CQ:at,qq="+str(qq)+"]"+'[CQ:face,id=9]查找失败:可能您要查找的账号没有与机器人绑定(或许您提供的信息是编程猫ID或者是空?我们目前只接受从QQ的@获取到的QQ号),咱在自己的数据库找不到您的信息哇QwQ'})
continue
else:
bcmcode = bcxqq
print(bcmcode)
bcxloginfo = json.loads(BCMCreator.association_log_id(bcmcode,3), strict=False)
if 'code' in bcxloginfo:
if bcxloginfo.get("code") == '404':
send_msg({'msg_type':str(messagetype),'number':sendid,'msg':"[CQ:at,qq="+str(qq)+"]"+'[CQ:face,id=9]查找失败:咱没有在服务器数据库找到您要找的人的日志哇,要不问问鱼鱼QwQ?'})
else:
bxclogmessage = "[CQ:at,qq="+str(qq)+"]\n成功查询到关于此人的日志awa:\n"
bxclogmessageline = 1
for line in bcxloginfo:
bxclogmessage = bxclogmessage + '------第'+str(bxclogmessageline)+'条------\n时间:' + str(line.get('time')) + '\n委员:' + str(line.get("name")) + '\n原因:' + str(line.get('yy')) +'\n'
bxclogmessageline = bxclogmessageline + 1
send_msg({'msg_type':str(messagetype),'number':sendid,'msg':bxclogmessage})
except BaseException as error:
crashlogsave("BCMcreator(#日志):"+str(error))
send_msg({'msg_type':str(messagetype),'number':sendid,'msg':"[CQ:at,qq="+str(qq)+"]"+'[CQ:face,id=9]查找失败:'+str(error)})
send_msg({'msg_type':str(messagetype),'number':int(superadmin),'msg':'代码执行时发送了错误QAQ:'+str(error)})
elif message[0:6] == '#委员日志 ':
try:
bcxguess = message[6:len(message)]
print(bcxguess)
if 'CQ:at' in bcxguess:
bcxqq = bcxguess[bcxguess.rfind('=')+1:bcxguess.rfind(']')]
else:
bcxqq = bcxguess
print(bcxqq)
if 'CQ:at' in bcxguess:
try:
bcmcode = bcxVIPid[str(bcxqq)]
except:
send_msg({'msg_type':str(messagetype),'number':sendid,'msg':"[CQ:at,qq="+str(qq)+"]"+'[CQ:face,id=9]查找失败:可能您要查找的账号没有与机器人绑定(或许您提供的信息是编程猫ID或者是空?我们目前只接受从QQ的@获取到的QQ号),咱在自己的数据库找不到您的信息哇QwQ'})
continue
else:
bcmcode = bcxqq
print(bcmcode)
bcxloginfo = json.loads(BCMCreator.association_log_uid(bcmcode,3), strict=False)
if 'code' in bcxloginfo:
if bcxloginfo.get("code") == '404':
send_msg({'msg_type':str(messagetype),'number':sendid,'msg':"[CQ:at,qq="+str(qq)+"]"+'[CQ:face,id=9]查找失败:咱没有在服务器数据库找到您要找的人的日志哇,要不问问鱼鱼QwQ?'})
else:
bxclogmessage = "[CQ:at,qq="+str(qq)+"]\n成功查询到关于此人的日志awa:\n"
bxclogmessageline = 1
for line in bcxloginfo:
bxclogmessage = bxclogmessage + '------第'+str(bxclogmessageline)+'条------\n时间:' + str(line.get('time')) + '\n委员:' + str(line.get("name")) + '\n原因:' + str(line.get('yy')) +'\n'
bxclogmessageline = bxclogmessageline + 1
send_msg({'msg_type':str(messagetype),'number':sendid,'msg':bxclogmessage})
except BaseException as error:
crashlogsave("BCMcreator(#委员日志):"+str(error))
send_msg({'msg_type':str(messagetype),'number':sendid,'msg':"[CQ:at,qq="+str(qq)+"]"+'[CQ:face,id=9]查找失败:'+str(error)})
send_msg({'msg_type':str(messagetype),'number':int(superadmin),'msg':'代码执行时发送了错误QAQ:'+str(error)})
elif message[0:5] == '#委员日志':
try:
bcxguess = message[5:len(message)]
print(bcxguess)
if 'CQ:at' in bcxguess:
bcxqq = bcxguess[bcxguess.rfind('=')+1:bcxguess.rfind(']')]
else:
bcxqq = bcxguess
print(bcxqq)
if 'CQ:at' in bcxguess:
try:
bcmcode = bcxVIPid[str(bcxqq)]
except:
send_msg({'msg_type':str(messagetype),'number':sendid,'msg':"[CQ:at,qq="+str(qq)+"]"+'[CQ:face,id=9]查找失败:可能您要查找的账号没有与机器人绑定(或许您提供的信息是编程猫ID或者是空?我们目前只接受从QQ的@获取到的QQ号),咱在自己的数据库找不到您的信息哇QwQ'})
continue
else:
bcmcode = bcxqq
print(bcmcode)
bcxloginfo = json.loads(BCMCreator.association_log_uid(bcmcode,3), strict=False)
if 'code' in bcxloginfo:
if bcxloginfo.get("code") == '404':
send_msg({'msg_type':str(messagetype),'number':sendid,'msg':"[CQ:at,qq="+str(qq)+"]"+'[CQ:face,id=9]查找失败:咱没有在服务器数据库找到您要找的人的日志哇,要不问问鱼鱼QwQ?'})
else:
bxclogmessage = "[CQ:at,qq="+str(qq)+"]\n成功查询到关于此人的日志awa:\n"
bxclogmessageline = 1
for line in bcxloginfo:
bxclogmessage = bxclogmessage + '------第'+str(bxclogmessageline)+'条------\n时间:' + str(line.get('time')) + '\n委员:' + str(line.get("name")) + '\n原因:' + str(line.get('yy')) +'}-\n'
bxclogmessageline = bxclogmessageline + 1
send_msg({'msg_type':str(messagetype),'number':sendid,'msg':bxclogmessage})
except BaseException as error:
crashlogsave("BCMcreator(#委员日志):"+str(error))
send_msg({'msg_type':str(messagetype),'number':sendid,'msg':"[CQ:at,qq="+str(qq)+"]"+'[CQ:face,id=9]查找失败:'+str(error)})
send_msg({'msg_type':str(messagetype),'number':int(superadmin),'msg':'代码执行时发送了错误QAQ:'+str(error)})
elif message[0:5] == '#全局日志':
if rev["message_type"] == "group":
if cqhttpaccesstoken == '':
qqinfojson = json.loads(requests.get('http://'+str(cqhttpserverip)+':'+str(cqhttpserveriphost)+'/get_group_member_info?group_id='+str(sendid)+'&user_id='+str(qq)+'&no_cache=true').text, strict=False)
else:
qqinfojson = json.loads(requests.get('http://'+str(cqhttpserverip)+':'+str(cqhttpserveriphost)+'/get_group_member_info?group_id='+str(sendid)+'&user_id='+str(qq)+'&no_cache=true'+'&access_token='+str(cqhttpaccesstoken)).text, strict=False)
print('http://'+str(cqhttpserverip)+':'+str(cqhttpserveriphost)+'/get_group_member_info?group_id='+str(sendid)+'&user_id='+str(qq)+'&access_token='+str(cqhttpaccesstoken))
print(qqinfojson)
print(str(qqinfojson.get("data").get("role")))
if str(qqinfojson.get("data").get("role")) == "member":
send_msg({'msg_type':str(messagetype),'number':sendid,'msg':"[CQ:at,qq="+str(qq)+"]"+'[CQ:face,id=9]抱歉,您不是管理员或群主'})
continue
else:
try:
#bcxloginfo = json.loads(BCMCreator.association_log_local(5), strict=False)
bcxloginfo = json.loads(BCMCreator.association_log(5), strict=False)
if 'code' in bcxloginfo:
if bcxloginfo.get("code") == '404':
send_msg({'msg_type':str(messagetype),'number':sendid,'msg':"[CQ:at,qq="+str(qq)+"]"+'[CQ:face,id=9]查找失败:咱没有在服务器数据库找到您要找的人的日志哇,要不问问鱼鱼QwQ?'})
else:
bxclogmessage = '\n'
for line in bcxloginfo:
send_msg({'msg_type':str(messagetype),'number':sendid,'msg':"[CQ:at,qq="+str(qq)+"]"+ '\n时间:' + str(line.get('time')) +'\n委员:' + str(line.get('name')) +'\n委员编程猫ID:' + str(line.get('id')) + '\n被执行委员编程猫ID:' + str(line.get('beuid')) + '\n原因:' + str(line.get('yy'))})
except BaseException as error:
crashlogsave("BCMcreator(#全局日志):"+str(error))
send_msg({'msg_type':str(messagetype),'number':sendid,'msg':"[CQ:at,qq="+str(qq)+"]"+'[CQ:face,id=9]查找失败:'+str(error)})
send_msg({'msg_type':str(messagetype),'number':int(superadmin),'msg':'代码执行时发送了错误QAQ:'+str(error)})
else:
send_msg({'msg_type':str(messagetype),'number':sendid,'msg':"[CQ:at,qq="+str(qq)+"]"+'[CQ:face,id=9]该功能只能在群聊使用'})
elif message[0:5] == '#本周排名' or message[0:6] == '#本周排行榜':
if rev["message_type"] == "group":
if cqhttpaccesstoken == '':
qqinfojson = json.loads(requests.get('http://'+str(cqhttpserverip)+':'+str(cqhttpserveriphost)+'/get_group_member_info?group_id='+str(sendid)+'&user_id='+str(qq)+'&no_cache=true').text, strict=False)
else:
qqinfojson = json.loads(requests.get('http://'+str(cqhttpserverip)+':'+str(cqhttpserveriphost)+'/get_group_member_info?group_id='+str(sendid)+'&user_id='+str(qq)+'&no_cache=true'+'&access_token='+str(cqhttpaccesstoken)).text, strict=False)
print('http://'+str(cqhttpserverip)+':'+str(cqhttpserveriphost)+'/get_group_member_info?group_id='+str(sendid)+'&user_id='+str(qq)+'&access_token='+str(cqhttpaccesstoken))
print(qqinfojson)
print(str(qqinfojson.get("data").get("role")))
if str(qqinfojson.get("data").get("role")) == "member":
send_msg({'msg_type':str(messagetype),'number':sendid,'msg':"[CQ:at,qq="+str(qq)+"]"+'[CQ:face,id=9]抱歉,您不是管理员或群主'})
continue
else:
bcxrankjson = BCMCreator.user_workdata7()
print(bcxrankjson)
bcxrank = json.loads(bcxrankjson)
bcxrankmessage = "[CQ:at,qq="+str(qq)+"] "+"[CQ:face,id=147]这是本周的作品排行榜:\n序号.作品名称(作品ID) 分数"
bcxrankline = 1
for line in bcxrank:
if float(line.get("fs")) >= 0.25:
bcxrankdict = str(line.get("id")).split("&")
bcxrankmessage = bcxrankmessage + '\n' + str(bcxrankline) + '.' + str(bcxrankdict[1]) + '(' + str(bcxrankdict[0]) + ') ' + str(line.get("fs"))
bcxrankline = bcxrankline + 1
else:
break
bcxrankmessage = bcxrankmessage + '\n(以上数据来自前7天的作品投稿数据,仅展示0.25分数及以上的。更多数据请查看https://storage.bcmcreator.cn/Outstandingzp.php (话说这上面有没有你的呢?awa))'
send_msg({'msg_type':str(messagetype),'number':sendid,'msg':bcxrankmessage})
else:
send_msg({'msg_type':str(messagetype),'number':sendid,'msg':"[CQ:at,qq="+str(qq)+"]"+'[CQ:face,id=9]该功能只能在群聊使用'})
elif message[0:8] == '#同步编程猫昵称':
send_msg({'msg_type':str(messagetype),'number':sendid,'msg':"[CQ:at,qq="+str(qq)+"]"+'开始修改昵称......'})
try:
try:
bcmcode = bcxVIPid[str(qq)]
except:
send_msg({'msg_type':str(messagetype),'number':sendid,'msg':"[CQ:at,qq="+str(qq)+"]"+'[CQ:face,id=9]修改失败:可能您的账号没有与机器人绑定(使用该功能必须绑定机器人,后续可退出登录),咱在自己的数据库找不到您的信息哇QwQ'})
continue
bcxinfo = json.loads(BCMCreator.user_info(bcmcode), strict=False)
if bcxinfo.get("code") == '200':
print(requests.get('http://'+str(cqhttpserverip)+':'+str(cqhttpserveriphost)+'/set_group_card?group_id='+str(sendid)+'&user_id='+str(qq)+'&card='+str(bcxinfo.get("name"))+'-'+str(bcxinfo.get("uid"))+'&access_token='+str(cqhttpaccesstoken)).content)
send_msg({'msg_type':str(messagetype),'number':sendid,'msg':"[CQ:at,qq="+str(qq)+"]"+'[CQ:face,id=147]修改完成awa:'+str(bcxinfo.get("name"))+'-'+str(bcxinfo.get("uid"))})
elif bcxinfo.get("code") == '404':
send_msg({'msg_type':str(messagetype),'number':sendid,'msg':"[CQ:at,qq="+str(qq)+"]"+'[CQ:face,id=9]修改失败:咱没有在服务器数据库找到您哇,要不问问鱼鱼QwQ?'})
else:
send_msg({'msg_type':str(messagetype),'number':sendid,'msg':"[CQ:at,qq="+str(qq)+"]"+'[CQ:face,id=9]修改失败('+str(bcxinfo.get('code'))+'):'+str(bcxinfo.get('msg'))})
send_msg({'msg_type':str(messagetype),'number':int(superadmin),'msg':'代码执行时发送了错误QAQ:('+str(bcxinfo.get('code'))+'):'+str(bcxinfo.get('msg'))})
except BaseException as error:
crashlogsave("BCMcreator(#同步编程猫昵称):"+str(error))
send_msg({'msg_type':str(messagetype),'number':sendid,'msg':"[CQ:at,qq="+str(qq)+"]"+'[CQ:face,id=9]修改失败:'+str(error)})
send_msg({'msg_type':str(messagetype),'number':int(superadmin),'msg':'代码执行时发送了错误QAQ:'+str(error)})
elif message[0:10] == '#查询委员会精神状态' or message[0:10] == '#查询编创协精神状态':
send_msg({'msg_type':str(messagetype),'number':sendid,'msg':"[CQ:at,qq="+str(qq)+"]"+'Null(?)'})
elif message[0:9] == '#查询委员精神状态':
send_msg({'msg_type':str(messagetype),'number':sendid,'msg':"[CQ:at,qq="+str(qq)+"]"+'Null(?)'})
elif message[0:3] == '#查询' and message[len(message)-4:len(message)] == '精神状态':
people = message[3:len(message)-4]
if people == '薄荷':
if Debug == 1:
send_msg({'msg_type':str(messagetype),'number':sendid,'msg':"[CQ:at,qq="+str(qq)+"]"+'自我升级中...(正在调试)\n'+'[CQ:image,file=file:///'+os.getcwd()+r'/Debug.jpg]'})
else:
send_msg({'msg_type':str(messagetype),'number':sendid,'msg':"[CQ:at,qq="+str(qq)+"]"+'GOOD!!嘿嘿owo'})
elif people == '耀西' or people == '吆西' or people == '呦西' or people == 'yoshi' or people == 'Yoshi' or people == 'yoxi' or people == 'Yoxi':
send_msg({'msg_type':str(messagetype),'number':sendid,'msg':"[CQ:at,qq=2659170494]"+'耀西你就歌姬吧,你记住我说的话哦我就站在这个群里骂你就是等你,忍不住。'})
elif people == '冷鱼':
send_msg({'msg_type':str(messagetype),'number':sendid,'msg':'没有眼睛的fish叫什么?叫fsh'})
elif people == '小鱼':
send_msg({'msg_type':str(messagetype),'number':sendid,'msg':'水煮活鱼'})
elif people == '绵羊':
send_msg({'msg_type':str(messagetype),'number':sendid,'msg':'Beep Beep,Im sheep.I say Beep Beep im sheep'})
elif people == 'array' or people == '矮睿':
#send_msg({'msg_type':str(messagetype),'number':sendid,'msg':'你所热爱的,就是你的生活'})
send_msg({'msg_type':str(messagetype),'number':sendid,'msg':'新时代的矮睿吃冷鱼!'})
elif people == '斯人':
send_msg({'msg_type':str(messagetype),'number':sendid,'msg':'斯'})
elif people == '技术狗':
send_msg({'msg_type':str(messagetype),'number':sendid,'msg':'if codemao == "编程猫":\n codedog = "编程狗"'})
elif people == '热猫':
send_msg({'msg_type':str(messagetype),'number':sendid,'msg':'建议搭配冷鱼食用'})
elif people == '冷鱼':
send_msg({'msg_type':str(messagetype),'number':sendid,'msg':'建议搭配热猫食用'})
elif people == '星舰' or people == '星舰earth' or people == 'earth':
#send_msg({'msg_type':str(messagetype),'number':sendid,'msg':'我新买的航母怎么飞了?'})
send_msg({'msg_type':str(messagetype),'number':sendid,'msg':'星舰earth,为战而生,无所畏惧!!!'})
elif people == 'ScratchMaster' or people == "SM" or people == "sm" or people == 'Sm' or people == "scratchmaster":
#send_msg({'msg_type':str(messagetype),'number':sendid,'msg':'https://github.com/LLK/scratch-gui/tree/master'})
send_msg({'msg_type':str(messagetype),'number':sendid,'msg':'ScratchMaster曰:我的名字是ScratchMaster,原本是一名全国知名的高中生名侦探,不幸的是不久之前被不明组织强灌毒药…… 而变成了江户川sm!我人虽然变小了,头脑还是原来的名侦探。不管发生什么事件,我相信真相只有一个!不对,凶手如果是他,那他的不在场证明···对了!呵,我懂了,原来是这样!'})
elif people == '企鹅':
send_msg({'msg_type':str(messagetype),'number':sendid,'msg':'企...企...企鹅是谁?QwQ'})
elif people == '鸭':
send_msg({'msg_type':str(messagetype),'number':sendid,'msg':'嘎awa'})
elif people == '我' or people == '我的':
send_msg({'msg_type':str(messagetype),'number':sendid,'msg':'我?我是谁?XwX'})
elif people == '冷鱼与热猫':
send_msg({'msg_type':str(messagetype),'number':sendid,'msg':'哇!金色传说!!!'})
elif people == '冷鱼吃热猫':
send_msg({'msg_type':str(messagetype),'number':sendid,'msg':'小鱼吃大猫awa'})
elif people == '热猫吃冷鱼':
send_msg({'msg_type':str(messagetype),'number':sendid,'msg':'啊,真香哎呀'})
elif people == '技术喵' or people == '技术猫':
send_msg({'msg_type':str(messagetype),'number':sendid,'msg':'Is Coding...'})
elif people == '派大星':
send_msg({'msg_type':str(messagetype),'number':sendid,'msg':'艺术就是派大星!!!'})
elif people == '赖纸':
#send_msg({'msg_type':str(messagetype),'number':sendid,'msg':'查询错误XwX:请求超时'})
send_msg({'msg_type':str(messagetype),'number':sendid,'msg':'尬聊的屑'})
elif people == '乔治':
send_msg({'msg_type':str(messagetype),'number':sendid,'msg':'佩奇呢?awa'})
elif people == '天边的生活':
send_msg({'msg_type':str(messagetype),'number':sendid,'msg':'蓝!好蓝啊!awa'})
elif people == '霜雪冬竹':
send_msg({'msg_type':str(messagetype),'number':sendid,'msg':'好吃吗?awa'})
elif people == 'Null':
send_msg({'msg_type':str(messagetype),'number':sendid,'msg':'Null'})
elif people == '阿兹卡班' or people == '阿兹卡班毕业生':
send_msg({'msg_type':str(messagetype),'number':sendid,'msg':'哪个班的学生?上课竟然玩手机!?'})
elif people == "工人" or people == "nomand" or people == "Nomand":
send_msg({'msg_type':str(messagetype),'number':sendid,'msg':"兰州铁路监管局投诉举报联系方式:\n地址:甘肃省兰州市城关区和政路129号 邮编:730000\n举报电话:0931-4975119 0931-4975183\n传真:0931-4975109\n电子邮箱:[email protected]\n\n女士们,先生们,欢迎选乘动车组列车!本次列车由 中川机场 开往 兰州 方向。请不要携带危险物品乘车,动车组列车全程对号入座。\nLadies and gentlemen, welcome aboard the high-speed train. This high-speed train departing from Zhongchuanjichang Station is headed for Lanzhou station. Dangerous items are not allowed within the railway promises. Please be seated by numbers corresponding to the ticket throughout the journey. \n女士们,先生们,严禁在动车组列车任何区域内吸烟。根据《铁路安全管理条例》等法律法规,在动车组列车上吸烟需承担法律责任。\nLadies and gentlemen, this is a non-smoking train. According to the railway security management regulations and relevant laws, the smoker shall assume legal responsibility. Please do not smoke on board. Thanks for your cooperation.\n兰州铁路局环西部火车游祝您旅途愉快!\nLanzhou Railway Bureau's train tour around the West wish you a pleasant journey!"})
elif people == '安':
send_msg({'msg_type':str(messagetype),'number':sendid,'msg':'整理遗容遗表'})
elif people == '贝奇':
send_msg({'msg_type':str(messagetype),'number':sendid,'msg':'我要喝电气水!!!'})
elif people == '1086':
send_msg({'msg_type':str(messagetype),'number':sendid,'msg':'勇敢86,不怕困难!'})
elif people == '蔡徐坤' or people == '坤坤':
send_msg({'msg_type':str(messagetype),'number':sendid,'msg':'只因你太美'})
elif people == "小柠檬":