|
@@ -23,13 +23,17 @@ in which you don't want it to be in.
|
|
|
@capture_err
|
|
@capture_err
|
|
|
async def blacklist_chat_func(_, message: Message):
|
|
async def blacklist_chat_func(_, message: Message):
|
|
|
if len(message.command) != 2:
|
|
if len(message.command) != 2:
|
|
|
- return await message.reply_text("**Usage:**\n/blacklist_chat [CHAT_ID]")
|
|
|
|
|
|
|
+ return await message.reply_text(
|
|
|
|
|
+ "**Usage:**\n/blacklist_chat [CHAT_ID]"
|
|
|
|
|
+ )
|
|
|
chat_id = int(message.text.strip().split()[1])
|
|
chat_id = int(message.text.strip().split()[1])
|
|
|
if chat_id in await blacklisted_chats():
|
|
if chat_id in await blacklisted_chats():
|
|
|
return await message.reply_text("Chat is already blacklisted.")
|
|
return await message.reply_text("Chat is already blacklisted.")
|
|
|
blacklisted = await blacklist_chat(chat_id)
|
|
blacklisted = await blacklist_chat(chat_id)
|
|
|
if blacklisted:
|
|
if blacklisted:
|
|
|
- return await message.reply_text("Chat has been successfully blacklisted")
|
|
|
|
|
|
|
+ return await message.reply_text(
|
|
|
|
|
+ "Chat has been successfully blacklisted"
|
|
|
|
|
+ )
|
|
|
await message.reply_text("Something wrong happened, check logs.")
|
|
await message.reply_text("Something wrong happened, check logs.")
|
|
|
|
|
|
|
|
|
|
|
|
@@ -37,13 +41,17 @@ async def blacklist_chat_func(_, message: Message):
|
|
|
@capture_err
|
|
@capture_err
|
|
|
async def whitelist_chat_func(_, message: Message):
|
|
async def whitelist_chat_func(_, message: Message):
|
|
|
if len(message.command) != 2:
|
|
if len(message.command) != 2:
|
|
|
- return await message.reply_text("**Usage:**\n/whitelist_chat [CHAT_ID]")
|
|
|
|
|
|
|
+ return await message.reply_text(
|
|
|
|
|
+ "**Usage:**\n/whitelist_chat [CHAT_ID]"
|
|
|
|
|
+ )
|
|
|
chat_id = int(message.text.strip().split()[1])
|
|
chat_id = int(message.text.strip().split()[1])
|
|
|
if chat_id not in await blacklisted_chats():
|
|
if chat_id not in await blacklisted_chats():
|
|
|
return await message.reply_text("Chat is already whitelisted.")
|
|
return await message.reply_text("Chat is already whitelisted.")
|
|
|
whitelisted = await whitelist_chat(chat_id)
|
|
whitelisted = await whitelist_chat(chat_id)
|
|
|
if whitelisted:
|
|
if whitelisted:
|
|
|
- return await message.reply_text("Chat has been successfully whitelisted")
|
|
|
|
|
|
|
+ return await message.reply_text(
|
|
|
|
|
+ "Chat has been successfully whitelisted"
|
|
|
|
|
+ )
|
|
|
await message.reply_text("Something wrong happened, check logs.")
|
|
await message.reply_text("Something wrong happened, check logs.")
|
|
|
|
|
|
|
|
|
|
|