mirror of
https://github.com/PaiGramTeam/GramCore.git
synced 2024-11-22 14:27:18 +00:00
19 lines
429 B
Python
19 lines
429 B
Python
from typing import TYPE_CHECKING
|
|
|
|
if TYPE_CHECKING:
|
|
from telegram import Update
|
|
|
|
|
|
class GetRealUserName:
|
|
@staticmethod
|
|
def get_real_user_name(
|
|
update: "Update",
|
|
) -> str:
|
|
user = update.effective_user
|
|
message = update.effective_message
|
|
if message:
|
|
channel = message.sender_chat
|
|
if channel:
|
|
return channel.title
|
|
return user.first_name
|