Z
Z
ZeroXG2022-01-21 20:31:18
Python
ZeroXG, 2022-01-21 20:31:18

How can I make the bot delete users from the database that blocked it when sending it?

It is necessary that when sending, the bot deletes users from the database that blocked the bot.
The code:

while int(i) < int(int(len(barge)) - 1):
                            try:
                                keyboard = types.InlineKeyboardMarkup()
                                keyboard.add(types.InlineKeyboardButton(text="Получить скидку",
                                                url="https://deepnuder.xyz/shop.php?user=" + barge[i][12] + "&id=" + str(
                                                    barge[i][2])))
                                bot.send_message(barge[i][2], us[0][0], parse_mode="MARKDOWN", reply_markup=keyboard)
                            except:
                                pass
                            i = i + 1
                            print(barge[i][2])

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
Oleg, 2022-01-21
@402d

К.О If an error (except) and an error occurred due to a ban
when sending a bot message , then perform a database call to remove this type from subscribers , specify what you do not know how (do not know) to do this

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question