diff --git a/README.MD b/README.MD index 09b6443..429eef3 100644 --- a/README.MD +++ b/README.MD @@ -6,6 +6,24 @@ Use this bot for communicate with users in case you do not want to provide your > For example: you are administrator of telegram group or technical support provider. +## Available commands + +| Command | Description | +|:-------:|:-----------------:| +| /help | Show help message | + +## Usage + +Messages with an available [content type](./src/bot/handlers/users.py#L19) will be transfered to admin group or admin chat. + +*(See variable `chat_id` from [config.yaml](./deploy/example.config.yaml#L6))* + +If the transfer is successful, the requesting party will be notified. + +Admin can answer to message by reply. The answer will be sent to the person who asked. + +If the transfer is successful, the administrator will be notified. + ## Deploy ### Install from source @@ -45,3 +63,13 @@ and build docker image: `docker build -t :` And use this image with [docker-compose.yml](./deploy/example.docker-compose.yml) from `deploy` dir. + +## Develop && Contributing + +Feel free to create issue or pull request. + +For development, you should install the requirements from [requirements_dev.txt](./requirements_dev.txt) + +`pip intall -r requirements_dev.txt` + +Use [pre-commit.sh](./pre-commit.sh) before commit. diff --git a/src/bot/utils/setup_bot.py b/src/bot/utils/setup_bot.py index 40a9caa..36ca7d7 100644 --- a/src/bot/utils/setup_bot.py +++ b/src/bot/utils/setup_bot.py @@ -1,10 +1,12 @@ from aiogram import Bot +from aiogram.types import BotCommand +from aiogram.types import BotCommandScopeDefault from sulguk import AiogramSulgukMiddleware from src.config import BotConfig -def setup_bot(config: BotConfig) -> Bot: +async def setup_bot(config: BotConfig) -> Bot: bot: Bot = Bot( token=config.token.get_secret_value(), ) @@ -12,6 +14,12 @@ def setup_bot(config: BotConfig) -> Bot: # https://github.com/Tishka17/sulguk#example-for-aiogram-users bot.session.middleware(AiogramSulgukMiddleware()) + user_commands = [ + BotCommand(command="help", description="How to use bot"), + ] + + await bot.set_my_commands(user_commands, scope=BotCommandScopeDefault()) + return bot