Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/iShauny/TGFloofBot
Floofbot Telegram Bot
https://github.com/iShauny/TGFloofBot
Last synced: 3 months ago
JSON representation
Floofbot Telegram Bot
- Host: GitHub
- URL: https://github.com/iShauny/TGFloofBot
- Owner: iShauny
- Created: 2021-02-21T21:59:53.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2021-04-14T12:10:50.000Z (over 3 years ago)
- Last Synced: 2024-06-28T13:33:08.074Z (5 months ago)
- Language: Python
- Size: 104 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# TGFloofBot
Floofbot Telegram Bot# Running
## Dependencies
Requires Python 3.9+ and Poetry:
```
python -m pip install poetry
```To create a virtual environment and install dependencies:
```
python -m poetry install
```To activate the virtual environment (`exit` to exit):
```
python -m poetry shell
```## Configuration
Copy the sample configuration file `config.yaml.sample` to `config.yaml` and fill out the fields.
(A token can be obtained by messaging @BotFather on Telegram)
Include `debug: true` if you want to have extended debug log output.
## Starting the bot
First, make sure the environment has been activated:
```
python -m poetry shell
```Then, run the script:
```
python entrypoint.py
```# Development
## Example command
This can be placed in tgfloofbot/plugins/extra/commands.py
```python
class EchoCommandArgs(pydantic.BaseModel):
text: str = pydantic.Field(..., description="Text to echo")@loader.command(help="Repeats what the user says")
def echo(
client: TGFloofbotClient,
update: Update,
context: CallbackContext,
args: EchoCommandArgs,
) -> None:
context.bot.send_message(chat_id=update.effective_chat.id, text=args.text)
```## Linting and formatting
First, make sure the lint dependencies are installed:
```
poetry install -E lint
```Then, you can run the code formatter:
```
black tgfloofbot
```And/or the type checker:
```
mypy tgfloofbot
```