Skip to content

Commit

Permalink
Auto delete added
Browse files Browse the repository at this point in the history
  • Loading branch information
Tanjiroop authored May 15, 2024
1 parent 48052cb commit f886909
Showing 1 changed file with 22 additions and 6 deletions.
28 changes: 22 additions & 6 deletions plugins/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -401,22 +401,28 @@ async def settings(client, message):
return

settings = await get_settings(grp_id)
try:
if settings['auto_delete']:
settings = await get_settings(grp_id)
except KeyError:
await save_group_settings(grp_id, 'auto_delete', True)
settings = await get_settings(grp_id)

if settings is not None:
buttons = [
[
InlineKeyboardButton(
'Filter Button',
'Fɪʟᴛᴇʀ Bᴜᴛᴛᴏɴ',
callback_data=f'setgs#button#{settings["button"]}#{grp_id}',
),
InlineKeyboardButton(
'Single' if settings["button"] else 'Double',
'Sɪɴɢʟᴇ' if settings["button"] else 'Double',
callback_data=f'setgs#button#{settings["button"]}#{grp_id}',
),
],
[
InlineKeyboardButton(
'Bot PM',
'Bᴏᴛ PM',
callback_data=f'setgs#botpm#{settings["botpm"]}#{grp_id}',
),
InlineKeyboardButton(
Expand All @@ -426,7 +432,7 @@ async def settings(client, message):
],
[
InlineKeyboardButton(
'File Secure',
'Fɪʟᴇ Sᴇᴄᴜʀᴇ',
callback_data=f'setgs#file_secure#{settings["file_secure"]}#{grp_id}',
),
InlineKeyboardButton(
Expand All @@ -446,7 +452,7 @@ async def settings(client, message):
],
[
InlineKeyboardButton(
'Spell Check',
'Sᴘᴇʟʟ Cʜᴇᴄᴋ',
callback_data=f'setgs#spell_check#{settings["spell_check"]}#{grp_id}',
),
InlineKeyboardButton(
Expand All @@ -456,14 +462,24 @@ async def settings(client, message):
],
[
InlineKeyboardButton(
'Welcome',
'Wᴇʟᴄᴏᴍᴇ',
callback_data=f'setgs#welcome#{settings["welcome"]}#{grp_id}',
),
InlineKeyboardButton(
'✅ Yes' if settings["welcome"] else '❌ No',
callback_data=f'setgs#welcome#{settings["welcome"]}#{grp_id}',
),
],
[
InlineKeyboardButton(
'Aᴜᴛᴏ Dᴇʟᴇᴛᴇ',
callback_data=f'setgs#auto_delete#{settings["auto_delete"]}#{grp_id}',
),
InlineKeyboardButton(
'10 Mins' if settings["auto_delete"] else 'OFF',
callback_data=f'setgs#auto_delete#{settings["auto_delete"]}#{grp_id}',
),
],
]

reply_markup = InlineKeyboardMarkup(buttons)
Expand Down

0 comments on commit f886909

Please sign in to comment.