TypeError: msg() missing 1 required positional argument

import schedule, time
from telebot import types
from threading import Thread

bot = telebot.TeleBot('****')


def send_msg(message):
    msg = f'{message.from_user.first_name} {message.from_user.last_name} this is test msg'
    bot.send_message(message.chat.id, msg)

def sch_msg():
    schedule.every(10).seconds.do(send_msg)

    while True:
        schedule.run_pending()
        time.sleep(1)

...


def main_loop():
    thread = Thread(target=sch_msg)
    thread.start()

    bot.polling(none_stop=True)


if __name__ == '__main__':
    main_loop()

При запуске получаю TypeError: msg() missing 1 required positional argument: 'message' Как заставить его работать?


Ответы (0 шт):