-
Notifications
You must be signed in to change notification settings - Fork 76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Several improvement about supergroup and channel #61
Conversation
@@ -41,12 +42,19 @@ def fix_message(message): | |||
|
|||
|
|||
def fix_peer(peer): | |||
# rename peer_type => type | |||
if peer["peer_type"]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To check for existence too, use
if "peer_type" in peer and peer["peer_type"]:
That above only checks the value of that attribute.
It will fail, if there is no "peer_type"
key.
Wow, looking good. |
@@ -134,6 +134,7 @@ | |||
# functions["channel_set_admin"] = ("channel_set_admin", <channel> <admin> <type> Sets channel admin. 0 - not admin, 1 - moderator, 2 - editor |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe you can have a look at this old line here, while your on it.
I wonder why channel_set_admin
is not implemented.
I test it in Python 3.5.1 |
Thanks! Also don't miss my comment added above |
I am gonna Merge this. In case something fails we should just open a new issue. |
@@ -85,6 +85,12 @@ def parse(self, value): | |||
return super(User, self).parse(value) | |||
|
|||
|
|||
class Channel(Peer): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a duplicate of line 100...?
Will fix this.
And it is in Version 0.4.6 |
Summary:
Adds
Sender.channel_rename(...)
,a
Channel
argument type,and fixes for the related dict entries (
fix_message
andfix_peer
).Original Pull Request by @huiyiqun:
I have written a tg-based bot with your project.
In order to work with supergroup, I compiled the telegram-cli from the test branch and fix some problem of pytz. What's more, some missing features are added.
I'm glad if these code help.