V
V
vkulik792020-05-02 14:34:32
Python
vkulik79, 2020-05-02 14:34:32

How to remove the peer_id from the database when the bot is excluded from the conversation?

How can you implement such a thing, when a bot is excluded from a conversation, it clears this conversation from the database? How to catch events if the bot is not in the conversation?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexander, 2020-05-02
@AlexMine

I can suggest this idea: once in a while you trigger some event in a conversation (through a bot), for example, reading the history of messages, if you catch an error that there are not enough rights or something similar, then look in the database for the peer_id of the conversation and delete all entries.

N
Nikolay, 2020-05-02
@SODINNER

Well, a simple task, if you can’t catch events in the conversation itself, you need to solve it in a different way, for example, as you were told above, check every n minutes for existence in the chat.
A programmer must not only be able to write code and know the syntax of the language, but also be able to think, design and think through at least to some extent the architecture of the program.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question