This commit is contained in:
yasir 2023-02-03 22:03:29 +07:00
parent b9aed07f83
commit de4dbb8f32
3 changed files with 28 additions and 21 deletions

View file

@ -157,10 +157,11 @@ async def start(_, message):
f"Here is the help for **{HELPABLE[module].__MODULE__}**:\n"
+ HELPABLE[module].__HELP__
)
await message.reply(text, disable_web_page_preview=True)
await kirimPesan(message, text, disable_web_page_preview=True)
elif name == "help":
text, keyb = await help_parser(message.from_user.first_name)
await message.reply(
await kirimPesan(
message,
text,
reply_markup=keyb,
)
@ -214,14 +215,15 @@ async def help_command(_, message):
],
]
)
await message.reply(
await kirimPesan(
message,
f"Click on the below button to get help about {name}",
reply_markup=key,
)
else:
await message.reply("PM Me For More Details.", reply_markup=keyboard)
await kirimPesan(message, "PM Me For More Details.", reply_markup=keyboard)
else:
await message.reply("Pm Me For More Details.", reply_markup=keyboard)
await kirimPesan(message, "Pm Me For More Details.", reply_markup=keyboard)
else:
if not await db.is_user_exist(message.from_user.id):
await db.add_user(message.from_user.id, message.from_user.first_name)
@ -237,18 +239,19 @@ async def help_command(_, message):
f"Here is the help for **{HELPABLE[name].__MODULE__}**:\n"
+ HELPABLE[name].__HELP__
)
await message.reply(text, disable_web_page_preview=True)
await kirimPesan(message, text, disable_web_page_preview=True)
else:
text, help_keyboard = await help_parser(message.from_user.first_name)
await message.reply(
await kirimPesan(
message,
text,
reply_markup=help_keyboard,
disable_web_page_preview=True,
)
else:
text, help_keyboard = await help_parser(message.from_user.first_name)
await message.reply(
text, reply_markup=help_keyboard, disable_web_page_preview=True
await kirimPesan(
message, text, reply_markup=help_keyboard, disable_web_page_preview=True
)
return
@ -291,7 +294,8 @@ General command are:
module = mod_match[1].replace(" ", "_")
text = f"Here is the help for **{HELPABLE[module].__MODULE__}**:\n{HELPABLE[module].__HELP__}"
await query.message.edit(
await editPesan(
query.message,
text=text,
reply_markup=InlineKeyboardMarkup(
[[InlineKeyboardButton("back", callback_data="help_back")]]
@ -307,7 +311,8 @@ General command are:
await query.message.delete()
elif prev_match:
curr_page = int(prev_match[1])
await query.message.edit(
await editPesan(
query.message,
text=top_text,
reply_markup=InlineKeyboardMarkup(
paginate_modules(curr_page - 1, HELPABLE, "help")
@ -317,7 +322,8 @@ General command are:
elif next_match:
next_page = int(next_match[1])
await query.message.edit(
await editPesan(
query.message,
text=top_text,
reply_markup=InlineKeyboardMarkup(
paginate_modules(next_page + 1, HELPABLE, "help")
@ -326,7 +332,8 @@ General command are:
)
elif back_match:
await query.message.edit(
await editPesan(
query.message,
text=top_text,
reply_markup=InlineKeyboardMarkup(paginate_modules(0, HELPABLE, "help")),
disable_web_page_preview=True,
@ -334,7 +341,8 @@ General command are:
elif create_match:
text, keyboard = await help_parser(query)
await query.message.edit(
await editPesan(
query.message,
text=text,
reply_markup=keyboard,
disable_web_page_preview=True,

View file

@ -18,10 +18,9 @@ async def task(msg, warn = False, sec = None):
def wait(sec):
async def ___(flt, cli, msg):
user_id = msg.from_user.id
timestamp = time.mktime(msg.date.timetuple())
if user_id in data:
if timestamp >= data[user_id]['timestamp'] + flt.data:
data[user_id] = {'timestamp' : msg.date, 'warned' : False}
if msg.date.timestamp() >= data[user_id]['timestamp'] + flt.data:
data[user_id] = {'timestamp' : msg.date.timestamp(), 'warned' : False}
return True
else:
if not data[user_id]['warned']:
@ -32,6 +31,6 @@ def wait(sec):
asyncio.ensure_future(task(msg))
return False
else:
data.update({user_id : {'timestamp' : timestamp, 'warned' : False}})
data.update({user_id : {'timestamp' : msg.date.timestamp(), 'warned' : False}})
return True
return filters.create(___, data=sec)

View file

@ -89,7 +89,7 @@ async def shell(_, m):
file_name=doc.name,
reply_markup=InlineKeyboardMarkup([[InlineKeyboardButton(text="❌ Close", callback_data=f"close#{m.from_user.id}")]]),
)
await m.delete if m.from_user.is_self else await msg.delete()
await m.delete() if m.from_user.is_self else await msg.delete()
try:
os.remove("shell_output.txt")
except:
@ -147,13 +147,13 @@ async def evaluation_cmd_t(_, m):
out_file.write(final_output)
await m.reply_document(
document="MissKatyEval.txt",
caption=f"<code>{cmd[: 4096 // 4 - 1]}</code>",
caption=f"<code>{cmd[1][: 4096 // 4 - 1]}</code>",
disable_notification=True,
thumb="img/thumb.jpg",
reply_markup=InlineKeyboardMarkup([[InlineKeyboardButton(text="❌ Close", callback_data=f"close#{m.from_user.id}")]]),
)
os.remove("MissKatyEval.txt")
await m.delete if m.from_user.is_self else await status_message.delete()
await m.delete() if m.from_user.is_self else await status_message.delete()
else:
await edit_or_reply(
m,