Python Bots

Build Telegram bots in Python with the NxCreator Python runtime.

Python bots on NxCreator

NxCreator supports Python bots in addition to JavaScript. Python bots run in an isolated sandbox with a curated set of standard-library modules and a Telegraf-like bot API. Use the dashboard to create a Python bot and write handlers in the Python editor.

Runtime & sandbox

Python code executes in a locked-down worker: no network access, no host filesystem, uid 65534, seccomp-filtered syscalls, and a RestrictedPython layer. All outside-world actions go through an allowlisted RPC bridge (data, Telegram, HTTP, broadcast, webhook).

Rich & new Telegram methods

The Python runtime exposes the latest Bot API features:

  • richMessage / rich message sending — formatted text with entities, media and reply markup.
  • starPayments — create invoices in Telegram Stars (XTR) and handle pre-checkout queries.
  • Premium emoji sending — send messages containing premium (custom) emoji entities.
  • Premium emoji in inline keyboards — use premium emoji in button labels.
  • Inline keyboards, callbacks, scenes, database, HTTP, broadcast, webhook URLs — all available.
# Premium emoji in a message
bot.reply("Hello 👋", parse_mode="HTML")

# Star payment invoice
bot.send_invoice(chat_id, title="Pro plan", description="Monthly",
                 payload="pro-monthly", currency="XTR",
                 prices=[{"label": "Pro", "amount": 100}])

# Inline keyboard with premium emoji button
bot.send_message(chat_id, "Pick one:", reply_markup={
  "inline_keyboard": [[{"text": "⭐ Premium", "callback_data": "premium"}]]
})

Full Python reference

For the complete Python handler reference (commands, scenes, database, Telegram methods, sandbox limits), open the dedicated Python docs:

Open the Python docs →

PREVIOUS
How It Works
NEXT
App Elements
Was this page helpful?
Last updated March 22, 2026