From 54130d1f35f8e6f97e63620a2bd7c8fa45b7a1e5 Mon Sep 17 00:00:00 2001 From: mihalin Date: Thu, 16 Sep 2021 00:15:51 +0300 Subject: [PATCH] minor changes, auto-certificate --- server/server.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/server/server.py b/server/server.py index a44e7c2..8cf6925 100644 --- a/server/server.py +++ b/server/server.py @@ -31,7 +31,9 @@ async def register_token(bot: Bot) -> bool: a_bot = AioBot(bot.token) certificate = None if ServerSettings.use_custom_cert(): - certificate = ServerSettings.public_path() + with open(ServerSettings.public_path(), "r") as file: + certificate = file.read() + res = await a_bot.set_webhook(url_for_bot(bot), certificate=certificate) await a_bot.session.close() del a_bot