So I have this code:
from random import choice
import schedule
import telebot
token = 'token'
bot = telebot.TeleBot(token)
@bot.message_handler(commands=['start'])
def start(message):
bot.send_message(message.chat.id, "Каждый час будет отправляться.")
@bot.message_handler(commands=['s'])
def time(message):
def time1(message):
a = [1,2,3,4,56,7,8,9,0,5,6,7,8,90]
q=[]
for i in range(10):
q1 = choice(a)
if q1 in q:
q.append("")
q.append(q1)
bot.send_message(message.chat.id, text=f"{q}")
print(len(q))
schedule.every(2).seconds.do(time1(message))
while True:
schedule.run_pending()
@bot.message_handler()
def any_message(message):
text = message.text
if text == '.':
time(message)
return
print('WE WORK')
bot.polling()
But when it has to go again I get this error. I tried many ways to solve it but nothing works. It starts from "schedule.every(2).seconds.do(time1(message))"
TypeError: the first argument must be callable