0% found this document useful (0 votes)
4 views

help.py

The document outlines a Discord bot help command implemented using the discord.py library. It defines a Help class with a command to display a help panel featuring various categories of commands, each associated with specific emojis. The help message includes a main embed and a dropdown menu for users to select categories to view detailed command descriptions.

Uploaded by

arpitranjan4958
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

help.py

The document outlines a Discord bot help command implemented using the discord.py library. It defines a Help class with a command to display a help panel featuring various categories of commands, each associated with specific emojis. The help message includes a main embed and a dropdown menu for users to select categories to view detailed command descriptions.

Uploaded by

arpitranjan4958
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 4

import discord

from discord.ext import commands


from discord.ui import Select, Button, View

# Manually define emojis using their IDs


EMOJI_INFO = "<:info:1348290096620638362>"
EMOJI_TICK = "<:tick_tick:1348271801481826315>"
EMOJI_CROSS = "<a:cross_cross:1348070723243216946>"
EMOJI_PARTNER = "<a:partner:1345899310511816750>"
EMOJI_ANTINUKE = "<:antinuke:1345897693808951416>"
EMOJI_AUTOMOD = "<:Automod:1345897951381164183>"
EMOJI_FUN = "<a:trick_supreme:1344331473922297867>"
EMOJI_GIVEAWAY = "<a:unnamed_emoji:1343351495394988094>"
EMOJI_MODERATION = "<:moderation:1345901513515728927>"
EMOJI_UTILITY = "<:OG_Commands:1345901067266691192>"
EMOJI_TICKET = "<a:ticket:1345901724585427004>"
EMOJI_ROLES = "<:roles1:1345902183140556860>"
EMOJI_MIC = "<a:mic:1345902292670480384>"
EMOJI_AUTOREACT = "<:Autoreact:1345902215356747828>"
EMOJI_TRANSLATE = "<:translate:1346853740904317028>"

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

@commands.command(name="help")
async def help_command(self, ctx):
await self.send_help_message(ctx)

async def send_help_message(self, ctx):


async def get_main_embed():
embed = discord.Embed(
title=f"{EMOJI_PARTNER} Azynox Help Panel",
description=(
f"{EMOJI_INFO} **Prefix on this server:** `?`\n"
f"{EMOJI_INFO} Type `?help <category>` for more info\n"
f"{EMOJI_INFO} **Total commands:** 85\n\n"
f"{EMOJI_PARTNER} **Main Categories**\n\n"
f"{EMOJI_ANTINUKE} **Antinuke**\n"
f"{EMOJI_AUTOMOD} **Automod**\n"
f"{EMOJI_FUN} **Fun**\n"
f"{EMOJI_GIVEAWAY} **Giveaway**\n"
f"{EMOJI_CROSS} **Ignore**\n" # Changed to EMOJI_CROSS
f"{EMOJI_MODERATION} **Moderation**\n"
f"{EMOJI_UTILITY} **Utility**\n"
f"{EMOJI_TICKET} **Ticket**\n"
f"{EMOJI_ROLES} **Custom Roles**\n"
f"{EMOJI_MIC} **TempVoice**\n"
f"{EMOJI_AUTOREACT} **Autoreact**\n"
f"{EMOJI_TRANSLATE} **Translate**"
),
color=discord.Color.random()
)
embed.set_footer(text=f"Requested by {ctx.author}",
icon_url=ctx.author.avatar.url)
embed.set_thumbnail(url=self.bot.user.avatar.url)
return embed

main_embed = await get_main_embed()


# Convert custom emojis to PartialEmoji objects
antinuke_emoji = discord.PartialEmoji.from_str(EMOJI_ANTINUKE)
automod_emoji = discord.PartialEmoji.from_str(EMOJI_AUTOMOD)
fun_emoji = discord.PartialEmoji.from_str(EMOJI_FUN)
giveaway_emoji = discord.PartialEmoji.from_str(EMOJI_GIVEAWAY)
moderation_emoji = discord.PartialEmoji.from_str(EMOJI_MODERATION)
utility_emoji = discord.PartialEmoji.from_str(EMOJI_UTILITY)
ticket_emoji = discord.PartialEmoji.from_str(EMOJI_TICKET)
roles_emoji = discord.PartialEmoji.from_str(EMOJI_ROLES)
mic_emoji = discord.PartialEmoji.from_str(EMOJI_MIC)
autoreact_emoji = discord.PartialEmoji.from_str(EMOJI_AUTOREACT)
translate_emoji = discord.PartialEmoji.from_str(EMOJI_TRANSLATE)

# Use EMOJI_CROSS for the Ignore option


ignore_emoji = discord.PartialEmoji.from_str(EMOJI_CROSS)

