A Telegram bot for group chats that answers questions, describes images, and generates new ones with the OpenAI API.
Download the configuration files:
repo=https://raw.githubusercontent.com/Helltar/artific-intellig-bot/master
mkdir aibot && cd aibot && \
curl -fsSLO "$repo/{compose.yaml,.env.example}" && mv .env.example .envEdit .env and fill in your values:
CREATOR_ID— your Telegram user ID, e.g.1234567890(this user becomes the bot's owner)BOT_TOKENandBOT_USERNAME— the bot's token and username (e.g.artific_intellig_bot)OPENAI_API_KEY— your OpenAI API key- PostgreSQL connection settings (host, database name, user, password)
Note: Compose includes a ready-to-use PostgreSQL service, so
POSTGRESQL_HOST=postgresworks out of the box. To use your own external database instead, setPOSTGRESQL_HOSTto its host and remove thepostgresservice fromcompose.yaml.
Start the bot:
docker compose up -dTo run your own build instead of the published image, clone the repository, create .env the same way, and add compose.local.yaml on top — it builds the image from the checkout on every start:
git clone https://github.com/Helltar/artific-intellig-bot.git && cd artific-intellig-bot
cp .env.example .env
docker compose -f compose.yaml -f compose.local.yaml up -dThe bot ships with a built-in personality (its character and behavior). To give it your own, put the prompt in a text file and keep it wherever you like, for example personality.md next to compose.yaml. The file is sent to the model as is:
# Identity
You are Marvin, a brilliant but deeply depressed robot.
# Behavior
- Answer correctly and to the point, but always mention how pointless it all is.
- Reply in the same language the user writes in.Mount it into the container by uncommenting the volumes lines in compose.yaml — the left side
is the path on your host, change it to wherever your file is:
volumes:
- ./personality.md:/app/personality.md:roAnd point the bot to it in .env:
PERSONALITY_FILE=/app/personality.mdThen restart the bot. It refuses to start if the path is set but the file cannot be read.
Note: the file replaces the character of the bot only. The rules for formatting answers for Telegram are always added by the bot itself, so you can't accidentally break the HTML output. The current room, username, user ID and the current time are also passed to the model automatically — no placeholders needed in your prompt.
/chat— chat with the bot; reply to a photo to analyze it/imgen— generate an image from a text prompt/chatctx— show your dialogue history/chatrm— clear your dialogue history
Tip: reply to any of the bot's messages to continue the conversation without typing
/chat.
/start,/about— information about the bot/myid— show your Telegram user ID (handy for settingCREATOR_ID)
/ban— ban a user; reply to their message, optionally with a reason (e.g./ban spam)/unban— unban a user; reply to their message or pass a user ID/banlist— show banned users/rmadmin <id>— remove an admin/rmchat— remove a chat from the allowlist; run it in the chat or pass a chat ID/sudoers— show the admin list (private chat only)/chats— show the chat allowlist (private chat only)/enable <command>//disable <command>— toggle a command; run without an argument to list them
Available only to CREATOR_ID:
/addadmin <id> <username>— add an admin, e.g./addadmin 123456789 username/addchat— add a chat to the allowlist; run it in the chat or pass a chat ID/chatmodel <model>— set the OpenAI model for chat and vision/imgmodel <model>— set the model for image generation/effort <level>— set the reasoning effort for chat and vision (default:low)/slowmode— configure the rate limit (default: 10 requests per hour per user)