What a mess
This commit is contained in:
@@ -7,7 +7,7 @@ import logging
|
||||
import os
|
||||
from telegram import InlineKeyboardMarkup, InputMediaPhoto
|
||||
from telegram.error import BadRequest
|
||||
from . import database
|
||||
from .api_client import api_client
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
@@ -30,7 +30,7 @@ async def send_or_edit_with_image(query, text: str, reply_markup: InlineKeyboard
|
||||
|
||||
if image_path:
|
||||
# Get or upload image
|
||||
cached_file_id = await database.get_cached_image(image_path)
|
||||
cached_file_id = await api_client.get_cached_image(image_path)
|
||||
|
||||
if not cached_file_id and os.path.exists(image_path):
|
||||
# Upload new image
|
||||
@@ -44,7 +44,7 @@ async def send_or_edit_with_image(query, text: str, reply_markup: InlineKeyboard
|
||||
)
|
||||
if temp_msg.photo:
|
||||
cached_file_id = temp_msg.photo[-1].file_id
|
||||
await database.cache_image(image_path, cached_file_id)
|
||||
await api_client.cache_image(image_path, cached_file_id)
|
||||
# Delete old message to keep chat clean
|
||||
try:
|
||||
await current_message.delete()
|
||||
|
||||
Reference in New Issue
Block a user