From 734623ae716f8cdc110232f8fb41b80448c1ba92 Mon Sep 17 00:00:00 2001 From: t0rr Date: Fri, 17 Aug 2018 12:18:22 +0300 Subject: [PATCH 1/4] #65 bug fix with no proxy_auth --- aiogram/bot/base.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/aiogram/bot/base.py b/aiogram/bot/base.py index e37f1923..e3a78054 100644 --- a/aiogram/bot/base.py +++ b/aiogram/bot/base.py @@ -63,9 +63,11 @@ class BaseBot: from aiohttp_socks.helpers import parse_socks_url socks_ver, host, port, username, password = parse_socks_url(proxy) - if proxy_auth and not username or password: - username = proxy_auth.login - password = proxy_auth.password + if proxy_auth: + if not username: + username = proxy_auth.login + if not password: + password = proxy_auth.password connector = SocksConnector(socks_ver=socks_ver, host=host, port=port, username=username, password=password, From ace61f0dd8b572db6e055b6f426acc1a59f57627 Mon Sep 17 00:00:00 2001 From: Kolay Date: Fri, 17 Aug 2018 14:24:28 +0300 Subject: [PATCH 2/4] updated py version --- README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.rst b/README.rst index 57a18bc7..3e10a3b9 100644 --- a/README.rst +++ b/README.rst @@ -30,7 +30,7 @@ AIOGramBot :alt: MIT License -**aiogram** is a pretty simple and fully asynchronous library for `Telegram Bot API `_ written in Python 3.6 with `asyncio `_ and `aiohttp `_. It helps you to make your bots faster and simpler. +**aiogram** is a pretty simple and fully asynchronous library for `Telegram Bot API `_ written in Python 3.7 with `asyncio `_ and `aiohttp `_. It helps you to make your bots faster and simpler. You can `read the docs here `_. From 339dcacd82ad478fc8b7370c9574eda4cc016f82 Mon Sep 17 00:00:00 2001 From: Kolay Date: Fri, 17 Aug 2018 14:25:11 +0300 Subject: [PATCH 3/4] updated py version too --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 1bc5260f..208ce568 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ [![Github issues](https://img.shields.io/github/issues/aiogram/aiogram.svg?style=flat-square)](https://github.com/aiogram/aiogram/issues) [![MIT License](https://img.shields.io/pypi/l/aiogram.svg?style=flat-square)](https://opensource.org/licenses/MIT) -**aiogram** is a pretty simple and fully asynchronous library for [Telegram Bot API](https://core.telegram.org/bots/api) written in Python 3.6 with [asyncio](https://docs.python.org/3/library/asyncio.html) and [aiohttp](https://github.com/aio-libs/aiohttp). It helps you to make your bots faster and simpler. +**aiogram** is a pretty simple and fully asynchronous library for [Telegram Bot API](https://core.telegram.org/bots/api) written in Python 3.7 with [asyncio](https://docs.python.org/3/library/asyncio.html) and [aiohttp](https://github.com/aio-libs/aiohttp). It helps you to make your bots faster and simpler. You can [read the docs here](http://aiogram.readthedocs.io/en/latest/). From 9a042716d13c0ad10e08495c5277cd69750bea54 Mon Sep 17 00:00:00 2001 From: heyyyoyy Date: Sun, 2 Sep 2018 17:46:05 +0300 Subject: [PATCH 4/4] fixed update_data and update_bucket methods if dict is None --- aiogram/contrib/fsm_storage/redis.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/aiogram/contrib/fsm_storage/redis.py b/aiogram/contrib/fsm_storage/redis.py index eaaf3985..d4c2bba2 100644 --- a/aiogram/contrib/fsm_storage/redis.py +++ b/aiogram/contrib/fsm_storage/redis.py @@ -141,6 +141,8 @@ class RedisStorage(BaseStorage): async def update_data(self, *, chat: typing.Union[str, int, None] = None, user: typing.Union[str, int, None] = None, data: typing.Dict = None, **kwargs): + if data is None: + data = {} record = await self.get_record(chat=chat, user=user) record_data = record.get('data', {}) record_data.update(data, **kwargs) @@ -195,6 +197,8 @@ class RedisStorage(BaseStorage): bucket: typing.Dict = None, **kwargs): record = await self.get_record(chat=chat, user=user) record_bucket = record.get('bucket', {}) + if bucket is None: + bucket = {} record_bucket.update(bucket, **kwargs) await self.set_record(chat=chat, user=user, state=record['state'], data=record_bucket, bucket=bucket)