Please help me fix this bug in my Python code.
Error type: Update tool.init() got an unexpected argument of the keyword ‘token’
Code:
# Telegram Bot API
from telegram.text import Updater
updater = Updater(token='my bot token', context_user=True)
dispatcher = updater.dispatcher
I’ve tried different versions of the code, I can’t figure out what the error is.
2
Answers
Updater
class should be imported fromtelegram.ext
, nottext
python-bot-api
versions, remove thetoken=
partUpdater()
source code, there is no option calledcontext_user
, so remove that tootelegram-bot==3.2.0 package it working fine and passing token as following