Код: Выделить всё
def step5(message):
global p
conn = sqlite3.connect('../chatgpt_database.db')
cursor = conn.cursor()
cursor.execute("SELECT tid FROM Users")
massive_big = cursor.fetchall()
sss = [ ]
sss = []
for photo in photos:
if '.jpg' in photo:
sss.append(telebot.types.InputMediaPhoto(open(photo, 'rb'), caption=txt))
else:
sss.append(telebot.types.InputMediaVideo(open(photo, 'rb'), caption=txt))
for z in range(len(massive_big)):
# try:
if not p:
botspam.send_message(int(massive_big[z][0]), txt)
else:
botspam.send_media_group(int(massive_big[z][0]), sss)
# except:
# print(-1)
p = True
bot.send_message(message.chat.id, "Отправка окончена, для новой рассылки нажми /start")
Код: Выделить всё
telebot.apihelper.ApiTelegramException: A request to the Telegram API was unsuccessful. Error code: 400. Description: Bad Request: chat not found
Код: Выделить всё
if not p:
botspam.send_message(int(massive_big[z][0]), txt)
else:
botspam.send_media_group(int(massive_big[z][0]), sss)
Подробнее здесь: https://stackoverflow.com/questions/792 ... t-is-there