Claude and OpenAI are useful for NxCreate only when you stop asking them for a normal Telegram bot project. NxCreate is already the runtime. You need editor-ready handler code, not a new Telegraf app with imports, launch code, package setup, or MongoDB connection boilerplate.
The simplest workflow is to give the model a strict NxCreator prompt first, then ask for one feature at a time. That keeps the answer inside NxCreator syntax and makes the code easier to review before you paste it into the editor.
Download the NxCreator AI prompt
Use this prompt before asking Claude or OpenAI to write NxCreator bot code. It tells the assistant how NxCreator works and what syntax to avoid.
Download prompt.mdWhat to tell the AI
Be direct about the runtime. Tell it that bot, db, axios, logic, persistentScheduler, persistentCron, and registerPersistentTask already exist. Also tell it not to use require, import, new Telegraf, bot.launch, Express, dotenv, sessions, Markup, or manual MongoDB connections.
- Ask for “NxCreator-compatible code”, not “a Telegram bot app”.
- Request one feature block at a time: menu, admin command, scene, payment callback, or webhook.
- Tell it to use plain reply_markup objects for keyboards.
- Tell it to keep secrets in process.env and avoid hardcoded tokens.
A short prompt that works
If you do not want to paste the full prompt file every time, start with this shorter version and then describe the feature you need.
Use this context first:
I am building inside NxCreator. Do not use require, import, new Telegraf, bot.launch, Express, dotenv, sessions, or manual MongoDB connections. Use the existing bot, db, axios, logic, persistentScheduler, persistentCron, and registerPersistentTask globals. Write code that can be pasted directly into NxCreator.Give database guidance early
Most bad AI output for NxCreate comes from database assumptions. Tell the model to use the existing db global. Use props for simple per-user values and collections for records like orders, payments, tickets, or referrals.
const userId = ctx.from.id
const balance = Number(await db.getProp(userId, 'balance') || 0)
await db.setProp(userId, 'balance', balance + 10)
await db.collection('orders').insertOne({
userId,
item: 'starter-plan',
status: 'pending',
createdAt: Date.now()
})Review fast before saving
Before saving, search the answer for require, import, launch, session, MongoClient, mongoose, express, dotenv, process.on, and process.once. If any appear, ask the model to rewrite only that part for NxCreator.
- Callback handlers should call ctx.answerCbQuery.
- Admin actions should verify ctx.from.id.
- API calls, payment checks, and database writes should use try/catch.
- Scenes should use answerHandler, not Stage or WizardScene.
Claude or OpenAI?
Use either. Claude is comfortable with longer rewrites. OpenAI is strong for debugging and compact feature blocks. For NxCreate, the bigger difference is not the model name; it is whether the model knows the runtime rules before it writes code.
A useful loop is: prompt the model, ask for one feature, paste it into a temporary section, run the bot, check logs, then ask for a small correction. Avoid regenerating the whole bot unless you are intentionally restructuring it.
AI is fastest in NxCreate when it writes inside the runtime you actually use, not the runtime it assumes you are using.