i am trying to create a telegram bot and its having issues
import os
import telebot
my_secret = os.environ['Example']
@bot.message_handler(command=['Greet'])
def greet(message):
bot.reply_to(message, "Hey! Hows it going?")
bot.polling()
i am trying to create a telegram bot and its having issues
import os
import telebot
my_secret = os.environ['Example']
@bot.message_handler(command=['Greet'])
def greet(message):
bot.reply_to(message, "Hey! Hows it going?")
bot.polling()
As stated in the error you haven't defined
botbefore using that variable. If you check the offical docs of pyTelegramBotAPI, even the example shows how to start by definingbot(https://pypi.org/project/pyTelegramBotAPI/):