Skip to content

Commit

Permalink
bumps readme.md
Browse files Browse the repository at this point in the history
  • Loading branch information
bralbral committed Sep 21, 2023
1 parent a710858 commit 74bb5e9
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 1 deletion.
28 changes: 28 additions & 0 deletions README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -45,3 +63,13 @@ and build docker image:
`docker build -t <your_image_name>:<your_tag_name>`

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.
10 changes: 9 additions & 1 deletion src/bot/utils/setup_bot.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,25 @@
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(),
)

# 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


Expand Down

0 comments on commit 74bb5e9

Please sign in to comment.