Skip to content

Commit 6331f5e

Browse files
author
Pietro Albini
committed
Fix User.send* methods not working (fixes #21)
1 parent 7062261 commit 6331f5e

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

botogram/objects/mixins.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,11 @@ def _get_call_args(self, reply_to, extra):
3030
reply_to = reply_to.message_id
3131

3232
# Get the correct chat_id
33-
chat_id = self.username if self.type == "channel" else self.id
33+
# There is an hasattr because User objects doesn't have any type
34+
if hasattr(self, "type"):
35+
chat_id = self.username if self.type == "channel" else self.id
36+
else:
37+
chat_id = self.id
3438

3539
args = {"chat_id": chat_id}
3640
if reply_to is not None:

0 commit comments

Comments
 (0)