From b2798e39a83cd8085983c7cbe7bc22b2e0ce0e2e Mon Sep 17 00:00:00 2001 From: Alex Root Junior Date: Sat, 5 Aug 2017 04:14:44 +0300 Subject: [PATCH] Fix send_file method for requests without files. (For e.g. setWebhook) --- aiogram/bot/base.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/aiogram/bot/base.py b/aiogram/bot/base.py index dba39d1d..bd70b4d4 100644 --- a/aiogram/bot/base.py +++ b/aiogram/bot/base.py @@ -151,7 +151,9 @@ class BaseBot: :param payload: request payload :return: resonse """ - if isinstance(file, str): + if file is None: + files = {} + elif isinstance(file, str): # You can use file ID or URL in the most of requests payload[file_type] = file files = None