Merge pull request #62 from meatjam/nonebot2_voice_bug_fixed

修复了在语音资源中存在,但在character.json中不存在的角色因获取不到别名而无法发送语音的问题
This commit is contained in:
惜月 2022-06-20 14:09:06 +08:00 committed by GitHub
commit 54d114d70f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -62,7 +62,7 @@ def create_guess_matcher(role_name, second, group_id):
return True return True
return False return False
alias_list = character_json[role_name] alias_list = character_json.get(role_name, [])
re_str = role_name + '|' + '|'.join(alias_list) re_str = role_name + '|' + '|'.join(alias_list)
guess_matcher = on_regex(re_str, temp=True, rule=Rule(check_group)) guess_matcher = on_regex(re_str, temp=True, rule=Rule(check_group))
guess_matcher.plugin_name = "Guess_voice" guess_matcher.plugin_name = "Guess_voice"