This bot is used as example of usage aiogram framework and as admin-helper in our community chats.

aiogram, updated 🕥 2023-02-06 23:22:37

aiogram_bot

This bot is used as example of usage aiogram framework and as admin-helper in our community chats.

What this bot can do?

  • May exist
  • Watch new chat members and filter users (ask question and restrict user)
  • Has simple admin commands for making restrictions
  • Chat admins notifier (command which send message to all admins when someone is report message in chat)
  • Can be translated (en, ru, uk languages)

Development

System dependencies

  • Python 3.7
  • pipenv
  • Docker
  • docker-compose
  • make

Setup environment

  • Install dependencies in venv: pipenv install --dev
  • Copy .env.dist to .env file and change values in this file
  • Run databases in docker: make docker-up-db
  • Apply migrations: make migrate

Project structure

  • Application package is in app
  • All text translations is placed in locales
  • Migrations is placed in migrations
  • Entry-point is app/__main__.py (Can be executed as python -m app) ...

Contributing

Before you will make commit need to run black, isort and Flake8 via command make lint If you change Database models you will need to generate migrations: make migration message="do something"

Deployment

Here listed only Docker deployment methods. That's mean you can't read here how to deploy the bot with other methods instead of Docker but you can do that manually.

Also this bot can't be normally started in Docker with polling mode because in this mode aiohttp server will be not started and healthcheck can not be started.

docker-compose

Pre-requirements: - Docker - docker-compose

Steps: - Prepare .env file - ... (TODO) - make app-create - for first deploy, for updating or restarting

Stopping: - make docker-stop

Destroying (with volumes): - make docker-destroy

Docker Swarm

Pre-requirements: - Docker (with activated swarm mode) - traefik 2.0 in Docker (with overlay network named web)

Commands:

...

How this bot is deployed now?

In Docker Swarm at Illemius with CI/CD

Steps: 1. GitHub Actions: 1. Build docker image 1. Publish it to the private Illemius Docker registry 1. Trigger Portainer webhook in the Illemius cluster via cURL 1. Portainer will trigger updating of the bot service 1. Docker run new instance of container at specified node 1. When container is started by first step it will run migrations 1. Docker wait until new instance will be healthy 1. Traefik watch Docker container and update the routes when new one is available 1. Stop old instance of Bot container

Issues

Bump certifi from 2020.12.5 to 2022.12.7

opened on 2022-12-08 07:45:06 by dependabot[bot]

Bumps certifi from 2020.12.5 to 2022.12.7.

