🐟 Commands

Code behind main two commands, and list of all commands.

l!rulebook, /rulebook

class Rulebook(commands.Cog):
    def __init__(self, bot):
        self.bot = bot

    # Main Rulebook Command
    @commands.hybrid_command(
        name="rulebook", description="Load an Interactive LastFish! Rulebook and Guide!"
    )
    async def rulebook(self, ctx):
        """An interactive rulebook and guide!"""

        # Creates DropDown menu + Options
        class Dropdown(discord.ui.Select):
            def __init__(self):
                options = [
                    discord.SelectOption(#Option1)
                ]

                super().__init__(
                    placeholder="Please Select a Page",
                    min_values=1,
                    max_values=1,
                    options=options,
                )

            # Gets user Selected option and returns it as an Embed
            async def callback(self, interaction: discord.Interaction):
                selected_option = self.values[0]
                information = rulebook_pages[selected_option]["information"]
                for option in self.options:
                    if option.label == selected_option:
                        embed = discord.Embed(
                            title=option.label,
                            description=option.description,
                            color=6750182,
                        )
                        embed.add_field(name="", value=information)
                        embed.set_image(
                            url=rulebook_pages.get(option.label, {}).get("image", None)
                        )
                await interaction.response.send_message(embed=embed, ephemeral=True)

        #Discord Dropdown Shenanigans
        class DropdownView(discord.ui.View):
            def __init__(self):
                super().__init__()

                # Adds the dropdown to our view object.
                self.add_item(
                    Dropdown(),
                )

        logger.info("Command Invoked")
        # Creates and Sends Beginning Embed from /rulebook command
        welcome_embed = discord.Embed(
            title="Welcome to the Rulebook",
            description=(f"{players}2-6 Players \n {clock}Gametime: 10-60 minutes"),
            color=discord.Color.teal(),
        )
        # Welcome Embed Formatting Redacted

        view = DropdownView()
        message = await ctx.send(embed=welcome_embed, view=view, ephemeral=True)
        await asyncio.sleep(180)
        await message.delete()
        logger.info("Welcome Embed Deleted")

l!card <name>, /card lookup:

List of all commands

  • /Rulebook or !rulebook

  • /Card or !card <Card Name>

  • /PlayerSelect

  • /Suggest

  • /Credits or !credits

  • /About or !about

  • !lore or !readings

  • l!reminder <on/off> (Rico/SageMax Only)

  • l!randcard

Last updated