I copied this code from another thread as is, but was unable to get it to work...
from telegram.ext import Updater, CommandHandler, MessageHandler, Filters, InlineQueryHandler
def sayhi(bot, job):
job.context.message.reply_text("hi")
def time(bot, update,job_queue):
job = job_queue.run_repeating(sayhi, 5, context=update)
def main():
updater = Updater('BotKey')
dp = updater.dispatcher
dp.add_handler(MessageHandler(Filters.text , time,pass_job_queue=True))
updater.start_polling()
updater.idle()
if __name__ == '__main__':
main()
The Error I was give in my command terminal is:
TypeError: time() missing 1 required positional argument: 'job_queue'
I found this strange as I thought I already had set pass_job_queue=True...
(also, I did change the BotKey to the required key. I can get my bot to reply to texts but cant get it to periodically send stuff...)