convert corona to a slash command
This commit is contained in:
parent
00b0a03855
commit
ee97fdf395
@ -4,7 +4,7 @@ RUN pip install --disable-pip-version-check --no-compile --no-cache-dir -q -r re
|
||||
|
||||
FROM python:3.8-slim
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends imagemagick
|
||||
RUN pip install black
|
||||
RUN pip install black && echo "find . -name \"*sync-conflict*\" -delete; black .; ./bot.py" > /usr/local/bin/start && chmod +x /usr/local/bin/start
|
||||
COPY --from=0 /usr/local/lib/python3.8/site-packages /usr/local/lib/python3.8/site-packages
|
||||
ADD app /app
|
||||
WORKDIR /app
|
||||
|
@ -117,15 +117,25 @@ class ActualUtils(commands.Cog):
|
||||
)
|
||||
await ctx.send(embed=embed)
|
||||
|
||||
@commands.command(name="corona", aliases=["covid"])
|
||||
async def corona(self, ctx: commands.Context, *, location=None):
|
||||
@commands.slash_command(
|
||||
guild_ids=None,
|
||||
name="corona",
|
||||
description="Query Johns hopkins online covid stats. Requires a location",
|
||||
)
|
||||
@option(
|
||||
name="location",
|
||||
required=True,
|
||||
description="The location you want to see covid stats for",
|
||||
default="California",
|
||||
)
|
||||
async def corona(self, ctx: commands.Context, location):
|
||||
|
||||
import corona
|
||||
|
||||
async with ctx.message.channel.typing():
|
||||
result = corona.parse_message(location)
|
||||
await ctx.defer()
|
||||
result = corona.parse_message(location)
|
||||
|
||||
await ctx.send(embed=result)
|
||||
await ctx.send_followup(embed=result)
|
||||
|
||||
@commands.slash_command(
|
||||
guld_ids=None,
|
||||
|
Loading…
x
Reference in New Issue
Block a user