options = [
discord.SelectOption(label="Home", emoji="🏠", description="Go back to
the main help menu"),
discord.SelectOption(label="Antinuke", emoji=antinuke_emoji,
description="View Antinuke commands"),
discord.SelectOption(label="Automod", emoji=automod_emoji,
description="View Automod commands"),
discord.SelectOption(label="Fun", emoji=fun_emoji, description="View
Fun commands"),
discord.SelectOption(label="Giveaway", emoji=giveaway_emoji,
description="View Giveaway commands"),
discord.SelectOption(label="Ignore", emoji=ignore_emoji,
description="View Ignore commands"), # Changed to EMOJI_CROSS
discord.SelectOption(label="Moderation", emoji=moderation_emoji,
description="View Moderation commands"),
discord.SelectOption(label="Utility", emoji=utility_emoji,
description="View Utility commands"),
discord.SelectOption(label="Ticket", emoji=ticket_emoji,
description="View Ticket commands"),
discord.SelectOption(label="Custom Roles", emoji=roles_emoji,
description="View Custom Roles commands"),
discord.SelectOption(label="TempVoice", emoji=mic_emoji,
description="View TempVoice commands"),
discord.SelectOption(label="Autoreact", emoji=autoreact_emoji,
description="View Autoreact commands"),
discord.SelectOption(label="Translate", emoji=translate_emoji,
description="View Translate commands"),
]

select = Select(placeholder="Select a category...", options=options)

async def select_callback(interaction: discord.Interaction):


selected_category = interaction.data["values"][0]

if selected_category == "Home":
await interaction.response.edit_message(embed=main_embed,
view=view)
return

category_commands = {
"Antinuke": """
?antinuke on → Enable Antinuke protection
?antinuke off → Disable Antinuke protection
?wl @user → Whitelist a user
?lc #channel → Set log channel
""",
"Automod": """
?automod on → Enable Automod
?automod off → Disable Automod
?blacklist word → Add a word to the blacklist
?whitelist word → Remove a word from the blacklist
""",
"Fun": """
?roast @user → Roast a user
?joke → Get a random joke
?fact → Get a random fun fact
?avatar @user → Show a user's avatar
?coinflip → Flip a coin
?8ball <question> → Ask the magic 8-ball
""",
"Giveaway": """
?giveaway start → Start a giveaway
?giveaway reroll → Reroll a giveaway
?giveaway end → End a giveaway
""",
"Ignore": """
?ignore channel → Ignore a channel
?unignore channel → Unignore a channel
""",
"Moderation": """
?ban @user → Ban a user
?unban userID → Unban a user
?kick @user → Kick a user
?mute @user → Mute a user
?unmute @user → Unmute a user
?purge 10 → Delete 10 messages
?purge user @user 10 → Delete 10 messages from a user
?purge bots → Delete bot messages
""",
"Utility": """
?afk <reason> → Set AFK status
?role @user @role → Add/remove a role
?rolelist @role → List members with a role
?roleicon @role <emoji> → Set a role icon
?data @user → Get user info
?badges → Show your badges
?ping → Check bot's latency
?prefix → Show current bot prefix
?prefix set <prefix> → Change bot prefix
?stats → Show bot statistics
?steal <emoji> → Steal an emoji
""",
"Ticket": """
?ticket create → Create a ticket
?ticket close → Close a ticket
?ticket add @user → Add a user to a ticket
?ticket remove @user → Remove a user from a ticket
""",
"Custom Roles": """
?role create <name> → Create a custom role
?role delete <role> → Delete a custom role
?role color <role> <hex> → Change a role's color
""",
"TempVoice": """
?voice create → Create a temporary voice channel
?voice limit <number> → Set a user limit
?voice name <name> → Change the channel name
""",
"Autoreact": """
?autoreact add <trigger> <emoji> → Add an auto-reaction
?autoreact remove <trigger> → Remove an auto-reaction
?autoreact list → List all auto-reactions
""",
"Translate": """
?translate <language> <text> → Translate text
?translate list → List supported languages
"""
}

new_embed = discord.Embed(
title=f"{selected_category} Commands",
description=category_commands[selected_category],
color=discord.Color.random()
)
await interaction.response.edit_message(embed=new_embed, view=view)

select.callback = select_callback

button_invite = Button(label="Invite Me",


url="https://discord.com/oauth2/authorize?
client_id=YOUR_CLIENT_ID&permissions=8&scope=bot")
button_support = Button(label="Support",
url="https://discord.gg/YOUR_SUPPORT_SERVER", style=discord.ButtonStyle.link)

view = View()
view.add_item(select)
view.add_item(button_invite)
view.add_item(button_support)

await ctx.send(embed=main_embed, view=view)

async def setup(bot):


await bot.add_cog(Help(bot))

You might also like