Why python does not ViDi a variable call?

Library telebot: https://github.com/eternnoir/pyTelegramBotAPI

elif message.text == "Directory":
 bot.send_message(message.chat.id "⬇app Directory games:", reply_markup=keyboard2)
 bot.register_next_step_handler(message catalog)

def catalog(message):
 if message.text == "Not found his game?":
 bot.send_message(message.chat.id "Contact support\podderjka 24/7 - @rozella_Pagac")
 elif message.text = = "⬅this Back":
 bot.send_message(message.chat.id, "Main menu", reply_markup=keyboard1)
 bot.register_next_step_handler(message, main)
else:
try:
 keyboard = types.InlineKeyboardMarkup()
 callback_button = types.InlineKeyboardButton(text="Buy", callback_data="test")
keyboard.add(callback_button)
 catalogvar = c.games_list.index(message.text)
 bot.send_photo(message.chat.id, c.games_photo[catalogvar], p.games_list[catalogvar] + "\price:: "+ str(c.games_price[catalogvar]) + "RUB", reply_markup=keyboard)
 if call.data == "test":
 bot.send_message(message.chat.id, "success")
 except ValueError:
 bot.send_message(message.chat.id, "not found")
 bot.register_next_step_handler(message catalog)


I wanted to make a inline button, but the problem with the variable call
April 7th 20 at 11:00
1 answer
April 7th 20 at 11:02
Solution
Most likely the call is not in scope.
Need the whole code to understand exactly
from time import sleep
import telebot
from telebot import *
import config as c
from config import *

token = c.token
bot = telebot.TeleBot(token)

keyboard1 = types.ReplyKeyboardMarkup(resize_keyboard=True)
keyboard1.row("Directory")
keyboard1.row("About", "Support")

keyboard2 = types.ReplyKeyboardMarkup(resize_keyboard=True)
keyboard2.row(c.games_list[0], c.games_list[1])
keyboard2.row(c.games_list[2], p.games_list[3])
keyboard2.row(c.games_list[4])
keyboard2.row(c.games_list[5])
keyboard2.row(c.games_list[6])
keyboard2.row(c.games_list[7])
keyboard2.row("'t found your game?", "⬅This back")

@bot.message_handler(commands=['start', 'help'])
def start_help(message):
 bot.send_message(message.chat.id, "Hello" + message.from_user.first_name, reply_markup=keyboard1)
pass

@bot.message_handler(content_types=['text'])
def main(message):
 if message.text = = "⬅this Back":
 bot.send_message(message.chat.id, "Main menu", reply_markup=keyboard1)
 elif message.text == "Directory":
 bot.send_message(message.chat.id "⬇app Directory games:", reply_markup=keyboard2)
 bot.register_next_step_handler(message catalog)
 elif message.text == "Support":
 bot.send_message(message.chat.id, "XXX")

def catalog(message):
 if message.text == "Not found his game?":
 bot.send_message(message.chat.id, "XXX")
 elif message.text = = "⬅this Back":
 bot.send_message(message.chat.id, "Main menu", reply_markup=keyboard1)
 bot.register_next_step_handler(message, main)
else:
try:
 keyboard = types.InlineKeyboardMarkup()
 callback_button = types.InlineKeyboardButton(text="Buy", callback_data="test")
keyboard.add(callback_button)
 catalogvar = c.games_list.index(message.text)
 bot.send_photo(message.chat.id, c.games_photo[catalogvar], p.games_list[catalogvar] + "\price:: "+ str(c.games_price[catalogvar]) + "RUB", reply_markup=keyboard)
 if call.data == "test":
 bot.send_message(message.chat.id, "success")
 except ValueError:
 bot.send_message(message.chat.id, "not found")
 bot.register_next_step_handler(message catalog)
- rozella_Pagac commented on April 7th 20 at 11:05
@rozella_Pagac, the catalog function only accepts 1 argument (message). But you yuzaesh and message and call - Jamil commented on April 7th 20 at 11:08
Thanks, fixed - rozella_Pagac commented on April 7th 20 at 11:11
@rozella_Pagac, well Done, work? - Cedrick_Goldn commented on April 7th 20 at 11:14
@Cedrick_Goldn, Yes - rozella_Pagac commented on April 7th 20 at 11:17
@rozella_Pagac, and what then the decision response will not celebrate? - Cedrick_Goldn commented on April 7th 20 at 11:20
@Cedrick_Goldn,

A guy goes to a meeting, late, nervous, can not find a place to Park. Raises face to the sky and says:
- Lord, help me to find a place to Park. I will quit drinking and going every Sunday to go to Church!
Miraculously appears a free place.
The man turns again to the sky:
- Oh, never mind. Found.
- Cara commented on April 7th 20 at 11:23

Find more questions by tags PythonBotsTelegram