No description
Find a file
crapStone daf23531b6
Some checks failed
ci/woodpecker/push/pipeline Pipeline was successful
ci/woodpecker/push/package Pipeline failed
test
2022-09-01 00:09:35 +02:00
.woodpecker test 2022-09-01 00:09:35 +02:00
assets improve README 2021-11-08 23:50:31 +01:00
codes_service update dependencies 2022-01-22 21:51:40 +01:00
discord fix formatting 2022-07-23 11:54:16 +02:00
hsctt_lib rewrite of telegram bot, because of braking changes in the api 2022-07-23 00:42:31 +02:00
matrix WIP 2021-11-05 20:43:02 +01:00
telegram rewrite of telegram bot, because of braking changes in the api 2022-07-23 00:42:31 +02:00
.gitignore improve config handling 2021-11-09 22:48:33 +01:00
Cargo.lock update dependencies 2022-07-22 22:36:20 +02:00
Cargo.toml strip binaries in release mode 2022-07-23 00:53:57 +02:00
codes.json remove all custom codes 2021-11-08 23:35:49 +01:00
discord.toml.example improve config handling 2021-11-09 22:48:33 +01:00
Dockerfile.codes_service add woodpecker config for building docker images 2022-08-31 00:20:09 +02:00
Dockerfile.discord add woodpecker config for building docker images 2022-08-31 00:20:09 +02:00
Dockerfile.telegram add woodpecker config for building docker images 2022-08-31 00:20:09 +02:00
LICENSE add LICENSE 2021-11-06 19:58:14 +01:00
README.md add discord to the README 2021-11-09 22:58:19 +01:00
telegram.toml.example improve config handling 2021-11-09 22:48:33 +01:00

HSCTT Bot

The HSCTT (HTTP StatusCode to text) bot was an idea we had early in the morning when 4 CS students were drunk. In the beginning it was just a hacky telegram bot in the form of an ugly python script and now it became a fully fledged microservice architecture with bots for multiple platforms.

What It Does

This bot checks all sent text messages and looks for three digit numbers. If the number is in the "database" it replies with the message (HTTP status in case of valid status code or custom message if set).

Example:

example screenshot

Supported Commands

With the exception of /codes, which is usable by everyone, the following commands can only be used by the "owner" of the bot (user id can be set in the settings file).

Command Explanation
/codes List all available codes (default and custom). Can be pinned in a group.
/addcode <number> <message> Add a custom code (message can contain spaces)
/updatecode <number> <new message> Update the message of an existing custom code
/deletecode <number> Delete an existing custom code

Deployment

A Docker container with all binaries included will come in the future.

Run cargo build --release --workspace to build all binaries. In target/release there is now a binary for every available bot and the codes_service which holds the database of codes. Either copy the binaries to a server or start them in this directory.

First you have to start the codes_service then you can start each bot you want. Go to the section of each bot to see how you start them.

Telegram

First have a look at Deployment

You can either use the config file telegram.toml (copy from telegram.toml.example) or set following environment variables:

# the token you get from Bot Father
TELEGRAM_TOKEN="123456789:ABCDEFGHIJKLMNOPQ_0123456789abcdefg"
# the url your codes_service listens on
SERVICE_URL="http://localhost:3030"
# your Telegram id (only the user with this id can run all commands)
CREATOR_ID=0

Now you can start the telegram binary.

Discord

First have a look at Deployment

You can either use the config file discord.toml (copy from discord.toml.example) or set following environment variables:

# the token you get from Bot Father
DISCORD_TOKEN="<Discord bot token>"
# the url your codes_service listens on
SERVICE_URL="http://localhost:3030"
# your Discord id (only the user with this id can run all commands)
CREATOR_ID=0

Now you can start the discord binary.