convert corona to a slash command
This commit is contained in:
parent
134f0df3e2
commit
bafbbded94
@ -4,7 +4,7 @@ RUN pip install --disable-pip-version-check --no-compile --no-cache-dir -q -r re
|
|||||||
|
|
||||||
FROM python:3.8-slim
|
FROM python:3.8-slim
|
||||||
RUN apt-get update && apt-get install -y --no-install-recommends imagemagick
|
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
|
COPY --from=0 /usr/local/lib/python3.8/site-packages /usr/local/lib/python3.8/site-packages
|
||||||
ADD app /app
|
ADD app /app
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
@ -117,15 +117,25 @@ class ActualUtils(commands.Cog):
|
|||||||
)
|
)
|
||||||
await ctx.send(embed=embed)
|
await ctx.send(embed=embed)
|
||||||
|
|
||||||
@commands.command(name="corona", aliases=["covid"])
|
@commands.slash_command(
|
||||||
async def corona(self, ctx: commands.Context, *, location=None):
|
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
|
import corona
|
||||||
|
|
||||||
async with ctx.message.channel.typing():
|
await ctx.defer()
|
||||||
result = corona.parse_message(location)
|
result = corona.parse_message(location)
|
||||||
|
|
||||||
await ctx.send(embed=result)
|
await ctx.send_followup(embed=result)
|
||||||
|
|
||||||
@commands.slash_command(
|
@commands.slash_command(
|
||||||
guld_ids=None,
|
guld_ids=None,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user