modifications to existing commands

added latency measurement to ping command, added typing event to ai command
This commit is contained in:
NodeStorm 2020-08-16 22:28:40 +03:00 committed by GitHub
parent 5eab1393da
commit c5f5c17a37
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 22 additions and 21 deletions

View File

@ -9,7 +9,7 @@ class Basic(commands.Cog):
@commands.command()
async def ping(self, ctx):
await ctx.send("pong!")
await ctx.send(f"Pong! **{round(self.client.latency*1000, 1)}ms**")
@commands.command(aliases=["cp"], brief="Change the guild-wide bot prefix", usage="<prefix>")
@commands.guild_only()

View File

@ -14,6 +14,7 @@ class Lydia(commands.Cog):
@commands.command(aliases=["lydia"], brief="Have a chat with Lydia", usage="<chat>")
async def ai(self, ctx, *, quest):
async with ctx.channel.typing():
self.cur.execute(f'SELECT * FROM sessions WHERE user_id="{ctx.author.id}"')
query = self.cur.fetchone()