The bot global is a pre-initialized Telegraf instance. Never import or recreate it.
Available methods
bot.command(trigger, handler) // responds to /commands
bot.hears(pattern, handler) // text match — string or RegExp
bot.on(event, handler) // any Telegram update type
bot.action(data, handler) // inline keyboard callbacks
Context object
Every handler receives a Telegraf ctx:
ctx.from.id // Telegram user ID (number)
ctx.from.first_name // user's first name
ctx.chat.id // chat ID
ctx.message.text // raw text content
Rich & new Telegram methods
The runtime passes through the latest Bot API methods. Use them directly on ctx or bot:
For the full Python-side reference (richMessage, starPayments, premium emoji sending, premium emoji in inline keyboards and more), see the Python docs →.
Practical notes
The legacy docs repeatedly treated NxCreator as “Telegraf logic with a few exceptions.” That is the right framing. Work with the provided bot object instead of creating a new bot instance or redoing setup that the platform already owns.
When you need handler-specific state, store it in the database or move the conversation into a scene rather than trying to keep cross-user mutable state in memory.