🐛 Fix error when log channel doesn't exist. (#138)

🐛 修复日志频道不存在时的报错。
This commit is contained in:
Xtao_dada 2021-10-16 21:54:45 +08:00 committed by GitHub
parent cfb45e4724
commit 173c9b8db7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -344,7 +344,10 @@ async def log(message):
)
if not strtobool(config['log']):
return
await bot.send_message(
int(config['log_chatid']),
message
)
try:
await bot.send_message(
int(config['log_chatid']),
message
)
except ValueError:
pass