Skip to content

Latest commit

Β 

History

29 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Ozzy β€” one-zero-eight bot

Official Telegram bot of the one-zero-eight team
Helps people learn about the team and submit an application to join it.

πŸ”§ Tech Stack

Deno Docker Docker Compose Redis grammY

Notion Fluent MIT License

About the bot

Ozzy is the Telegram bot of the one-zero-eight team. It introduces users to the team, lets them choose their language, and guides candidates through the application process.

The bot collects general information about each candidate, lets them choose the departments they are interested in, and asks department-specific questions:

  • Tech β€” software and hardware project development;
  • Design β€” visual design, interfaces, and media design;
  • Management β€” processes, communication, and project management.

After the application is confirmed, it is sent to the team's Telegram chat. When the Notion integration is enabled, the application is also saved to the candidates database.

Using the bot

  1. Send /start to the bot.
  2. Choose a language: Russian or English.
  3. Read about one-zero-eight and press the join button.
  4. Fill in the application and choose the departments you are interested in.
  5. Review your answers and submit the application.

The following commands are available while filling in an application:

Command Description
/apply Start or continue an application
/pause Pause the application
/undo or /back Return to the previous question
/keep Keep the saved answer
/cancel, /stop, /exit Exit the application while keeping the answers
/help Show the help message
/profile Show the profile of an active team member

An unfinished application and the selected language are stored in Redis, so they can be continued after the bot is restarted.

Requirements

For local development, you will need:

Tool Installation
Deno 2.x Official Deno installation guide
Docker Docker Desktop for macOS, Windows, or Docker Engine for Linux
Docker Compose Included with Docker Desktop; on Linux, install the Docker Compose plugin

Check that the tools are installed:

deno --version
docker --version
docker compose version

Local development

1. Clone the repository

git clone https://github.com/projacktor/apply-bot.git
cd apply-bot

2. Install dependencies

Deno downloads dependencies from the import map and caches them locally.

deno cache --allow-import src/run-lp.ts

3. Configure .env

Create a .env file in the project root:

# Required
TELEGRAM_BOT_TOKEN=123456789:replace_with_bot_token
APPLICATIONS_CHAT_TELEGRAM_ID=-1001234567890
REDIS_HOSTNAME=redis
REDIS_PORT=6379

# Optional: Notion integration is enabled only when all three values are set
NOTION_INTEGRATION_TOKEN=
NOTION_MEMBERS_DB_ID=
NOTION_CANDIDATES_DB_ID=

# Required only for webhook mode
WEBHOOK_SECRET_PATH=

Where to get the values:

  • TELEGRAM_BOT_TOKEN β€” create a bot through @BotFather;
  • APPLICATIONS_CHAT_TELEGRAM_ID β€” the ID of the Telegram chat where applications will be sent; supergroup IDs usually start with -100;
  • REDIS_HOSTNAME depends on how the bot is launched:
    • redis β€” when the bot runs inside Compose;
    • 127.0.0.1 β€” when the bot runs manually on the host and Redis runs in Docker.

Do not commit .env or publish your Telegram bot token.

4. Run everything with Docker

In this mode, both the bot and Redis run inside the Compose network. Make sure REDIS_HOSTNAME=redis is set in .env.

docker compose up --build -d

5. Run the bot manually

Start Redis only:

docker compose up -d redis
docker compose exec redis redis-cli ping
PONG # expected output

For a manual bot launch, set the following values in .env:

REDIS_HOSTNAME=127.0.0.1
REDIS_PORT=6379

Then start the bot using long polling:

deno run --allow-all src/run-lp.ts

Webhook mode

Webhook mode requires a public HTTPS address and a configured WEBHOOK_SECRET_PATH:

deno run --allow-all src/run-wh.ts

In production, the webhook is usually run behind a reverse proxy that accepts HTTPS requests and forwards them to the Deno HTTP server.

Clearing Redis and application data

Delete all Redis data

docker compose exec redis redis-cli FLUSHALL

This deletes all Redis sessions, including applications, selected languages, and conversation state.

Quality checks

deno fmt --check
deno lint
deno check --allow-import src/run-lp.ts
deno check --allow-import src/run-wh.ts
deno test -A

GitHub Actions runs formatting, linting, type checking, and tests on pushes and pull requests targeting main or preview.

Project structure

apply-bot/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ bot.ts                         # bot setup and middleware
β”‚   β”œβ”€β”€ config.ts                      # environment variables
β”‚   β”œβ”€β”€ handlers/                      # commands and conversation flows
β”‚   β”œβ”€β”€ forms/questions/               # application question types
β”‚   β”œβ”€β”€ plugins/i18n.ts                # localization
β”‚   β”œβ”€β”€ plugins/o12t.ts                # members, candidates, and Notion
β”‚   β”œβ”€β”€ notion/                        # Notion client and types
β”‚   └── utils/                         # helper functions
β”œβ”€β”€ locales/en.ftl                    # English locale
β”œβ”€β”€ locales/ru.ftl                    # Russian locale
β”œβ”€β”€ compose.yaml                      # bot and Redis services
β”œβ”€β”€ Dockerfile                         # bot image
β”œβ”€β”€ redis/redis.conf                   # Redis configuration
└── deno.json                          # imports, tasks, and formatting

Notion integration

The integration is disabled if at least one of these variables is missing:

NOTION_INTEGRATION_TOKEN=
NOTION_MEMBERS_DB_ID=
NOTION_CANDIDATES_DB_ID=

Without Notion, the bot continues to work and sends applications to the Telegram chat specified by APPLICATIONS_CHAT_TELEGRAM_ID.

License

This project is distributed under the MIT License.

About

Telegram bot for applying to one-zero-eight: https://t.me/one_zero_eight_bot

Topics

Resources

Contributing

Security policy

Stars

0 stars

Watchers

1 watching

Forks

Releases

Used by

Contributors

Languages