from bot.bot import Bot
from bot.handler import MessageHandler
TOKEN = "" #your token here
bot = Bot(token=TOKEN)
def message_cb(bot, event):
bot.send_text(chat_id=event.from_chat, text=event.text)
bot.dispatcher.add_handler(MessageHandler(callback=message_cb))
bot.start_polling()
bot.idle()
The original example works nice. BUT if I rename bot to icq in message_cb function, then the bot does not send messages back to user. Other words, the code below does not work:
from bot.bot import Bot
from bot.handler import MessageHandler
TOKEN = "" #your token here
bot = Bot(token=TOKEN)
def message_cb(icq, event):
icq.send_text(chat_id=event.from_chat, text=event.text)
bot.dispatcher.add_handler(MessageHandler(callback=message_cb))
bot.start_polling()
bot.idle()
Hey
I took an example from documentation:
The original example works nice. BUT if I rename
bot
toicq
inmessage_cb
function, then the bot does not send messages back to user. Other words, the code below does not work:Why is it?