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

Commit

Permalink
Add support for media editing
Browse files Browse the repository at this point in the history
  • Loading branch information
alissonlauffer committed Nov 14, 2019
1 parent 5c5b695 commit c65b707
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 7 deletions.
13 changes: 10 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
# amanobot changelog

## 1.4.4 (2019-11-13)
- Hotfix for asyncio version failing to start

## 1.4.3 (2019-11-13) - Removed
- Added support for the `thumb` parameter in media Senders (`sendAudio`, `sendDocument`, etc)
- Added support for media editing using the `editMessageMedia` method

## 1.4.2 (2019-11-13)
- Allow raising KeyboardInterrupt on `run_forever()` (aka blocking loop)

## 1.4.1 (2019-11-05)
- Add missing permissions to restrictChatMember on the asyncio variant
- Add missing permissions to restrictChatMember on the asyncio variant.
- Now we offer wheel releases too

## 1.4.0 (2019-07-29)
Expand All @@ -14,7 +21,7 @@
- Added the `ChatPermissions` object.
- Removed the `all_members_are_administrators` field from the `Chat` object.
- Added the `permissions` field tp the `Chat` object
- Added the `is_animated` field to the `Sticker` and `StickerSet` objects.
- Added the `is_animated` field to the `Sticker` and `StickerSet` objects

## 1.3.0 (2019-06-01)
- Bot API 4.3
Expand All @@ -40,7 +47,7 @@

- Bot API 4.1 (complete)
- Fix `InputMediaAnimation`
- Add types `InputMediaAudio` and `ÌnputMediaDocument`
- Add types `InputMediaAudio` and `InputMediaDocument`
- Added `vcard` to the objects `Contact`, `InlineQueryResultContact`, `InputContactMessageContent` and the method `sendContact`

## 1.0 (2018-09-20)
Expand Down
10 changes: 7 additions & 3 deletions amanobot/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
from . import exception


__version_info__ = (1, 4, 2)
__version_info__ = (1, 4, 4)
__version__ = '.'.join(map(str, __version_info__))


Expand Down Expand Up @@ -990,9 +990,13 @@ def editMessageMedia(self, msg_identifier, media,
:param msg_identifier: Same as ``msg_identifier`` in :meth:`amanobot.Bot.editMessageText`
"""
p = _strip(locals(), more=['msg_identifier'])
p = _strip(locals(), more=['msg_identifier', 'media'])
p.update(_dismantle_message_identifier(msg_identifier))
return self._api_request('editMessageMedia', _rectify(p))

legal_media, files_to_attach = _split_input_media_array([media])
p['media'] = legal_media[0]

return self._api_request('editMessageMedia', _rectify(p), files_to_attach)

def editMessageReplyMarkup(self, msg_identifier,
reply_markup=None):
Expand Down
2 changes: 1 addition & 1 deletion amanobot/aio/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ async def handle(self, msg):
async def _api_request(self, method, params=None, files=None, **kwargs):
return await api.request((self._token, method, params, files), **kwargs)

def _api_request_with_file(self, method, params, files, **kwargs):
async def _api_request_with_file(self, method, params, files, **kwargs):
params.update({
k: v for k, v in files.items() if _isstring(v)})

Expand Down

0 comments on commit c65b707

Please sign in to comment.