H
H
Python

Error Undefined variable 'message' please tell me, when writing a bot, it comes out like this, what's the matter ??

import telebot

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


@bot.message_handler(commands=['Start','Calculator'])
def getMessege(Messege):
    bot.send_message(message.from_user.id, 'Привет!')

bot.polling(none_stop=False,interval=0)

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sergey Gornostaev, 2020-06-30
@JustGoodMan

In Python, case matters:
def getMessege(message):

L
lleballex, 2020-06-30
@lleballex

What is your Message:

def getMessege(Messege):
    ...

Write in small letters:
def getMessege(messege):
    ...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question