Skip to content

Commit

Permalink
Fix sending messages to supergroups in Bot.send()
Browse files Browse the repository at this point in the history
Fixes: GH-74
  • Loading branch information
thesharp authored and Pietro Albini committed Aug 9, 2016
1 parent 6464e8c commit 57dffea
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions botogram/frozenbot.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,12 +276,7 @@ def hide_commands(self):
@utils.deprecated("Bot.%s()" % _proxy.__name__, "1.0",
"Use Bot.chat(id).%s() instead." % _proxy.__name__)
def _wrapper(self, chat, *args, __proxy=_proxy, **kwargs):
# String chats are channels
if type(chat) == str:
obj = objects.Chat({"id": 0, "type": "channel", "username": chat},
self.api)
else:
obj = objects.Chat({"id": chat, "type": ""}, self.api)
obj = self.chat(chat)

return __proxy(obj, *args, **kwargs)

Expand Down

0 comments on commit 57dffea

Please sign in to comment.