Image info, endpoint encryption

This commit is contained in:
BarsTiger
2023-02-24 23:41:29 +02:00
parent 846e65e2ce
commit 8f0cd0ac05
19 changed files with 211 additions and 23 deletions

View File

@@ -6,11 +6,11 @@ from aiogram import types
def not_allowed(message: types.Message, cd: int, by_id: bool):
text = f"❌ Wait for cooldown ({cd}s for this command) " \
f"{'. Please note that this cooldown is for all users' if not by_id else ''}"
return asyncio.create_task(message.reply(
text=
f"❌ Wait for cooldown ({cd}s for this command)"
f"{'. Please note that this cooldown is for all users' if not by_id else ''}"
))
text=text
) if hasattr(message, 'reply') else message.answer(text=text, show_alert=True))
def throttle(cooldown: int = 5, by_id: bool = True, admin_ids: list = None):

View File

@@ -0,0 +1,12 @@
from aiogram import types
async def other_user(call: types.CallbackQuery) -> bool:
if not hasattr(call.message.reply_to_message, 'from_id'):
await call.answer('Error, original call was removed', show_alert=True)
return True
elif call.message.reply_to_message.from_id != call.from_user.id:
await call.answer('It is not your menu!', show_alert=True)
return True
return False