modulepackage
0.0.0-20241028220831-f7e2f166f3c5
Repository: https://github.com/kapitanov/gptbot.git
Documentation: pkg.go.dev
# README
gptbot
A telegram bot that uses GPT3 to transform text.
This bot is non-public, so you'll need to set up your own instance of this bot to use it.
How to build and run
-
Clone git repository to any appropriate directory:
cd /opt git clone https://github.com/kapitanov/gptbot.git cd gptbot
-
Create a
.env
file (see configuration section below):TELEGRAM_BOT_TOKEN=<telegram access token> TELEGRAM_BOT_ACCESS=<list of comma-separated telegram user ids and names> OPENAI_TOKEN=<place your openai token here> STORAGE_PATH=./var/data.yaml
You'll need to:
-
Build and run docker container:
docker-compose up -d --build
Configuration
This bot is configured via env variables:
Variable | Default | Description |
---|---|---|
TELEGRAM_BOT_TOKEN | Required | Telegram bot API access token |
TELEGRAM_BOT_ACCESS | Required | List of allowed Telegram usernames (or userIDs), comma separated |
OPENAI_TOKEN | Required | OpenAI access token |
STORAGE_PATH | Required | Path to message history file (YAML) |
License
# Functions
NewAccessProvider creates new access provider.
# Structs
AccessProvider checks access to telegram chats.