You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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()
Why is it?
The text was updated successfully, but these errors were encountered:
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?
The text was updated successfully, but these errors were encountered: