Closed fatinghenji closed 2 years ago
用voicereply把语音回复开关一下,然后设置个概率,就可以了
用voicereply把语音回复开关一下,然后设置个概率,就可以了
少放了两行报错(
ChatLearning ->voicereply 20
<-已设置语音回复的触发概率 20 %
[{'type': 'Plain', 'text': '不愧是我'}]Exception in thread Thread-2:
Traceback (most recent call last):
File "/usr/lib/python3.8/threading.py", line 932, in _bootstrap_inner
self.run()
File "/usr/lib/python3.8/threading.py", line 870, in run
self._target(*self._args, **self._kwargs)
File "/root/ChatLearning.Linux/ChatReply.py", line 248, in main
listening(data)
File "/root/ChatLearning.Linux/ChatReply.py", line 241, in listening
replyanswer(data, group, answer) # 让bot回复
File "/root/ChatLearning.Linux/ChatReply.py", line 185, in replyanswer
if getconfig(5)==1 and runchance(getconfig(6))==1:
File "/root/ChatLearning.Linux/ChatReply.py", line 123, in getconfig
voicereply=config['voicereply']
KeyError: 'voicereply'
我先去试试
报错代码如下: