mirror of
https://github.com/miaowware/qrm2.git
synced 2024-11-26 09:48:41 -05:00
PONG!
This commit is contained in:
parent
d66cc63b5f
commit
4b6e8db257
@ -10,6 +10,7 @@ General Public License, version 2.
|
||||
from datetime import datetime
|
||||
import re
|
||||
from collections import OrderedDict
|
||||
import random
|
||||
|
||||
import discord
|
||||
import discord.ext.commands as commands
|
||||
@ -38,13 +39,16 @@ class BaseCog(commands.Cog):
|
||||
@commands.command(name="ping")
|
||||
async def _ping(self, ctx: commands.Context):
|
||||
"""Show the current latency to the discord endpoint."""
|
||||
content = ''
|
||||
if random.random() < 0.05:
|
||||
content = f'<@{ctx.message.author.id}>'
|
||||
embed = discord.Embed(title="**Pong!**",
|
||||
description=f'Current ping is {self.bot.latency*1000:.1f} ms',
|
||||
colour=self.gs.colours.neutral,
|
||||
timestamp=datetime.utcnow())
|
||||
embed.set_footer(text=ctx.author.name,
|
||||
icon_url=str(ctx.author.avatar_url))
|
||||
await ctx.send(embed=embed)
|
||||
await ctx.send(content=content, embed=embed)
|
||||
|
||||
@commands.command(name="changelog", aliases=["clog"])
|
||||
async def _changelog(self, ctx: commands.Context):
|
||||
|
Loading…
Reference in New Issue
Block a user