Show log ring in ping

This commit is contained in:
blank X 2021-03-10 15:48:07 +07:00
parent ce12028aa2
commit c3b08e0c5f
Signed by: blankie
GPG Key ID: CC15FC822C7F61F5
1 changed files with 2 additions and 2 deletions

View File

@ -1,6 +1,6 @@
import time import time
from pyrogram import Client, filters from pyrogram import Client, filters
from .. import config, help_dict, log_errors, public_log_errors from .. import config, help_dict, log_errors, public_log_errors, log_ring
@Client.on_message(~filters.forwarded & ~filters.sticker & ~filters.via_bot & ~filters.edited & filters.me & filters.command(['ping', 'pong'], prefixes=config['config']['prefixes'])) @Client.on_message(~filters.forwarded & ~filters.sticker & ~filters.via_bot & ~filters.edited & filters.me & filters.command(['ping', 'pong'], prefixes=config['config']['prefixes']))
@log_errors @log_errors
@ -14,7 +14,7 @@ async def ping_pong(client, message):
start = time.time() start = time.time()
reply = await message.reply_text(text) reply = await message.reply_text(text)
end = time.time() end = time.time()
await reply.edit_text(f'{text}\n<i>{round((end-start)*1000)}ms</i>') await reply.edit_text(f'{text}\n<i>{round((end-start)*1000)}ms</i>\n<b>Log Ring:</b> <i>{len(log_ring)}/{log_ring.maxlen}</i>')
help_dict['ping'] = ('Ping', help_dict['ping'] = ('Ping',
'''{prefix}ping - Pong! '''{prefix}ping - Pong!