Commit 001dcfd
fix: create_poll and get_full_chat on basic groups
Two failures left over from the telethon 1.44 bump (#148).
create_poll raised "Poll.__init__() missing 1 required positional
argument: 'hash'" for every call. 1.44 made `hash` required; a poll
being created has no cached server results, so send 0.
get_full_chat raised "Cannot cast InputPeerChat to any kind of
InputChannel" for basic (non-supergroup) groups, because it always
issued channels.GetFullChannelRequest. Route basic groups to
messages.GetFullChatRequest. ChatFull has no participants_count, so
derive it from the member list; channels are unaffected.
Verified against a live account: basic group returns
{"title": "...", "participants_count": 3}, a channel is unchanged,
and create_poll posts a working poll.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>1 parent 89d6bad commit 001dcfd
2 files changed
Lines changed: 24 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
735 | 735 | | |
736 | 736 | | |
737 | 737 | | |
738 | | - | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
| 743 | + | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
739 | 747 | | |
740 | 748 | | |
741 | 749 | | |
742 | 750 | | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
743 | 759 | | |
744 | 760 | | |
745 | 761 | | |
746 | 762 | | |
747 | | - | |
748 | | - | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
749 | 767 | | |
750 | 768 | | |
751 | 769 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1542 | 1542 | | |
1543 | 1543 | | |
1544 | 1544 | | |
| 1545 | + | |
| 1546 | + | |
| 1547 | + | |
1545 | 1548 | | |
1546 | 1549 | | |
1547 | 1550 | | |
| |||
0 commit comments