From ae23d1c909af779fa42f6a20095c6d1b7a08715b Mon Sep 17 00:00:00 2001 From: bral <54455457+bralbral@users.noreply.github.com> Date: Thu, 25 Apr 2024 23:10:27 +0300 Subject: [PATCH] Set reply as default answer to user message. Closes #40 (#41) * Set reply as default answer to user message * Bump black from 24.2.0 to 24.4.0 (#39) * Bump pre-commit from 3.5.0 to 3.6.0 (#17) Bumps [pre-commit](https://github.com/pre-commit/pre-commit) from 3.5.0 to 3.6.0. - [Release notes](https://github.com/pre-commit/pre-commit/releases) - [Changelog](https://github.com/pre-commit/pre-commit/blob/main/CHANGELOG.md) - [Commits](https://github.com/pre-commit/pre-commit/compare/v3.5.0...v3.6.0) --- updated-dependencies: - dependency-name: pre-commit dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump black from 23.11.0 to 23.12.0 (#18) Bumps [black](https://github.com/psf/black) from 23.11.0 to 23.12.0. - [Release notes](https://github.com/psf/black/releases) - [Changelog](https://github.com/psf/black/blob/main/CHANGES.md) - [Commits](https://github.com/psf/black/compare/23.11.0...23.12.0) --- updated-dependencies: - dependency-name: black dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Squash dependabot commits (#24) * Bump sulguk from 0.6.0 to 0.7.0 (#23) Bumps [sulguk](https://github.com/tishka17/sulguk) from 0.6.0 to 0.7.0. - [Commits](https://github.com/tishka17/sulguk/compare/0.6.0...0.7.0) --- updated-dependencies: - dependency-name: sulguk dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Update structlog requirement from ~=23.2.0 to ~=23.3.0 (#22) Updates the requirements on [structlog](https://github.com/hynek/structlog) to permit the latest version. - [Release notes](https://github.com/hynek/structlog/releases) - [Changelog](https://github.com/hynek/structlog/blob/main/CHANGELOG.md) - [Commits](https://github.com/hynek/structlog/compare/23.2.0...23.3.0) --- updated-dependencies: - dependency-name: structlog dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump black from 23.12.0 to 23.12.1 (#19) Bumps [black](https://github.com/psf/black) from 23.12.0 to 23.12.1. - [Release notes](https://github.com/psf/black/releases) - [Changelog](https://github.com/psf/black/blob/main/CHANGES.md) - [Commits](https://github.com/psf/black/compare/23.12.0...23.12.1) --- updated-dependencies: - dependency-name: black dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump pyaml from 23.9.7 to 23.12.0 (#20) Bumps [pyaml](https://github.com/mk-fg/pretty-yaml) from 23.9.7 to 23.12.0. - [Commits](https://github.com/mk-fg/pretty-yaml/commits) --- updated-dependencies: - dependency-name: pyaml dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump aiogram from 3.2.0 to 3.3.0 (#21) Bumps [aiogram](https://github.com/aiogram/aiogram) from 3.2.0 to 3.3.0. - [Release notes](https://github.com/aiogram/aiogram/releases) - [Changelog](https://github.com/aiogram/aiogram/blob/dev-3.x/CHANGES.rst) - [Commits](https://github.com/aiogram/aiogram/compare/3.2.0...v3.3.0) --- updated-dependencies: - dependency-name: aiogram dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: bral <54455457+bralbral@users.noreply.github.com> --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Update structlog requirement from ~=23.3.0 to ~=24.1.0 (#25) Updates the requirements on [structlog](https://github.com/hynek/structlog) to permit the latest version. - [Release notes](https://github.com/hynek/structlog/releases) - [Changelog](https://github.com/hynek/structlog/blob/main/CHANGELOG.md) - [Commits](https://github.com/hynek/structlog/compare/23.3.0...24.1.0) --- updated-dependencies: - dependency-name: structlog dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump black from 23.12.1 to 24.1.1 (#26) Bumps [black](https://github.com/psf/black) from 23.12.1 to 24.1.1. - [Release notes](https://github.com/psf/black/releases) - [Changelog](https://github.com/psf/black/blob/main/CHANGES.md) - [Commits](https://github.com/psf/black/compare/23.12.1...24.1.1) --- updated-dependencies: - dependency-name: black dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump pydantic-settings from 2.1.0 to 2.2.1 (#33) Bumps [pydantic-settings](https://github.com/pydantic/pydantic-settings) from 2.1.0 to 2.2.1. - [Release notes](https://github.com/pydantic/pydantic-settings/releases) - [Commits](https://github.com/pydantic/pydantic-settings/compare/v2.1.0...v2.2.1) --- updated-dependencies: - dependency-name: pydantic-settings dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump black from 24.1.1 to 24.2.0 (#29) Bumps [black](https://github.com/psf/black) from 24.1.1 to 24.2.0. - [Release notes](https://github.com/psf/black/releases) - [Changelog](https://github.com/psf/black/blob/main/CHANGES.md) - [Commits](https://github.com/psf/black/compare/24.1.1...24.2.0) --- updated-dependencies: - dependency-name: black dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump autoflake from 2.2.1 to 2.3.0 (#28) Bumps [autoflake](https://github.com/PyCQA/autoflake) from 2.2.1 to 2.3.0. - [Release notes](https://github.com/PyCQA/autoflake/releases) - [Commits](https://github.com/PyCQA/autoflake/compare/v2.2.1...v2.3.0) --- updated-dependencies: - dependency-name: autoflake dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump pre-commit from 3.6.0 to 3.6.2 (#30) Bumps [pre-commit](https://github.com/pre-commit/pre-commit) from 3.6.0 to 3.6.2. - [Release notes](https://github.com/pre-commit/pre-commit/releases) - [Changelog](https://github.com/pre-commit/pre-commit/blob/main/CHANGELOG.md) - [Commits](https://github.com/pre-commit/pre-commit/compare/v3.6.0...v3.6.2) --- updated-dependencies: - dependency-name: pre-commit dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump black from 24.2.0 to 24.4.0 Bumps [black](https://github.com/psf/black) from 24.2.0 to 24.4.0. - [Release notes](https://github.com/psf/black/releases) - [Changelog](https://github.com/psf/black/blob/main/CHANGES.md) - [Commits](https://github.com/psf/black/compare/24.2.0...24.4.0) --- updated-dependencies: - dependency-name: black dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: bral <54455457+bralbral@users.noreply.github.com> * Bump pyupgrade from 3.15.0 to 3.15.2 (#38) * Bump pre-commit from 3.5.0 to 3.6.0 (#17) Bumps [pre-commit](https://github.com/pre-commit/pre-commit) from 3.5.0 to 3.6.0. - [Release notes](https://github.com/pre-commit/pre-commit/releases) - [Changelog](https://github.com/pre-commit/pre-commit/blob/main/CHANGELOG.md) - [Commits](https://github.com/pre-commit/pre-commit/compare/v3.5.0...v3.6.0) --- updated-dependencies: - dependency-name: pre-commit dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump black from 23.11.0 to 23.12.0 (#18) Bumps [black](https://github.com/psf/black) from 23.11.0 to 23.12.0. - [Release notes](https://github.com/psf/black/releases) - [Changelog](https://github.com/psf/black/blob/main/CHANGES.md) - [Commits](https://github.com/psf/black/compare/23.11.0...23.12.0) --- updated-dependencies: - dependency-name: black dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Squash dependabot commits (#24) * Bump sulguk from 0.6.0 to 0.7.0 (#23) Bumps [sulguk](https://github.com/tishka17/sulguk) from 0.6.0 to 0.7.0. - [Commits](https://github.com/tishka17/sulguk/compare/0.6.0...0.7.0) --- updated-dependencies: - dependency-name: sulguk dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Update structlog requirement from ~=23.2.0 to ~=23.3.0 (#22) Updates the requirements on [structlog](https://github.com/hynek/structlog) to permit the latest version. - [Release notes](https://github.com/hynek/structlog/releases) - [Changelog](https://github.com/hynek/structlog/blob/main/CHANGELOG.md) - [Commits](https://github.com/hynek/structlog/compare/23.2.0...23.3.0) --- updated-dependencies: - dependency-name: structlog dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump black from 23.12.0 to 23.12.1 (#19) Bumps [black](https://github.com/psf/black) from 23.12.0 to 23.12.1. - [Release notes](https://github.com/psf/black/releases) - [Changelog](https://github.com/psf/black/blob/main/CHANGES.md) - [Commits](https://github.com/psf/black/compare/23.12.0...23.12.1) --- updated-dependencies: - dependency-name: black dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump pyaml from 23.9.7 to 23.12.0 (#20) Bumps [pyaml](https://github.com/mk-fg/pretty-yaml) from 23.9.7 to 23.12.0. - [Commits](https://github.com/mk-fg/pretty-yaml/commits) --- updated-dependencies: - dependency-name: pyaml dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump aiogram from 3.2.0 to 3.3.0 (#21) Bumps [aiogram](https://github.com/aiogram/aiogram) from 3.2.0 to 3.3.0. - [Release notes](https://github.com/aiogram/aiogram/releases) - [Changelog](https://github.com/aiogram/aiogram/blob/dev-3.x/CHANGES.rst) - [Commits](https://github.com/aiogram/aiogram/compare/3.2.0...v3.3.0) --- updated-dependencies: - dependency-name: aiogram dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: bral <54455457+bralbral@users.noreply.github.com> --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Update structlog requirement from ~=23.3.0 to ~=24.1.0 (#25) Updates the requirements on [structlog](https://github.com/hynek/structlog) to permit the latest version. - [Release notes](https://github.com/hynek/structlog/releases) - [Changelog](https://github.com/hynek/structlog/blob/main/CHANGELOG.md) - [Commits](https://github.com/hynek/structlog/compare/23.3.0...24.1.0) --- updated-dependencies: - dependency-name: structlog dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump black from 23.12.1 to 24.1.1 (#26) Bumps [black](https://github.com/psf/black) from 23.12.1 to 24.1.1. - [Release notes](https://github.com/psf/black/releases) - [Changelog](https://github.com/psf/black/blob/main/CHANGES.md) - [Commits](https://github.com/psf/black/compare/23.12.1...24.1.1) --- updated-dependencies: - dependency-name: black dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump pydantic-settings from 2.1.0 to 2.2.1 (#33) Bumps [pydantic-settings](https://github.com/pydantic/pydantic-settings) from 2.1.0 to 2.2.1. - [Release notes](https://github.com/pydantic/pydantic-settings/releases) - [Commits](https://github.com/pydantic/pydantic-settings/compare/v2.1.0...v2.2.1) --- updated-dependencies: - dependency-name: pydantic-settings dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump black from 24.1.1 to 24.2.0 (#29) Bumps [black](https://github.com/psf/black) from 24.1.1 to 24.2.0. - [Release notes](https://github.com/psf/black/releases) - [Changelog](https://github.com/psf/black/blob/main/CHANGES.md) - [Commits](https://github.com/psf/black/compare/24.1.1...24.2.0) --- updated-dependencies: - dependency-name: black dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump autoflake from 2.2.1 to 2.3.0 (#28) Bumps [autoflake](https://github.com/PyCQA/autoflake) from 2.2.1 to 2.3.0. - [Release notes](https://github.com/PyCQA/autoflake/releases) - [Commits](https://github.com/PyCQA/autoflake/compare/v2.2.1...v2.3.0) --- updated-dependencies: - dependency-name: autoflake dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump pre-commit from 3.6.0 to 3.6.2 (#30) Bumps [pre-commit](https://github.com/pre-commit/pre-commit) from 3.6.0 to 3.6.2. - [Release notes](https://github.com/pre-commit/pre-commit/releases) - [Changelog](https://github.com/pre-commit/pre-commit/blob/main/CHANGELOG.md) - [Commits](https://github.com/pre-commit/pre-commit/compare/v3.6.0...v3.6.2) --- updated-dependencies: - dependency-name: pre-commit dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump pyupgrade from 3.15.0 to 3.15.2 Bumps [pyupgrade](https://github.com/asottile/pyupgrade) from 3.15.0 to 3.15.2. - [Commits](https://github.com/asottile/pyupgrade/compare/v3.15.0...v3.15.2) --- updated-dependencies: - dependency-name: pyupgrade dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: bral <54455457+bralbral@users.noreply.github.com> * Bump autoflake from 2.3.0 to 2.3.1 (#35) * Bump pre-commit from 3.5.0 to 3.6.0 (#17) Bumps [pre-commit](https://github.com/pre-commit/pre-commit) from 3.5.0 to 3.6.0. - [Release notes](https://github.com/pre-commit/pre-commit/releases) - [Changelog](https://github.com/pre-commit/pre-commit/blob/main/CHANGELOG.md) - [Commits](https://github.com/pre-commit/pre-commit/compare/v3.5.0...v3.6.0) --- updated-dependencies: - dependency-name: pre-commit dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump black from 23.11.0 to 23.12.0 (#18) Bumps [black](https://github.com/psf/black) from 23.11.0 to 23.12.0. - [Release notes](https://github.com/psf/black/releases) - [Changelog](https://github.com/psf/black/blob/main/CHANGES.md) - [Commits](https://github.com/psf/black/compare/23.11.0...23.12.0) --- updated-dependencies: - dependency-name: black dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Squash dependabot commits (#24) * Bump sulguk from 0.6.0 to 0.7.0 (#23) Bumps [sulguk](https://github.com/tishka17/sulguk) from 0.6.0 to 0.7.0. - [Commits](https://github.com/tishka17/sulguk/compare/0.6.0...0.7.0) --- updated-dependencies: - dependency-name: sulguk dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Update structlog requirement from ~=23.2.0 to ~=23.3.0 (#22) Updates the requirements on [structlog](https://github.com/hynek/structlog) to permit the latest version. - [Release notes](https://github.com/hynek/structlog/releases) - [Changelog](https://github.com/hynek/structlog/blob/main/CHANGELOG.md) - [Commits](https://github.com/hynek/structlog/compare/23.2.0...23.3.0) --- updated-dependencies: - dependency-name: structlog dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump black from 23.12.0 to 23.12.1 (#19) Bumps [black](https://github.com/psf/black) from 23.12.0 to 23.12.1. - [Release notes](https://github.com/psf/black/releases) - [Changelog](https://github.com/psf/black/blob/main/CHANGES.md) - [Commits](https://github.com/psf/black/compare/23.12.0...23.12.1) --- updated-dependencies: - dependency-name: black dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump pyaml from 23.9.7 to 23.12.0 (#20) Bumps [pyaml](https://github.com/mk-fg/pretty-yaml) from 23.9.7 to 23.12.0. - [Commits](https://github.com/mk-fg/pretty-yaml/commits) --- updated-dependencies: - dependency-name: pyaml dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump aiogram from 3.2.0 to 3.3.0 (#21) Bumps [aiogram](https://github.com/aiogram/aiogram) from 3.2.0 to 3.3.0. - [Release notes](https://github.com/aiogram/aiogram/releases) - [Changelog](https://github.com/aiogram/aiogram/blob/dev-3.x/CHANGES.rst) - [Commits](https://github.com/aiogram/aiogram/compare/3.2.0...v3.3.0) --- updated-dependencies: - dependency-name: aiogram dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: bral <54455457+bralbral@users.noreply.github.com> --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Update structlog requirement from ~=23.3.0 to ~=24.1.0 (#25) Updates the requirements on [structlog](https://github.com/hynek/structlog) to permit the latest version. - [Release notes](https://github.com/hynek/structlog/releases) - [Changelog](https://github.com/hynek/structlog/blob/main/CHANGELOG.md) - [Commits](https://github.com/hynek/structlog/compare/23.3.0...24.1.0) --- updated-dependencies: - dependency-name: structlog dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump black from 23.12.1 to 24.1.1 (#26) Bumps [black](https://github.com/psf/black) from 23.12.1 to 24.1.1. - [Release notes](https://github.com/psf/black/releases) - [Changelog](https://github.com/psf/black/blob/main/CHANGES.md) - [Commits](https://github.com/psf/black/compare/23.12.1...24.1.1) --- updated-dependencies: - dependency-name: black dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump pydantic-settings from 2.1.0 to 2.2.1 (#33) Bumps [pydantic-settings](https://github.com/pydantic/pydantic-settings) from 2.1.0 to 2.2.1. - [Release notes](https://github.com/pydantic/pydantic-settings/releases) - [Commits](https://github.com/pydantic/pydantic-settings/compare/v2.1.0...v2.2.1) --- updated-dependencies: - dependency-name: pydantic-settings dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump black from 24.1.1 to 24.2.0 (#29) Bumps [black](https://github.com/psf/black) from 24.1.1 to 24.2.0. - [Release notes](https://github.com/psf/black/releases) - [Changelog](https://github.com/psf/black/blob/main/CHANGES.md) - [Commits](https://github.com/psf/black/compare/24.1.1...24.2.0) --- updated-dependencies: - dependency-name: black dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump autoflake from 2.2.1 to 2.3.0 (#28) Bumps [autoflake](https://github.com/PyCQA/autoflake) from 2.2.1 to 2.3.0. - [Release notes](https://github.com/PyCQA/autoflake/releases) - [Commits](https://github.com/PyCQA/autoflake/compare/v2.2.1...v2.3.0) --- updated-dependencies: - dependency-name: autoflake dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump pre-commit from 3.6.0 to 3.6.2 (#30) Bumps [pre-commit](https://github.com/pre-commit/pre-commit) from 3.6.0 to 3.6.2. - [Release notes](https://github.com/pre-commit/pre-commit/releases) - [Changelog](https://github.com/pre-commit/pre-commit/blob/main/CHANGELOG.md) - [Commits](https://github.com/pre-commit/pre-commit/compare/v3.6.0...v3.6.2) --- updated-dependencies: - dependency-name: pre-commit dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump autoflake from 2.3.0 to 2.3.1 Bumps [autoflake](https://github.com/PyCQA/autoflake) from 2.3.0 to 2.3.1. - [Release notes](https://github.com/PyCQA/autoflake/releases) - [Commits](https://github.com/PyCQA/autoflake/compare/v2.3.0...v2.3.1) --- updated-dependencies: - dependency-name: autoflake dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: bral <54455457+bralbral@users.noreply.github.com> * Bump pre-commit from 3.6.2 to 3.7.0 (#37) * Bump pre-commit from 3.5.0 to 3.6.0 (#17) Bumps [pre-commit](https://github.com/pre-commit/pre-commit) from 3.5.0 to 3.6.0. - [Release notes](https://github.com/pre-commit/pre-commit/releases) - [Changelog](https://github.com/pre-commit/pre-commit/blob/main/CHANGELOG.md) - [Commits](https://github.com/pre-commit/pre-commit/compare/v3.5.0...v3.6.0) --- updated-dependencies: - dependency-name: pre-commit dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump black from 23.11.0 to 23.12.0 (#18) Bumps [black](https://github.com/psf/black) from 23.11.0 to 23.12.0. - [Release notes](https://github.com/psf/black/releases) - [Changelog](https://github.com/psf/black/blob/main/CHANGES.md) - [Commits](https://github.com/psf/black/compare/23.11.0...23.12.0) --- updated-dependencies: - dependency-name: black dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Squash dependabot commits (#24) * Bump sulguk from 0.6.0 to 0.7.0 (#23) Bumps [sulguk](https://github.com/tishka17/sulguk) from 0.6.0 to 0.7.0. - [Commits](https://github.com/tishka17/sulguk/compare/0.6.0...0.7.0) --- updated-dependencies: - dependency-name: sulguk dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Update structlog requirement from ~=23.2.0 to ~=23.3.0 (#22) Updates the requirements on [structlog](https://github.com/hynek/structlog) to permit the latest version. - [Release notes](https://github.com/hynek/structlog/releases) - [Changelog](https://github.com/hynek/structlog/blob/main/CHANGELOG.md) - [Commits](https://github.com/hynek/structlog/compare/23.2.0...23.3.0) --- updated-dependencies: - dependency-name: structlog dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump black from 23.12.0 to 23.12.1 (#19) Bumps [black](https://github.com/psf/black) from 23.12.0 to 23.12.1. - [Release notes](https://github.com/psf/black/releases) - [Changelog](https://github.com/psf/black/blob/main/CHANGES.md) - [Commits](https://github.com/psf/black/compare/23.12.0...23.12.1) --- updated-dependencies: - dependency-name: black dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump pyaml from 23.9.7 to 23.12.0 (#20) Bumps [pyaml](https://github.com/mk-fg/pretty-yaml) from 23.9.7 to 23.12.0. - [Commits](https://github.com/mk-fg/pretty-yaml/commits) --- updated-dependencies: - dependency-name: pyaml dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump aiogram from 3.2.0 to 3.3.0 (#21) Bumps [aiogram](https://github.com/aiogram/aiogram) from 3.2.0 to 3.3.0. - [Release notes](https://github.com/aiogram/aiogram/releases) - [Changelog](https://github.com/aiogram/aiogram/blob/dev-3.x/CHANGES.rst) - [Commits](https://github.com/aiogram/aiogram/compare/3.2.0...v3.3.0) --- updated-dependencies: - dependency-name: aiogram dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: bral <54455457+bralbral@users.noreply.github.com> --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Update structlog requirement from ~=23.3.0 to ~=24.1.0 (#25) Updates the requirements on [structlog](https://github.com/hynek/structlog) to permit the latest version. - [Release notes](https://github.com/hynek/structlog/releases) - [Changelog](https://github.com/hynek/structlog/blob/main/CHANGELOG.md) - [Commits](https://github.com/hynek/structlog/compare/23.3.0...24.1.0) --- updated-dependencies: - dependency-name: structlog dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump black from 23.12.1 to 24.1.1 (#26) Bumps [black](https://github.com/psf/black) from 23.12.1 to 24.1.1. - [Release notes](https://github.com/psf/black/releases) - [Changelog](https://github.com/psf/black/blob/main/CHANGES.md) - [Commits](https://github.com/psf/black/compare/23.12.1...24.1.1) --- updated-dependencies: - dependency-name: black dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump pydantic-settings from 2.1.0 to 2.2.1 (#33) Bumps [pydantic-settings](https://github.com/pydantic/pydantic-settings) from 2.1.0 to 2.2.1. - [Release notes](https://github.com/pydantic/pydantic-settings/releases) - [Commits](https://github.com/pydantic/pydantic-settings/compare/v2.1.0...v2.2.1) --- updated-dependencies: - dependency-name: pydantic-settings dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump black from 24.1.1 to 24.2.0 (#29) Bumps [black](https://github.com/psf/black) from 24.1.1 to 24.2.0. - [Release notes](https://github.com/psf/black/releases) - [Changelog](https://github.com/psf/black/blob/main/CHANGES.md) - [Commits](https://github.com/psf/black/compare/24.1.1...24.2.0) --- updated-dependencies: - dependency-name: black dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump autoflake from 2.2.1 to 2.3.0 (#28) Bumps [autoflake](https://github.com/PyCQA/autoflake) from 2.2.1 to 2.3.0. - [Release notes](https://github.com/PyCQA/autoflake/releases) - [Commits](https://github.com/PyCQA/autoflake/compare/v2.2.1...v2.3.0) --- updated-dependencies: - dependency-name: autoflake dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump pre-commit from 3.6.0 to 3.6.2 (#30) Bumps [pre-commit](https://github.com/pre-commit/pre-commit) from 3.6.0 to 3.6.2. - [Release notes](https://github.com/pre-commit/pre-commit/releases) - [Changelog](https://github.com/pre-commit/pre-commit/blob/main/CHANGELOG.md) - [Commits](https://github.com/pre-commit/pre-commit/compare/v3.6.0...v3.6.2) --- updated-dependencies: - dependency-name: pre-commit dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump pre-commit from 3.6.2 to 3.7.0 Bumps [pre-commit](https://github.com/pre-commit/pre-commit) from 3.6.2 to 3.7.0. - [Release notes](https://github.com/pre-commit/pre-commit/releases) - [Changelog](https://github.com/pre-commit/pre-commit/blob/main/CHANGELOG.md) - [Commits](https://github.com/pre-commit/pre-commit/compare/v3.6.2...v3.7.0) --- updated-dependencies: - dependency-name: pre-commit dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: bral <54455457+bralbral@users.noreply.github.com> --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 6 +++ README.MD | 2 + requirements.txt | 3 +- requirements_dev.txt | 8 ++-- src/__main__.py | 11 ++--- src/bot/handlers/admins/router.py | 35 ++++++++++++-- src/bot/handlers/admins/utils.py | 23 +++++++-- src/bot/handlers/utils.py | 2 + src/bot/middlewares/logger.py | 2 +- src/bot/utils/__init__.py | 1 - src/constants.py | 5 +- src/logger.py | 80 +++++++++++++++++++++++++++++++ src/version_updater.py | 28 +++++++++++ 13 files changed, 180 insertions(+), 26 deletions(-) mode change 100755 => 100644 .pre-commit-config.yaml create mode 100755 src/logger.py create mode 100644 src/version_updater.py diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml old mode 100755 new mode 100644 index b4508e1..a6598bc --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -8,6 +8,12 @@ repos: - repo: local hooks: + # update version on constants.py + - id: version_updater + name: version_updater + entry: python3 ./src/version_updater.py + language: python + # For reformatting code - id: black name: black diff --git a/README.MD b/README.MD index 6b643b1..017243c 100644 --- a/README.MD +++ b/README.MD @@ -22,6 +22,8 @@ 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. +The user will receive the reply as a **reply** to the original message. If the message does not exist, the user will receive a response with a **separate message**. + If the transfer is successful, the administrator will be notified. You can [customize the bot's responses](./deploy/example.config.yaml#12), or use default values. diff --git a/requirements.txt b/requirements.txt index 428d18d..5303cec 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,7 @@ aiogram==3.3.0 sulguk==0.7.0 pydantic-settings==2.2.1 -pyaml==23.12.0 +pyaml==24.4.0 uvloop==0.19.0; sys_platform == 'linux' structlog~=24.1.0 +orjson==3.10.1 diff --git a/requirements_dev.txt b/requirements_dev.txt index 6d3aeb2..ffb0095 100644 --- a/requirements_dev.txt +++ b/requirements_dev.txt @@ -1,6 +1,6 @@ -pre-commit==3.6.2 -black==24.2.0 -autoflake==2.3.0 +pre-commit==3.7.0 +black==24.4.1 +autoflake==2.3.1 reorder-python-imports==3.12.0 -pyupgrade==3.15.0 +pyupgrade==3.15.2 git+https://github.com/aio-libs/sort-all.git \ No newline at end of file diff --git a/src/__main__.py b/src/__main__.py index caab70a..f777e43 100755 --- a/src/__main__.py +++ b/src/__main__.py @@ -1,7 +1,6 @@ import asyncio import platform -import structlog from aiogram import Bot from aiogram import Dispatcher @@ -10,6 +9,7 @@ from src.config import Config from src.config import load_config from src.constants import CONFIG_FILE_PATH +from src.logger import logger if platform.system() == "linux": import uvloop @@ -17,9 +17,6 @@ uvloop.install() -logger = structlog.stdlib.get_logger() - - async def main() -> None: config: Config = load_config(config_path=CONFIG_FILE_PATH) @@ -30,8 +27,8 @@ async def main() -> None: errors=config.errors, ) bot: Bot = await setup_bot(config=config.bot) - - await logger.ainfo("Starting bot") + bot_info = await bot.get_me() + await logger.aerror(f"Starting @{bot_info.username}") await dp.start_polling(bot, allowed_updates=dp.resolve_used_update_types()) @@ -39,4 +36,4 @@ async def main() -> None: try: asyncio.run(main()) except (KeyboardInterrupt, SystemExit): - logger.error("Bot stopped!") + logger.error("Bot stopped") diff --git a/src/bot/handlers/admins/router.py b/src/bot/handlers/admins/router.py index 3260cfd..f3a04be 100644 --- a/src/bot/handlers/admins/router.py +++ b/src/bot/handlers/admins/router.py @@ -1,3 +1,5 @@ +from typing import Optional + from aiogram import Bot from aiogram import F from aiogram import Router @@ -25,17 +27,40 @@ async def reply_to_user( :param kwargs: :return: """ + + message_id: Optional[int] = None + try: - user_id = extract_id(message.reply_to_message) + user_id = extract_id(message.reply_to_message, id_type="chat_id") except ValueError as ex: await message.reply(text=f"{errors.extract_user_id} {str(ex)}") return try: - await bot.copy_message( - from_chat_id=message.chat.id, chat_id=user_id, message_id=message.message_id - ) - await message.reply(text=messages.notify_admin_about_success_answer) + message_id = extract_id(message.reply_to_message, id_type="message_id") + except ValueError: + pass + + try: + try: + await bot.copy_message( + from_chat_id=message.chat.id, + chat_id=user_id, + message_id=message.message_id, + reply_to_message_id=message_id, + ) + except TelegramAPIError as inner_ex: + + # message to reply can be deleted + if not inner_ex.message.find("message to reply not found") > -1: + raise inner_ex + + # try to resend message + await bot.copy_message( + from_chat_id=message.chat.id, + chat_id=user_id, + message_id=message.message_id, + ) except TelegramAPIError as ex: await message.reply(text=f"{errors.copy_message} {str(ex)}") diff --git a/src/bot/handlers/admins/utils.py b/src/bot/handlers/admins/utils.py index 2beed5f..2cb4005 100644 --- a/src/bot/handlers/admins/utils.py +++ b/src/bot/handlers/admins/utils.py @@ -1,22 +1,35 @@ import re +from typing import Literal from aiogram.types import Message ID_PATTERN = re.compile(pattern=r"#id\d{1,}[\s]?") +MESSAGE_ID_PATTERN = re.compile(pattern=r"#msgid\d{1,}[\s]?") -def extract_id(message: Message) -> int: +def extract_id(message: Message, id_type: Literal["chat_id", "message_id"]) -> int: """ - Extract #id12345678 addition from message text start + Extract #id12345678 or #msgid12345678u addition from message text start + :param id_type: :param message: :return: """ + + if id_type == "chat_id": + pattern = ID_PATTERN + prefix = "#id" + elif id_type == "message_id": + pattern = MESSAGE_ID_PATTERN + prefix = "#msgid" + else: + raise ValueError(f"Unknown id_type: {id_type}") + text = message.text if message.text else message.caption - matches = ID_PATTERN.findall(text) + matches = pattern.findall(text) if len(matches) == 0: - raise ValueError("Cannot match #id") + raise ValueError(f"Cannot match {prefix}") - _id = int(str(matches[0]).replace("#id", "").strip()) + _id = int(str(matches[0]).replace(prefix, "").strip()) return _id diff --git a/src/bot/handlers/utils.py b/src/bot/handlers/utils.py index 9a2e2f9..28a8f7b 100644 --- a/src/bot/handlers/utils.py +++ b/src/bot/handlers/utils.py @@ -10,6 +10,8 @@ def extract_userinfo_from_message(message: Message) -> str: return f""" #id{message.from_user.id}
+ #msgid{message.message_id} +
username: {message.from_user.username}
diff --git a/src/bot/middlewares/logger.py b/src/bot/middlewares/logger.py index 87394c0..8311531 100755 --- a/src/bot/middlewares/logger.py +++ b/src/bot/middlewares/logger.py @@ -18,7 +18,7 @@ async def __call__( event: Message, data: Dict[str, Any], ) -> Any: - await self.logger.ainfo(event=event, data=data) + await self.logger.ainfo(event=event) return await handler(event, data) diff --git a/src/bot/utils/__init__.py b/src/bot/utils/__init__.py index 7d42110..47a186a 100644 --- a/src/bot/utils/__init__.py +++ b/src/bot/utils/__init__.py @@ -1,5 +1,4 @@ from .setup_bot import setup_bot from .setup_dispatcher import setup_dispatcher - __all__ = ["setup_bot", "setup_dispatcher"] diff --git a/src/constants.py b/src/constants.py index 20122dc..a973a51 100644 --- a/src/constants.py +++ b/src/constants.py @@ -1,7 +1,8 @@ import os +VERSION: str = "2024-04-25.22" ROOT_DIR: str = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) -CONFIG_FILE_PATH = os.path.join(ROOT_DIR, "config.yaml") +CONFIG_FILE_PATH: str = os.path.join(ROOT_DIR, "config.yaml") -__all__ = ["CONFIG_FILE_PATH", "ROOT_DIR"] +__all__ = ["CONFIG_FILE_PATH", "ROOT_DIR", "VERSION"] diff --git a/src/logger.py b/src/logger.py new file mode 100755 index 0000000..efb06a0 --- /dev/null +++ b/src/logger.py @@ -0,0 +1,80 @@ +import logging +import sys +from typing import Any + +import orjson +import structlog +from structlog.stdlib import BoundLogger +from structlog.typing import EventDict + +from src.constants import VERSION + + +def add_version( + logger: logging.Logger, method_name: str, event_dict: EventDict +) -> EventDict: + event_dict["version"] = VERSION + + return event_dict + + +def setup_logging() -> None: + log_level = logging.INFO + + structlog.configure( + cache_logger_on_first_use=True, + wrapper_class=structlog.make_filtering_bound_logger(log_level), + processors=[ + structlog.contextvars.merge_contextvars, + structlog.processors.add_log_level, + add_version, + structlog.processors.format_exc_info, + structlog.processors.TimeStamper( + fmt="%Y-%m-%d %H:%M:%S UTC", utc=False, key="@timestamp" + ), + structlog.processors.JSONRenderer(serializer=orjson.dumps), + ], + logger_factory=structlog.BytesLoggerFactory(), + ) + + handler = logging.StreamHandler() + # Use OUR `ProcessorFormatter` to format all `logging` entries. + root_logger = logging.getLogger() + root_logger.addHandler(handler) + root_logger.setLevel(log_level) + + # disable aiogram loggers + # https://github.com/aiogram/aiogram/blob/dev-3.x/aiogram/loggers.py + + for _logger_name in [ + "aiogram.dispatcher", + "aiogram.event", + "aiogram.middlewares", + "aiogram.webhook", + "aiogram.scene", + ]: + + logging.getLogger(_logger_name).handlers.clear() + logging.getLogger(_logger_name).propagate = False + + def handle_exception(exc_type: Any, exc_value: Any, exc_traceback: Any) -> None: + """ + Log any uncaught exception instead of letting it be printed by Python + (but leave KeyboardInterrupt untouched to allow users to Ctrl+C to stop) + See https://stackoverflow.com/a/16993115/3641865 + """ + if issubclass(exc_type, KeyboardInterrupt): + sys.__excepthook__(exc_type, exc_value, exc_traceback) + return + + root_logger.error( + "Uncaught exception", exc_info=(exc_type, exc_value, exc_traceback) + ) + + sys.excepthook = handle_exception + + +setup_logging() +logger: BoundLogger = structlog.stdlib.get_logger() + +__all__ = ["logger", "setup_logging"] diff --git a/src/version_updater.py b/src/version_updater.py new file mode 100644 index 0000000..1b84b54 --- /dev/null +++ b/src/version_updater.py @@ -0,0 +1,28 @@ +import datetime +import os.path +import re + +from constants import ROOT_DIR + + +CONSTANT_PY_PATH = os.path.join(ROOT_DIR, "src", "constants.py") +PATTERN = r"VERSION: str = .+" +TODAY = datetime.datetime.now().strftime("%Y-%m-%d.%H") + +REPLACE_BY = f'VERSION: str = "{TODAY}"' + + +# Open the file in read mode +with open(CONSTANT_PY_PATH) as file: + lines = file.readlines() + +# Check every line for the regular expression and replace it if found +for i in range(len(lines)): + if re.match(PATTERN, lines[i]): + if lines[i] != REPLACE_BY: + lines[i] = REPLACE_BY + "\n" + break + +# Open the file again in write mode to save the changes +with open(CONSTANT_PY_PATH, "w") as file: + file.writelines(lines)