Image info, endpoint encryption
This commit is contained in:
@@ -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):
|
||||
|
||||
12
bot/utils/private_keyboard.py
Normal file
12
bot/utils/private_keyboard.py
Normal 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
|
||||
Reference in New Issue
Block a user