I am trying to get my bot to send a message to the user periodically but I'm getting the error below. What am I doing wrong?
code:
import telegram.ext
from telegram.ext import Updater
from telegram.ext import CommandHandler
def callback_minute(update: telegram.Update, context: telegram.ext.CallbackContext):
context.bot.send_message(chat_id= update.effective_chat.id,
text='One message every minute')
def main():
u = Updater('TOKEN', use_context=True)
j = u.job_queue
job_minute = j.run_repeating(callback_minute, interval=60, first=0)
u.start_polling()
main()
Error:
TypeError: callback_minute() missing 1 required positional argument: 'context'