Skip to content
This repository has been archived by the owner on Nov 11, 2022. It is now read-only.

Commit

Permalink
Version 1.8.0
Browse files Browse the repository at this point in the history
  • Loading branch information
alissonlauffer committed Apr 26, 2020
1 parent 98d9245 commit 837d0c6
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 3 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# amanobot changelog

## 1.8.0 (2020-04-26)
- Bot API 4.8
- Supported explanations for Quizzes 2.0. Add explanations by specifying the parameters `explanation` and `explanation_parse_mode` in the method `sendPoll`
- Supported the new darts animation for the dice mini-game. Choose between the default dice animation and darts animation by specifying the parameter `emoji` in the method `sendDice`
- Added the fields `explanation` and `explanation_entities` to the `Poll` object
- Supported timed polls that automatically close at a certain date and time. Set up by specifying the parameter `open_period` or `close_date` in the method `sendPoll`
- Added the fields `open_period` and `close_date` to the `Poll` object
- Added the missing `is_anonymous` field to the `Poll` object

## 1.7.1 (2020-04-06)
- Updated setup.py to include a Python version check
- Added a deprecation warning for users in Python 2 and <=3.4
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
</h6>
<h6 align="center">
<a href="https://pypi.org/project/amanobot"><img src="https://img.shields.io/pypi/v/amanobot.svg" /></a>
<a href="https://core.telegram.org/bots/api"><img src="https://img.shields.io/badge/bot api-v4.7-0688CB.svg" /></a>
<a href="https://core.telegram.org/bots/api"><img src="https://img.shields.io/badge/bot api-v4.8-0688CB.svg" /></a>
</h6>

### [Migrating from Telepot »](https://docs.amanobot.ml/en/latest/migrating-from-telepot.html)
Expand Down
6 changes: 5 additions & 1 deletion amanobot/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from . import exception


__version_info__ = (1, 7, 1)
__version_info__ = (1, 8, 0)
__version__ = '.'.join(map(str, __version_info__))

if sys.version_info <= (3, 4):
Expand Down Expand Up @@ -743,6 +743,9 @@ def sendPoll(self, chat_id, question, options,
type=None,
allows_multiple_answers=None,
correct_option_id=None,
explanation=None,
explanation_parse_mode=None,
open_period=None,
is_closed=None,
disable_notification=None,
reply_to_message_id=None,
Expand All @@ -752,6 +755,7 @@ def sendPoll(self, chat_id, question, options,
return self._api_request('sendPoll', _rectify(p))

def sendDice(self, chat_id,
emoji=None,
disable_notification=None,
reply_to_message_id=None,
reply_markup=None):
Expand Down
4 changes: 4 additions & 0 deletions amanobot/aio/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,9 @@ async def sendPoll(self, chat_id, question, options,
type=None,
allows_multiple_answers=None,
correct_option_id=None,
explanation=None,
explanation_parse_mode=None,
open_period=None,
is_closed=None,
disable_notification=None,
reply_to_message_id=None,
Expand All @@ -325,6 +328,7 @@ async def sendPoll(self, chat_id, question, options,
return await self._api_request('sendPoll', _rectify(p))

async def sendDice(self, chat_id,
emoji=None,
disable_notification=None,
reply_to_message_id=None,
reply_markup=None):
Expand Down
8 changes: 7 additions & 1 deletion amanobot/namedtuple.py
Original file line number Diff line number Diff line change
Expand Up @@ -305,13 +305,19 @@ def StickerArray(data):
'options',
'total_voter_count',
'is_closed',
'is_anonymous',
'type',
'allows_multiple_answers',
'correct_option_id'
'correct_option_id',
'explanation',
_Field('explanation_entities', constructor=MessageEntityArray),
'open_period',
'close_date'
])

# incoming
Dice = _create_class('Dice', [
'emoji',
'value'
])

Expand Down

0 comments on commit 837d0c6

Please sign in to comment.