chore: shift to new in-built ping method
This commit is contained in:
@@ -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"] = {
|
||||
|
||||
Reference in New Issue
Block a user