Skip to content

Commit

Permalink
add ping command
Browse files Browse the repository at this point in the history
  • Loading branch information
Kry9toN authored Apr 3, 2021
1 parent 6fad0cc commit 6f20733
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions krypton/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,15 @@ async def help(_, message):
async def repo(_, message):
await message.reply_text(REPO_TEXT)

@app.on_message(filters.text & cmd_filter('ping'))
async def ping(_, message):
""" Get bot latency """
start = datetime.now()
msg = await send('`Pong!`')
end = datetime.now()
latency = (end - start).microseconds / 1000
await msg.edit(f"**Pong!**\n`{latency} ms`")

@app.on_message(filters.text & cmd_filter('donation'))
async def donation(_, message):
await message.reply_text(DONATION_TEXT)
Expand Down

0 comments on commit 6f20733

Please sign in to comment.