28 lines
749 B
Python
28 lines
749 B
Python
from discord import option
|
|
from discord.ext import commands
|
|
import star_citizen
|
|
|
|
|
|
class StarCitizen(commands.Cog):
|
|
def __init__(self, bot):
|
|
self.bot: commands.Bot = bot
|
|
|
|
@commands.slash_command(
|
|
guild_ids=None,
|
|
name="ship",
|
|
description="Query the star citizen database about a ship",
|
|
)
|
|
@option(
|
|
name="ship",
|
|
description="Ship you want info on, supports relatively fuzzy matching, eg. 890 instead of 890 jump",
|
|
required=True,
|
|
)
|
|
async def star_citizen(self, ctx: commands.Context, ship):
|
|
await ctx.defer()
|
|
embed = await star_citizen.get_ship(ship_name=ship)
|
|
await ctx.send_followup(embed=embed)
|
|
|
|
|
|
def setup(bot):
|
|
bot.add_cog(StarCitizen(bot))
|