Answer the question
In order to leave comments, you need to log in
Cycle of sending sqlite3 database users a message to everyone except telebot?
What is the question ...
Before that, I wrote code with entering user ids via set (), but now I changed it so that all users are added to the list of the sqlite3 table. I
didn’t change the code much, I just added the code to sqlite3:
def selectuser(self, chat_id):
with self.connection:
return self.cursor.execute("SELECT * FROM `userchat` WHERE `chat_id` = ?", (chat_id,)).fetchall()
userchat = db.selectuser(message.from_user.id)
for user in users:
if user != message.from_user.id:
bot.send_message(user, message.text)
print(message)
bot.send_message(message.from_user.id, "Сообщение отправлено!")
2022-03-12 13:23:04,139 (__init__.py:688 MainThread) ERROR - TeleBot: "A request to the Telegram API was unsuccessful. Error code: 400. Description: Bad Request: chat not found"
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question