Fixed unexpected behavior of the device selection button

This commit is contained in:
Vladless
2024-11-18 14:57:12 +03:00
parent e9237e5f1c
commit 28b344b9c4
3 changed files with 5 additions and 5 deletions
+2 -2
View File
@@ -1,13 +1,13 @@
import os
import asyncpg
from aiogram import F, Router, types
from aiogram.types import BufferedInputFile, InlineKeyboardButton, InlineKeyboardMarkup
from bot import bot
from config import CONNECT_WINDOWS, SUPPORT_CHAT_URL, DATABASE_URL
from config import CONNECT_WINDOWS, DATABASE_URL, SUPPORT_CHAT_URL
from handlers.texts import INSTRUCTION_PC, INSTRUCTIONS, KEY_MESSAGE
from logger import logger
import asyncpg
router = Router()
+1 -1
View File
@@ -137,7 +137,7 @@ async def process_callback_view_keys(callback_query: types.CallbackQuery):
@router.callback_query(F.data.startswith("view_key|"))
async def process_callback_view_key(callback_query: types.CallbackQuery):
tg_id = callback_query.from_user.id
key_name = callback_query.data.split("|")[1]
key_name = callback_query.data.split("|")[1]
try:
try:
+2 -2
View File
@@ -1,4 +1,4 @@
from typing import Any, Awaitable, Callable, Dict,Union
from typing import Any, Awaitable, Callable, Dict, Union
from aiogram import BaseMiddleware
from aiogram.types import TelegramObject
@@ -20,7 +20,7 @@ class AdminMiddleware(BaseMiddleware):
def _check_admin_access(self, event: TelegramObject) -> bool:
try:
admin_ids: Union[int, list[int]] = ADMIN_ID
if isinstance(admin_ids, list):
return event.from_user.id in admin_ids
return event.from_user.id == admin_ids