2021-09-03 18:26:26 +02:00
|
|
|
from discord.ext import commands
|
2022-02-03 01:43:54 +01:00
|
|
|
from discord.commands import slash_command, ApplicationContext, Option
|
2021-09-03 18:26:26 +02:00
|
|
|
|
|
|
|
from data.embeds.urban_dictionary import Definition
|
|
|
|
from startup.didier import Didier
|
|
|
|
|
|
|
|
|
|
|
|
class DefineSlash(commands.Cog):
|
|
|
|
def __init__(self, client: Didier):
|
|
|
|
self.client: Didier = client
|
|
|
|
|
2022-02-03 01:43:54 +01:00
|
|
|
@slash_command(name="define", description="Urban Dictionary")
|
|
|
|
async def _define_slash(self, ctx: ApplicationContext, query: Option(str, "Search query", required=True)):
|
2021-09-03 18:26:26 +02:00
|
|
|
embed = Definition(query).to_embed()
|
2022-02-03 01:43:54 +01:00
|
|
|
await ctx.respond(embed=embed)
|
2021-09-03 18:26:26 +02:00
|
|
|
|
|
|
|
|
|
|
|
def setup(client: Didier):
|
|
|
|
client.add_cog(DefineSlash(client))
|