NxCreateDocs

The Bot Object

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

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.

How did this page feel?

Quick feedback helps improve the docs.

Last updated March 22, 2026
NxCreator, Inc.
Build and operate Telegram bots with a managed runtime.