Skip to content

Commit

Permalink
hotfix: messages with caption
Browse files Browse the repository at this point in the history
  • Loading branch information
bralbral committed Oct 7, 2023
1 parent 4b3eb86 commit a8c516a
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 9 deletions.
2 changes: 1 addition & 1 deletion requirements_dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ pre-commit==3.4.0
black==23.9.1
autoflake==2.2.1
reorder-python-imports==3.12.0
pyupgrade==3.14.0
pyupgrade==3.15.0
git+https://github.com/aio-libs/sort-all.git
14 changes: 8 additions & 6 deletions src/__main__.py
Original file line number Diff line number Diff line change
@@ -1,25 +1,27 @@
import asyncio
import os
import platform

import structlog
import uvloop
from aiogram import Bot
from aiogram import Dispatcher

from src.bot import setup_bot
from src.bot import setup_dispatcher
from src.config import Config
from src.config import load_config
from src.constants import ROOT_DIR
from src.constants import CONFIG_FILE_PATH

logger = structlog.stdlib.get_logger()
if platform.system() == "linux":
import uvloop

uvloop.install()


uvloop.install()
logger = structlog.stdlib.get_logger()


async def main() -> None:
config: Config = load_config(config_path=os.path.join(ROOT_DIR, "config.yaml"))
config: Config = load_config(config_path=CONFIG_FILE_PATH)

dp: Dispatcher = setup_dispatcher(
logger=logger,
Expand Down
2 changes: 1 addition & 1 deletion src/bot/handlers/users.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ async def handle_user_message(
return

caption = message.caption if message.caption else ""
caption += extract_userinfo_from_message
caption = extract_userinfo_from_message(message) + caption

await bot.copy_message(
chat_id=chat_id,
Expand Down
3 changes: 2 additions & 1 deletion src/constants.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import os

ROOT_DIR: str = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
CONFIG_FILE_PATH = os.path.join(ROOT_DIR, "config.yaml")


__all__ = ["ROOT_DIR"]
__all__ = ["CONFIG_FILE_PATH", "ROOT_DIR"]

0 comments on commit a8c516a

Please sign in to comment.