Skip to content
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

Add t.me links for User, Chat and Message if available and update User.mention_* #1092

Merged
merged 38 commits into from May 9, 2018
Merged
Changes from 1 commit
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
54ea342
Add User.link and update User.mention_*
Tr-Jono Apr 27, 2018
0f4f695
Add Chat.link
Tr-Jono Apr 27, 2018
466eaa2
Add Message.link
Tr-Jono Apr 27, 2018
7986c74
Merge pull request #1 from Tr-Jono/Tr-Jono-patch-1
Tr-Jono Apr 27, 2018
820c0e2
Tiny modification
Tr-Jono Apr 27, 2018
5069b0e
Merge pull request #2 from Tr-Jono/Tr-Jono-patch-1-1
Tr-Jono Apr 27, 2018
b584bba
Merge pull request #3 from Tr-Jono/Tr-Jono-patch-1-2
Tr-Jono Apr 27, 2018
80a140e
Fixed nub mistakes I made
Tr-Jono Apr 27, 2018
aca6eda
Fixed mistakes I made when I was fixing mistakes
Tr-Jono Apr 27, 2018
ed52057
Link returns None on default
Tr-Jono Apr 30, 2018
af8e909
Link returns None on default
Tr-Jono Apr 30, 2018
27cbdbf
Link returns None on default
Tr-Jono Apr 30, 2018
e18d076
Update chat.py
Tr-Jono Apr 30, 2018
a2247b6
Fixed link and it returns None on default
Tr-Jono Apr 30, 2018
aff64c3
Ooooooops
Tr-Jono Apr 30, 2018
2016e75
Reverted Indent
Tr-Jono Apr 30, 2018
5d45047
Update user.py
Tr-Jono Apr 30, 2018
41f697e
Update message.py
Tr-Jono Apr 30, 2018
1d622fe
Add the blank lines
Tr-Jono Apr 30, 2018
dfae43b
Add https
Tr-Jono May 7, 2018
38a1c12
Update chat.py
Tr-Jono May 7, 2018
86df641
Add https
Tr-Jono May 7, 2018
3db087a
Add test link
Tr-Jono May 7, 2018
c844562
Add test link
Tr-Jono May 7, 2018
cf0da15
Add test_link
Tr-Jono May 8, 2018
3915bc5
Mistakes fixed
Tr-Jono May 8, 2018
c5e8576
Update test_chat.py
Tr-Jono May 8, 2018
6a49537
Fixed "trailing whitespace"
Tr-Jono May 8, 2018
f0c45fc
Fixed "line too long"
Tr-Jono May 8, 2018
03aa149
Fixed whitespace mistakes
Tr-Jono May 8, 2018
0689616
Chat could be private/channel too so should not force check supergrou…
jeffffc May 9, 2018
9f336db
Merge pull request #4 from jeffffc/jono2
Tr-Jono May 9, 2018
a8d8ac0
fix docstrings blank lines
jeffffc May 9, 2018
90d31ea
Merge pull request #5 from jeffffc/jono2
Tr-Jono May 9, 2018
c0a254e
fix docstrings whitespaces in blank lines
jeffffc May 9, 2018
e2bc04b
Merge pull request #6 from jeffffc/jono2
Tr-Jono May 9, 2018
ac13a76
Merge branch 'master' into 1092master
Eldinnie May 9, 2018
e2b4424
Some small fixes
Eldinnie May 9, 2018
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.
+3 −2
Diff settings

Always

Just for now

Fixed link and it returns None on default

  • Loading branch information...
Tr-Jono committed Apr 30, 2018
commit a2247b67e2e16392577ce48b53ffaf9d52c86830
@@ -309,8 +309,9 @@ def link(self):
:obj:`str`: Convenience property. If the chat of the message is a supergroup and has a
:attr:`username`, returns a t.me link of the message.
"""
if self.chat.type = "supergroup" and self.chat.username:
return "t.me/{}".format(self.usermame)
if self.chat.type == Chat.SUPERGROUP and self.chat.username:
return "t.me/{}/{}".format(self.chat.usermame, self.message_id)
return None

@classmethod
def de_json(cls, data, bot):
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.