We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ac9fedc commit 86273b4Copy full SHA for 86273b4
1 file changed
main.py
@@ -1,3 +1,5 @@
1
+from operator import index
2
+
3
from vk_api.longpoll import VkLongPoll, VkEventType
4
from vk_api.utils import get_random_id
5
import vk_api
@@ -68,7 +70,11 @@ def resolve_entity(entity_id: int | str) -> dict:
68
70
return {}
69
71
72
def get_numeric_entity_id(entity_id: str) -> int:
- entity_id = entity_id.strip().replace("@id", "").replace("@", "")
73
+ entity_id = entity_id.lstrip()
74
+ if "|" in entity_id:
75
+ entity_id = entity_id[1:entity_id.index("|")]
76
+ if entity_id.startswith("id"):
77
+ entity_id = entity_id.replace("id", "")
78
if entity_id.isdigit() or is_negative(entity_id):
79
return int(entity_id)
80
entity_info = resolve_entity(entity_id)
0 commit comments