G
G
Guerro692020-06-26 13:36:49
Python
Guerro69, 2020-06-26 13:36:49

How to get chat id from conversation id using regular expression?

I decided to write a bot in VK through another library, but its problem is that through the group you can get the conversation ID (peer_id) there, but you can’t get the chat_id there, and I need the chat_id, I thought that this can be implemented through a regular expression, but I have no idea how to do it, because the peer_id changes and can be different, here are examples of what I need to get from:

>> 2000000003 > 3
>> 2000000179 > 179
>> 2000000080 > 80
>> 2000000147 > 147

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Pankov, 2020-06-26
@Guerro69

Tin.

int('2000000179'[1:])
int('2000000003') - 2000000000

I decided to cut out my friend's appendicitis. I heard that it grows in the lower abdomen. Tell me, can you get it through your ass, if not, where to poke a knife?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question