When I run this code:
from telegram.ext import *
import keys
print('Starting a bot....')
def start_commmand(update, context):
update.message.reply_text('Hello! Welcome To Store!')
if __name__ == '__main__':
updater = Updater(keys.token, True)
dp = updater.dispatcher
# Commands
dp.add.handler(CommandHandler('start', start_commmand))
# Run bot
updater.start_polling(1.0)
updater.idle()
I get this error:
Traceback (most recent call last):
File "C:\Users\pc\PycharmProjects\telegram\main.py", line 11, in <module>
dp = updater.dispatcher
AttributeError: 'Updater' object has no attribute 'dispatcher'
I attempted to resolve this issue by updating the library but the error remained.