From 173c9b8db714349b539da294283d9db8438eb0ba Mon Sep 17 00:00:00 2001 From: Xtao_dada Date: Sat, 16 Oct 2021 21:54:45 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Fix=20error=20when=20log=20chann?= =?UTF-8?q?el=20doesn't=20exist.=20(#138)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 🐛 修复日志频道不存在时的报错。 --- pagermaid/__init__.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/pagermaid/__init__.py b/pagermaid/__init__.py index fd695bb..4de725a 100644 --- a/pagermaid/__init__.py +++ b/pagermaid/__init__.py @@ -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