-
-
Notifications
You must be signed in to change notification settings - Fork 133
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Checklist
- I believe the idea is awesome and would benefit the framework
- I have searched in the issue tracker for similar requests, including closed ones
Description
You can do it another way to recognize what kind of id it is. Instead of updating the range, since the user id is always positive, the group id always starts with -100, it's easier to do the logic
def get_peer_type(peer_id: int) -> str:
peer_id_str = str(peer_id)
if not peer_id_str.startswith("-"):
return "user"
elif peer_id_str.startswith("-100"):
return "channel"
else:
return "chat"
LISA-KOREA and WubbaLubbaDubDubDevSpEcHiDe
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request