Fix .who in private and reoder admin title
This commit is contained in:
parent
95d95701ea
commit
b6a67cf5f2
|
@ -10,10 +10,10 @@ from telethon.tl import types, functions
|
||||||
|
|
||||||
def get_who_string(who, rank=None):
|
def get_who_string(who, rank=None):
|
||||||
who_string = html.escape(utils.get_display_name(who))
|
who_string = html.escape(utils.get_display_name(who))
|
||||||
if isinstance(who, (types.User, types.Channel)) and who.username:
|
|
||||||
who_string += f" <i>(@{who.username})</i>"
|
|
||||||
if rank is not None:
|
if rank is not None:
|
||||||
who_string += f' <i>"{html.escape(rank)}"</i>'
|
who_string += f' <i>"{html.escape(rank)}"</i>'
|
||||||
|
if isinstance(who, (types.User, types.Channel)) and who.username:
|
||||||
|
who_string += f" <i>(@{who.username})</i>"
|
||||||
who_string += f", <a href='tg://user?id={who.id}'>#{who.id}</a>"
|
who_string += f", <a href='tg://user?id={who.id}'>#{who.id}</a>"
|
||||||
return who_string
|
return who_string
|
||||||
|
|
||||||
|
@ -31,8 +31,10 @@ async def _(event):
|
||||||
msg.forward.from_id or msg.forward.channel_id)
|
msg.forward.from_id or msg.forward.channel_id)
|
||||||
else:
|
else:
|
||||||
who = await msg.get_sender()
|
who = await msg.get_sender()
|
||||||
|
ic = await event.get_input_chat()
|
||||||
|
if isinstance(ic, types.InputPeerChannel):
|
||||||
rank = getattr((await borg(functions.channels.GetParticipantRequest(
|
rank = getattr((await borg(functions.channels.GetParticipantRequest(
|
||||||
await event.get_input_chat(),
|
ic,
|
||||||
who
|
who
|
||||||
))).participant, 'rank', None)
|
))).participant, 'rank', None)
|
||||||
|
|
||||||
|
|
Reference in New Issue