chore: shift to new in-built ping method

This commit is contained in:
Abhi
2025-06-13 14:42:08 +05:30
parent 5ff07200a3
commit a9df5d0411

View File

@@ -14,7 +14,6 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
from time import perf_counter
from pyrogram import Client, filters
from pyrogram.types import Message
@@ -23,11 +22,10 @@ from utils.misc import modules_help, prefix
@Client.on_message(filters.command(["ping", "p"], prefix) & filters.me)
async def ping(_, message: Message):
start = perf_counter()
await message.edit("<b>Pong!</b>")
end = perf_counter()
await message.edit(f"<b>Pong! {round(end - start, 3)}s</b>")
async def ping(client: Client, message: Message):
await message.edit("<b>Ping!</b>")
latency = await client.ping()
await message.edit(f"<b>Pong! {latency}ms</b>")
modules_help["ping"] = {