Commits


Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) - `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language - `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language - `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language - `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language You can disable automated security fix PRs for this repo from the [Security Alerts page](https://github.com/aiogram/bot/network/alerts).

Bump mako from 1.1.4 to 1.2.2

opened on 2022-09-16 18:18:03 by dependabot[bot]

Bumps mako from 1.1.4 to 1.2.2.

Release notes

Sourced from mako's releases.

1.2.2

Released: Mon Aug 29 2022

bug

  • [bug] [lexer] Fixed issue in lexer where the regexp used to match tags would not correctly interpret quoted sections individually. While this parsing issue still produced the same expected tag structure later on, the mis-handling of quoted sections was also subject to a regexp crash if a tag had a large number of quotes within its quoted sections.

    References: #366

1.2.1

Released: Thu Jun 30 2022

bug

  • [bug] [tests] Various fixes to the test suite in the area of exception message rendering to accommodate for variability in Python versions as well as Pygments.

    References: #360

misc

  • [performance] Optimized some codepaths within the lexer/Python code generation process, improving performance for generation of templates prior to their being cached. Pull request courtesy Takuto Ikuta.

    References: #361

1.2.0

Released: Thu Mar 10 2022

changed

  • [changed] [py3k] Corrected "universal wheel" directive in setup.cfg so that building a wheel does not target Python 2.

    References: #351

  • [changed] [py3k] The bytestring_passthrough template argument is removed, as this flag only applied to Python 2.

... (truncated)

Commits


Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) - `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language - `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language - `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language - `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language You can disable automated security fix PRs for this repo from the [Security Alerts page](https://github.com/aiogram/bot/network/alerts).

Send captcha to PM when join request is turned on for the group

opened on 2022-08-18 04:44:14 by evgfilim1

This may help to prevent a wall of "xxx joined the group" messages, so only approved members are seen.

Bump pycares from 3.1.1 to 4.2.0

opened on 2022-07-05 22:59:22 by dependabot[bot]

Bumps pycares from 3.1.1 to 4.2.0.

Release notes

Sourced from pycares's releases.

4.2.0

What's Changed

New Contributors

Full Changelog: https://github.com/saghul/pycares/compare/pycares-4.1.2...pycares-4.2.0

4.1.2

Added support for Python 3.10.

4.1.1

Added support for Python 3.10.

4.1.0

Add support for Python 3.10.

4.0.0

  • core: add support for CAA queries
  • core: add support for getaddrinfo()
  • doc: update README
  • core: add ability to use the system installed c-ares
  • misc: set version to 4.0.0
  • test: remove TTL tests
  • core: update c-ares and use a submodule
  • core: drop bundled c-ares version
  • misc: drop tasks.py

3.2.3

No release notes provided.

3.2.2

  • Publish aarch64 wheels

3.2.1

No release notes provided.

3.2.0

  • misc: add Python 3.9 classifier
  • core: drop py3.5 from CI and documentation
  • ci: run tests in Python 3.9
  • ci: fix SDK path in appveyor
  • ci: fix VS linker in appveyor
  • ci: update python installer script in appveyor
  • misc: add compiled windows dll to gitignore
  • test: skip SOA non-ascii test due to changes in remote host
  • test: fix broken chunked TXT test due to changes in remote host
  • test: skip ANY test due to problems with mac
  • ci: add action to release wheels to PyPi

... (truncated)

Changelog

Sourced from pycares's changelog.

No longer updated. Please check the commits.

Version 4.0.0

  • doc: uppdate README
  • core: add support for CAA queries
  • core: add support for getaddrinfo()
  • doc: update README
  • core: add ability to use the system installed c-ares
  • misc: set version to 4.0.0
  • test: remove TTL tests
  • core: update c-ares and use a submodule
  • core: drop bundled c-ares version
  • misc: drop tasks.py

Version 3.2.0

  • misc: add Python 3.9 classifier
  • core: drop py3.5 from CI and documentation
  • ci: run tests in Python 3.9
  • ci: fix SDK path in appveyor
  • ci: fix VS linker in appveyor
  • ci: update python installer script in appveyor
  • misc: add compiled windows dll to gitignore
  • test: skip SOA non-ascii test due to changes in remote host
  • test: fix broken chunked TXT test due to changes in remote host
  • test: skip ANY test due to problems with mac
  • ci: add action to release wheels to PyPi
  • ci: drop AppVeyor
  • ci: don't fail fast
  • ci: stop testing on Travis
  • test: add generic way to check for a CI
  • test: relax check
  • test: try to avoid spurious CI failures
  • ci: test all platforms on GH actions
  • ci: build wheels on GH Actions
  • build: fix build error on macOS
  • ci: explicitly set Python versions to build wheels for
  • ci: update cibuildwheel
  • ci: re-add IDNA test
Commits
  • 7d62675 misc: update changelog
  • 5de6097 misc: set version to 4.2.0
  • faab689 tests: ignoring 2 tests due to dead servers
  • 8026e66 tests: updated google TXT records for an outdated test
  • f431164 deps: update bundled c-ares
  • b1b9834 misc: set version to 4.1.2
  • b6d517e build: add PYPIREADME.rst to manifest
  • f427967 misc: set version to 4.1.1
  • 70820fc misc: add PyPI README without images
  • a856b20 misc: update c-ares URL
  • Additional commits viewable in compare view


Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) - `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language - `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language - `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language - `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language You can disable automated security fix PRs for this repo from the [Security Alerts page](https://github.com/aiogram/bot/network/alerts).

relation "users" does not exist

opened on 2021-12-27 04:28:05 by SuperSuslik312

I am deploying a bot using docker-compose and every time I deploy it I see this error and of course the bot is not processing any messages.

Screenshot_110

Do not make banned channels' usernames clickable

opened on 2021-12-13 06:25:55 by MasterGroosha

Currently when a channel is banned, it's username is posted with leading @, making it clickable, which helps promoting such channels. I suggest removing the @ symbol so chat user won't be able to open that channel instantly.

Later another rule can be applied which replaces some symbols in usernames with asterisks (*)