a Telegram chat bot built using the ChatGPT
510
ChatGPT Telegram Bot
This is a Telegram chat bot built using the ChatGPT (GPT-3.5 or GPT-4) language model from OpenAI.
Notable features:
Both one-on-one and group chats.
Direct questions, mentions, follow-ups.
Access external links (articles, code, data).
Shortcuts (custom AI commands).
Custom chat-wide prompts.
Image generation.
On-the-fly configuration.
Use the /config command to change almost any setting on the fly, without restarting the bot.
telegram.usernames and telegram.chat_ids).openai.model), prompt (openai.prompt) and params (openai.params).imagine.enabled).shortcuts).To view a specific config property, put its name after /config:
/config telegram.usernames
/config openai.prompt
/config imagine.enabled
To change a specific config property, put its name and value after /config:
/config telegram.usernames ["alice", "bob", "cindy"]
/config openai.prompt "You are an evil AI bot"
/config imagine.enabled none
When working with list properties like telegram.usernames, you can add or remove individual items instead of redefining the whole list:
/config telegram.usernames +cindy
/config telegram.usernames -bob
The /config command is only available to admins - users listed in the telegram.admins property.
Heated discussions with the bot in large groups can lead to high usage of the OpenAI API. To avoid spending your entire budget, set message limits for groups with the conversation.message_limit config property.
You can limit the number of messages from a user over a period of time. For example:
message_limit:
count: 10
period: hour
message_limit:
count: 1
period: minute
message_limit:
count: 30
period: day
---
version: "3"
services:
pokitoki:
image: pengshp/pokitoki:latest
container_name: pokitoki
restart: unless-stopped
volumes:
- ./config.yml:/code/config.yml
- data:/code/data
volumes:
data:
$ wget https://github.com/nalgeon/pokitoki/raw/main/config.example.yml
config.example.yml to config.yml and specify your tokens there. Add yourself to the telegram.usernames property, otherwise the bot will be available to everyone.docker compose up -d
To stop the bot:
docker compose stop
Content type
Image
Digest
sha256:5399e3bb4…
Size
29.3 MB
Last updated
over 2 years ago
docker pull pengshp/pokitoki