- Owner: Kaung Khant Ko
- Developer: Kaung Khant Ko
- License: MIT
- Public repo setup: use
.env.examplefor GitHub and keep your real.envprivate
CookAI is a Telegram AI assistant with a split admin system:
- a user-facing chatbot
- a separate admin Telegram bot
- a web admin dashboard
It uses OpenRouter for AI responses, supports login-based access control, and includes practical tools for writing, analysis, productivity, study, business planning, PDF export, and QR generation.
- login-gated user access with one-time hashes
- separate admin dashboard bot for user control
- web dashboard for browser-based monitoring and admin actions
- plain-text AI replies without Markdown formatting in bot output
- short conversation memory with tone and persona preferences
- file and photo analysis
- PDF generation and web-page-to-PDF export
- rewrite, summarize, translate, and grammar tools
- reminders, todos, ideas, and notes
- social media content tools
- study tools
- business helper tools
- QR code generation
- handles normal chat and productivity features
- shows only limited commands before login
- supports approved users after access is granted
- creates login hashes
- monitors user activity
- approves, blocks, and unblocks users
- sends direct replies to users through the bot
- browser-based admin panel
- password protected
- shows user status and recent activity
- supports approve, block, unblock, hash creation, and direct replies
bot.py- main user botadmin_bot.py- admin Telegram dashboard botdashboard.py- web admin dashboard.env.example- public-safe environment template for GitHub.env- local-only secrets and runtime configuration, do not uploadrequirements.txt- Python dependenciesecosystem.config.js- PM2 process configurationLICENSE- MIT license
python3 -m venv .venv
source .venv/bin/activate
cp .env.example .env
pip install -r requirements.txt
python bot.pypython3 -m venv .venv
source .venv/bin/activate
cp .env.example .env
pip install -r requirements.txt
pm2 start ecosystem.config.js
pm2 save
pm2 startup/start- confirm the bot is online/help- show commands/login <hash>- log in with a one-time access hash from the admin/menu- show the main organized button menu/menu more- show more tools in the button menu/hidebuttons- hide the button keyboard/reset- clear conversation memory and return to normal chat mode/english- switch replies back to normal English mode/burmese- switch replies into Burmese mode/burmese <message>- reply in smoother Burmese immediately/persona <mode>- set a reusable mode like coach, teacher, marketer, coder/persona off- clear the saved persona/tone <text>- save a tone sample and reuse it in future replies/tone off- clear the saved tone sample/note <text>- save a quick note/note- reply to text to save it as a note/notes- list saved notes/notes delete <id>- delete a saved note/rewrite- rewrite replied or inline text/analyze- analyze a replied photo or file/analyze <question>- analyze a replied photo or file with a specific instruction/pdf- turn a replied message or the last bot reply into a PDF/pdf <text or topic>- create a PDF from direct text or a short document request/webpdf <url>- turn a web page into a summary PDF/caption- create a social media caption/hook- create hook lines/carousel- create a carousel content outline/script- create a short video or reel script/cta- create call-to-action lines/hashtags- create relevant hashtags/quiz- create quiz questions with answers/flashcards- create study flashcards/explain- explain a topic simply/exam- create exam-style questions/plan- create a business plan draft/pitch- create a business pitch/pricing- suggest pricing structure/strategy- create a business strategy/swot- create a SWOT analysis/businessmodel- create a business model outline/qr <text or link>- create a QR code image from text or a URL/shorter- shorten replied or inline text/formal- make replied or inline text formal/friendly- make replied or inline text friendlier/translate <language> | <text>- translate text or a replied message/fixgrammar- correct grammar and wording/summarize- summarize replied or inline text/remind <when> | <text>- create a reminder/reminders- list pending reminders/reminders delete <id>- delete a reminder/todo add <text>- add a todo/todo list- show todos/todo done <id>- mark a todo done/todo delete <id>- delete a todo/idea <text>- save an idea/ideas- list saved ideas/link <url>- fetch and analyze a public link/presentation- switch the bot into presentation mode for slide-making requests/presentation <topic or brief>- switch into presentation mode and generate a slide deck draft immediately
/start- show admin dashboard help/help- show admin commands/hash- create a login hash/users- list known users/user <id>- inspect one user/approve <id>- approve a user ID/block <id>- block a user ID/unblock <id>- unblock a user ID/replyuser <id> | <text>- send a message to a user through the user bot
dashboard.pyserves a password-protected admin dashboard- default local bind uses
127.0.0.1:${ADMIN_DASHBOARD_PORT} - the dashboard shows user status, recent activity, login-hash creation, approve/block/unblock actions, and direct user replies
- the public
kaungkhantko.studiowebsite and/api/chatendpoint have been removed - the Nginx config returns
410 Goneforkaungkhantko.studioandwww.kaungkhantko.studio - GitHub Pages source files and the custom-domain
CNAMEfile have been deleted from this repository bot.kaungkhantko.topremains reserved for the password-protected admin dashboard
- keep
.envprivate and only upload.env.exampleto GitHub - the bot uses long polling, so it does not need a webhook
- if
TELEGRAM_ADMIN_BOT_TOKENis set, admin controls move to the separateadmin_bot.pyprocess and unknown-user alerts are sent through that dashboard bot - if
ADMIN_DASHBOARD_PASSWORDandADMIN_DASHBOARD_SECRETare set,dashboard.pyserves a password-protected admin web dashboard - the bot shows an organized Telegram button keyboard for common actions; use
/menuto show it again if needed - sending only a public URL will auto-trigger link analysis
- saved tone memory applies to both English and Burmese replies until cleared
- persona memory applies across normal chat, rewrite tools, and translation tasks until cleared
- reminders, todos, ideas, tone, persona, and language mode persist in
bot_state.json - simple natural phrases also work for some actions, such as
Remind me tomorrow 9am to call mom,Save this idea ..., andAdd todo ... - messages containing the keyword
contentorcontentsget a longer social-media-style response automatically - sending a photo or supported file will analyze it automatically; supported files include images, txt, pdf, docx, csv, and json
/pdfsends back a generated PDF document file through Telegram/webpdffetches a public web page and sends back a PDF summary/qrsends back a QR code image for the given text or link- voice messages are disabled; use text, photos, or supported files instead
- if you want a different model, change
OPENROUTER_MODELin.env - set
TELEGRAM_ALLOWED_USER_IDSto a comma-separated list if more than one Telegram user should access the bot - future users can be added without editing
.env: the admin can create a one-time code with/hash, and the user can activate access with/login <hash> - the admin bot automatically monitors all non-admin user inputs from the user bot and shows account details, account link, and a ready
/replyuser <id> | <text>pattern - before login, normal users only see
/start,/help, and/loginin the Telegram slash menu; approved users get the normal tool menu; admin controls live in the separate admin bot - you can optionally set
TELEGRAM_ADMIN_USER_IDSif you want more than the default admin1201884652 - if you want custom presentation behavior, set
PRESENTATION_SYSTEM_PROMPTin.env - you can optionally set
BURMESE_SYSTEM_PROMPTandLINK_ANALYSIS_SYSTEM_PROMPTin.env - the PM2 config assumes the VPS app directory will be
/root/telegram-chatbot
This project is released under the MIT License.