import discord from discord import app_commands from discord.ext import commands class Select(discord.ui.Select): def __init__(self): options=[ discord.SelectOption(label="Channel Commands", emoji="📖", description="Look at all the channel commands"), discord.SelectOption(label="Level Commands", emoji="🎚️", description="Look at all the level commands"), discord.SelectOption(label="Role Commands", emoji="👔", description="Look at all the role commands"), discord.SelectOption(label="Server Commands", emoji="💻", description="Look at all the server commands"), discord.SelectOption(label="User Commands", emoji="🧑", description="Look at all the user commands"), discord.SelectOption(label="Economy Commands", emoji="💵", description="Look at all the economy commands"), discord.SelectOption(label="Warns Commands", emoji="⚠️", description="Look at all the warns commands"), discord.SelectOption(label="Ticket Commands", emoji="🎫", description="Look at all the ticket commands"), discord.SelectOption(label="Other Commands", emoji="🎈", description="Look at all the other commands"), ] super().__init__(custom_id="helpSelect", placeholder="Choose the commands you want to view", max_values=1, min_values=1, options=options) async def callback(self, interaction: discord.Interaction): if self.values[0] == "Channel Commands": em = discord.Embed(title="Channel Commands", description="Here are all the channel commands", color=interaction.user.color) em.add_field(name="slowmode", value="Set the channels slow mode.", inline=False) em.add_field(name="lock", value="Lock a channel from the default role in the server", inline=False) em.add_field(name="unlock", value="Unlock a channel from the default role in the server", inline=False) em.add_field(name="clear", value="Bulk delete messages", inline=False) await interaction.response.send_message(embed=em, ephemeral=True) elif self.values[0] == "Level Commands": em = discord.Embed(title="Normal Commands", description="Here are all the normal commands", color=interaction.user.color) em.add_field(name="rank", value="See your rank in the server", inline=False) em.add_field(name="leaderboard", value="See the top 10 people in your server", inline=False) em.add_field(name="setup", value="Setup levels in your server", inline=False) em.add_field(name="edit", value="Edit the config for your server", inline=False) await interaction.response.send_message(embed=em, ephemeral=True) elif self.values[0] == "Role Commands": em = discord.Embed(title="Role Commands", description="Here are all the role commands", color=interaction.user.color) em.add_field(name='info', value="Get the info on a role in your server", inline=False) em.add_field(name="give", value="Give a member in the server a role", inline=False) em.add_field(name="join", value="Set the role a user gets when they join a server", inline=False) em.add_field(name="remove", value="Remove a role from a user", inline=False) await interaction.response.send_message(embed=em, ephemeral=True) elif self.values[0] == "Server Commands": em = discord.Embed(title="Role Commands", description="Here are all the server commands", color=interaction.user.color) em.add_field(name="stats", value="Get the stats on the server", inline=False) em.add_field(name="members", value="Show the member count", inline=False) em.add_field(name="leave", value="Remove the bot from the server", inline=False) await interaction.response.send_message(embed=em, ephemeral=True) elif self.values[0] == "User Commands": em = discord.Embed(title="User Commands", description="Here are all the user commands", color=interaction.user.color) em.add_field(name="info", value="Get info about a user", inline=False) em.add_field(name="avatar", value="Get a users avatar", inline=False) em.add_field(name="nick", value="Set a users nickname", inline=False) em.add_field(name="ban", value="Ban a user from the server", inline=False) em.add_field(name="kick", value="Kick a user from the server", inline=False) em.add_field(name="timeout", value="Timeout a user", inline=False) em.add_field(name="untimeout", value="Remove a users timeout", inline=False) await interaction.response.send_message(embed=em, ephemeral=True) elif self.values[0] == "Economy Commands": em = discord.Embed(title="Economy Commands", description="Here are all the economy commands", color=interaction.user.color) em.add_field(name="beg", value="Beg for money", inline=False) em.add_field(name="work", value="Work for money", inline=False) em.add_field(name="slots", value="Play the slot machine", inline=False) em.add_field(name="rob", value="Steal someones money from them", inline=False) em.add_field(name="balance", value="Check how much money you have", inline=False) em.add_field(name="pay", value="Send someone some money", inline=False) await interaction.response.send_message(embed=em, ephemeral=True) elif self.values[0] == "Warns Commands": em = discord.Embed(title="Warns Commands", description="Here are all the warns commands", color=interaction.user.color) em.add_field(name="warn", value="Warn a user", inline=False) em.add_field(name="clear", value="Clear all warns for a user", inline=False) em.add_field(name="check", value="Check a users warns", inline=False) await interaction.response.send_message(embed=em, ephemeral=True) elif self.values[0] == "Ticket Commands": em = discord.Embed(title="Ticket Commands", description="Here are all the ticket commands", color=interaction.user.color) em.add_field(name="setup", value="Setup the user for tickets", inline=False) em.add_field(name="create", value="Create a ticket", inline=False) await interaction.response.send_message(embed=em, ephemeral=True) elif self.values[0] == "Other Commands": em = discord.Embed(title="Other Commands", description="See all the uncategorized commands", color=interaction.user.color) em.add_field(name="afk", value="Set your afk status", inline=False) em.add_field(name="flip", value="Flip a coin", inline=False) em.add_field(name="help", value="See this message", inline=False) em.add_field(name="ping", value="Check the bot's latency", inline=False) em.add_field(name="number", value="Generate a random number between 2 numbers", inline=False) em.add_field(name="remind", value="Set a reminder", inline=False) em.add_field(name="snipe", value="Recover a the last deleted message in a channel", inline=False) await interaction.response.send_message(embed=em, ephemeral=True) class SelectView(discord.ui.View): def __init__(self): super().__init__(timeout=None) self.add_item(Select()) class help(commands.Cog): def __init__(self, bot): self.bot = bot @commands.Cog.listener() async def on_ready(self): print("Help Online") @app_commands.command(name="help", description="See all the commands") async def help(self, interaction: discord.Interaction): em = discord.Embed(title="Help", description="Select an item from the dropdown menu to view the commands", color=interaction.user.color) await interaction.response.send_message(embed=em, view=SelectView()) async def setup(bot): await bot.add_cog(help(bot))