Reformatting help command

Still need to make method more efficient
pull/8/head
sgoudham 4 years ago
parent 3b3bb44dcb
commit a3d51c79d8

@ -4,18 +4,18 @@ from discord import Embed
from discord.ext import commands, menus from discord.ext import commands, menus
from discord.ext.commands import command from discord.ext.commands import command
from settings import enso_embedmod_colours, hammyMention from settings import enso_embedmod_colours
# Function to allow pages 1-4 of the help commands (Fun Commands) # Pages of the help embed
def fun_function(self, guild_icon): def help_menu(self, guild_icon):
# Setting up the Embed for the Fun Commands # Setting up the embed for the Fun Commands
fun_commands = Embed(title="(っ◔◡◔)っ Fun (っ◔◡◔)っ", fun = Embed(title="(っ◔◡◔)っ Fun (っ◔◡◔)っ",
colour=enso_embedmod_colours, colour=enso_embedmod_colours,
timestamp=datetime.datetime.utcnow()) timestamp=datetime.datetime.utcnow())
# Setting thumbnail and author # Setting thumbnail and author
fun_commands.set_thumbnail(url=guild_icon) fun.set_thumbnail(url=guild_icon)
# Setting up the fields in a separate array # Setting up the fields in a separate array
fun_fields = [ fun_fields = [
@ -23,25 +23,25 @@ def fun_function(self, guild_icon):
"\nCompliment a person in the server", True), "\nCompliment a person in the server", True),
(f"**{self.ctx.prefix}8ball `<text>`**", (f"**{self.ctx.prefix}8ball `<text>`**",
"\nAsk a question and 8ball will give a custom response", True), "\nAsk a question and 8ball will give a custom response", True),
(f"**{self.ctx.prefix}flip**",
"\nDoes a coinflip with Big PP Or Smol PP", True),
(f"**{self.ctx.prefix}doggo**",
"\nLook at images of Doggos", True),
(f"**{self.ctx.prefix}homies `<text>`**", (f"**{self.ctx.prefix}homies `<text>`**",
"\nGenerates Homies Meme with given text", True), "\nGenerates homies meme with given text", True),
(f"**{self.ctx.prefix}owo `<text>`**", (f"**{self.ctx.prefix}owo `<text>`**",
"\nTranslates given text to 'owo' format", True)] "\nTranslates given text to 'owo' format", True),
(f"**{self.ctx.prefix}flip**",
"\nDoes a coinflip with big pp Or smol pp", True),
(f"**{self.ctx.prefix}doggo**",
"\nLook at images of Doggos", True)]
# Setting up the Embed for the Fun Commands # Setting up the embed for the Fun Commands
fun_commands_2 = Embed(title="(っ◔◡◔)っ Interactive (っ◔◡◔)っ", interactive = Embed(title="(っ◔◡◔)っ Interactive (っ◔◡◔)っ",
colour=enso_embedmod_colours, colour=enso_embedmod_colours,
timestamp=datetime.datetime.utcnow()) timestamp=datetime.datetime.utcnow())
# Setting thumbnail and author # Setting thumbnail and author
fun_commands_2.set_thumbnail(url=guild_icon) interactive.set_thumbnail(url=guild_icon)
# Setting up the fields in a separate array # Setting up the fields in a separate array
fun_fields_2 = [ interactive_fields = [
(f"**{self.ctx.prefix}hug `<person>`**", (f"**{self.ctx.prefix}hug `<person>`**",
"\nHug a User Within The Server", True), "\nHug a User Within The Server", True),
(f"**{self.ctx.prefix}cuddle `<person>`**", (f"**{self.ctx.prefix}cuddle `<person>`**",
@ -53,16 +53,16 @@ def fun_function(self, guild_icon):
(f"**{self.ctx.prefix}lemon `<person>`**", (f"**{self.ctx.prefix}lemon `<person>`**",
"\nGive lemon to a User Within The Server", True)] "\nGive lemon to a User Within The Server", True)]
# Setting up the Embed for the Fun Commands # Setting up the embed for the Fun Commands
fun_commands_3 = Embed(title="(っ◔◡◔)っ Interactive 2 (っ◔◡◔)っ", interactive_2 = Embed(title="(っ◔◡◔)っ Interactive 2 (っ◔◡◔)っ",
colour=enso_embedmod_colours, colour=enso_embedmod_colours,
timestamp=datetime.datetime.utcnow()) timestamp=datetime.datetime.utcnow())
# Setting thumbnail and author # Setting thumbnail and author
fun_commands_3.set_thumbnail(url=guild_icon) interactive_2.set_thumbnail(url=guild_icon)
# Setting up the fields in a separate array # Setting up the fields in a separate array
fun_fields_3 = [ interactive_fields_2 = [
(f"**{self.ctx.prefix}slap `<person>`**", (f"**{self.ctx.prefix}slap `<person>`**",
"\nSlap a User Within The Server", True), "\nSlap a User Within The Server", True),
(f"**{self.ctx.prefix}kill `<person>`**", (f"**{self.ctx.prefix}kill `<person>`**",
@ -70,104 +70,151 @@ def fun_function(self, guild_icon):
(f"**{self.ctx.prefix}choke `<person>`**", (f"**{self.ctx.prefix}choke `<person>`**",
"\nChoke a User Within The Server", True)] "\nChoke a User Within The Server", True)]
# Setting up the Embed for the Fun Commands # Setting up the embed for Relationship commands
fun_commands_4 = Embed(title="(っ◔◡◔)っ Relationship (っ◔◡◔)っ", relationship = Embed(title="(っ◔◡◔)っ Relationship (っ◔◡◔)っ",
colour=enso_embedmod_colours, colour=enso_embedmod_colours,
timestamp=datetime.datetime.utcnow()) timestamp=datetime.datetime.utcnow())
# Setting thumbnail and author # Setting thumbnail and author
fun_commands_4.set_thumbnail(url=guild_icon) relationship.set_thumbnail(url=guild_icon)
# Setting up the fields in a separate array # Setting up the fields in a separate array
fun_fields_4 = [ relationship_fields = [
(f"**{self.ctx.prefix}marry `<person>`**", (f"**{self.ctx.prefix}marry `<person>`**",
"\nMarry a User Within The Server", True), "\nMarry a User Within The Server", True),
(f"**{self.ctx.prefix}divorce `<person>`**", (f"**{self.ctx.prefix}divorce `<person>`**",
"\nDivorce The Person You Are Married To", False), "\nDivorce The Person You Are Married To", False),
(f"**{self.ctx.prefix}minfo `<person>`**", (f"**{self.ctx.prefix}minfo `<person>`**",
"\nDisplays information about the user's current marriage" + "\nDisplays information about the user's current marriage" +
f"Using {self.ctx.prefix}minfo by itself will retrieve your marriage information", True)] f"\nUsing **{self.ctx.prefix}minfo** by itself will retrieve your marriage information", True)]
# Add the fun_commands fields to the embed # Setting up the Embed for the Enso commands
for name, value, inline in fun_fields: enso = Embed(title="(っ◔◡◔)っ Enso (っ◔◡◔)っ",
fun_commands.add_field(name=name, value=value, inline=inline) colour=enso_embedmod_colours,
timestamp=datetime.datetime.utcnow())
# Add the fun_commands_2 fields to the embed
for name, value, inline in fun_fields_2:
fun_commands_2.add_field(name=name, value=value, inline=inline)
# Add the fun_commands_3 fields to the embed
for name, value, inline in fun_fields_3:
fun_commands_3.add_field(name=name, value=value, inline=inline)
# Add the fun_commands_4 fields to the embed # Setting thumbnail and author
for name, value, inline in fun_fields_4: enso.set_thumbnail(url=guild_icon)
fun_commands_4.add_field(name=name, value=value, inline=inline)
return fun_commands, fun_commands_2, fun_commands_3, fun_commands_4
# Setting up the fields in a separate array
enso_fields = [
(f"**{self.ctx.prefix}enso `<person>`**",
"\nShows Specified Image of User" +
f"\n(Using **{self.ctx.prefix}enso** by itself shows random image of )",
True),
(f"**{self.ctx.prefix}enso `list`**",
"\nReturns all Users", False),
(f"**{self.ctx.prefix}rules**",
"\nFull ruleset for Enso", True),
(f"**{self.ctx.prefix}roles**",
"\nLeveling and xp system in Enso", True),
]
# Function to allow the second page of the help commands (Waifu/Husbandos) # Setting up the embed for the Waifu/Husbandos
def waifu_husbando_function(self, guild_icon): waifu_and_husbando = Embed(title="(っ◔◡◔)っ Waifu/Husbando Commands (っ◔◡◔)っ",
# Setting up the Embed for the Waifu/Husbandos colour=enso_embedmod_colours,
waifu_husbando_commands = Embed(title="(っ◔◡◔)っ Waifus/Husbando Commands (っ◔◡◔)っ", timestamp=datetime.datetime.utcnow())
colour=enso_embedmod_colours,
timestamp=datetime.datetime.utcnow())
# Setting thumbnail and author # Setting thumbnail and author
waifu_husbando_commands.set_thumbnail(url=guild_icon) waifu_and_husbando.set_thumbnail(url=guild_icon)
# Setting up the fields in a separate array # Setting up the fields in a separate array
waifu_husbando_fields = [ waifu_and_husbando_fields = [
(f"**{self.ctx.prefix}w `list`**",
"\nReturns all Waifus", True),
(f"**{self.ctx.prefix}h `list`**",
"\nReturns all Husbandos", True),
(f"**{self.ctx.prefix}w `<waifu>`**", (f"**{self.ctx.prefix}w `<waifu>`**",
"\nShows Specified Image of Waifu" + "\nShows Specified Image of Waifu" +
f"\n(Using **{self.ctx.prefix}w shows random image of Waifu)", True), f"\n(Using **{self.ctx.prefix}w** shows random image of Waifu)", True),
(f"**{self.ctx.prefix}h `<husbando>`**", (f"**{self.ctx.prefix}h `<husbando>`**",
"\nShows Specified Image of Husbando" + "\nShows Specified Image of Husbando" +
f"\n(Using **{self.ctx.prefix}h shows random image of Husbando", True)] f"\n(Using **{self.ctx.prefix}h** shows random image of Husbando)", False),
(f"**{self.ctx.prefix}w `list`**",
"\nReturns all Waifus", True),
(f"**{self.ctx.prefix}h `list`**",
"\nReturns all Husbandos", True)]
# Add the waifu_husbando_commands fields to the embed # Setting up the embed for the Important Commands
for name, value, inline in waifu_husbando_fields: important = Embed(title="(っ◔◡◔)っ Important (っ◔◡◔)っ",
waifu_husbando_commands.add_field(name=name, value=value, inline=inline) colour=enso_embedmod_colours,
timestamp=datetime.datetime.utcnow())
return waifu_husbando_commands # Setting thumbnail and author
important.set_thumbnail(url=guild_icon)
# Setting up the fields in a separate array
important_fields = [
(f"**{self.ctx.prefix}userinfo**",
"\nReturns information about the user", True),
(f"**{self.ctx.prefix}serverinfo**",
"\nReturns information about the server", True),
(f"**{self.ctx.prefix}help**",
"\nSee every command in the bot", True)]
# Function to allow the fifth page of the help commands (~enso commands) # Setting up the embed for modmail
def _enso(self, guild_icon): modmail = Embed(title="(っ◔◡◔)っ ModMail (っ◔◡◔)っ",
# Setting up the Embed for the ~Enso command colour=enso_embedmod_colours,
_enso_commands = Embed(title="(っ◔◡◔)っ Enso (っ◔◡◔)っ", timestamp=datetime.datetime.utcnow())
colour=enso_embedmod_colours,
timestamp=datetime.datetime.utcnow())
# Setting thumbnail and author # Setting thumbnail and author
_enso_commands.set_thumbnail(url=guild_icon) modmail.set_thumbnail(url=guild_icon)
# Setting up the fields in a separate array # Setting up the fields in a separate array
_enso_fields = [ modmail_fields = [(f"**{self.ctx.prefix}mmsetup setup modmail `<channelID>`**",
(f"**{self.ctx.prefix}rules**", "Sets up the modmail system in the guild,"
"\nFull ruleset for Enso", True), "channelID given will be the channel that the user will interact with", False),
(f"**{self.ctx.prefix}roles**", (f"**{self.ctx.prefix}mmsetup update modmail `<channelID>`**",
"\nLeveling and xp system in Enso", True), "Updates the channel that the modmail will be sent to", False),
(f"**{self.ctx.prefix}enso `<person>`**", (f"**{self.ctx.prefix}mmsetup delete modmail**",
"\nShows Specified Image of User" + "Existing modmail system will be deleted", False)]
f"\n(Using {self.ctx.prefix}enso by itself shall generate a random image of a person within all the server)",
True), """ fields = [fun_fields, interactive_fields, interactive_fields_2,
(f"**{self.ctx.prefix}enso `list`**", relationship_fields, enso_fields, waifu_and_husbando_fields,
"\nReturns all Users", True)] important_fields, modmail_fields]
embeds = [fun, interactive, interactive_2,
relationship, enso, waifu_and_husbando,
important, modmail]
for embed in embeds:
for field in fields:
# Add fields to the embed
for name, value, inline in field:
embed.add_field(name=name, value=value, inline=inline)"""
# Add fields to the embed
for name, value, inline in fun_fields:
fun.add_field(name=name, value=value, inline=inline)
# Add fields to the embed
for name, value, inline in interactive_fields:
interactive.add_field(name=name, value=value, inline=inline)
# Add fields to the embed
for name, value, inline in interactive_fields_2:
interactive_2.add_field(name=name, value=value, inline=inline)
# Add fields to the embed
for name, value, inline in relationship_fields:
relationship.add_field(name=name, value=value, inline=inline)
# Add fields to the embed
for name, value, inline in enso_fields:
enso.add_field(name=name, value=value, inline=inline)
# Add the _enso_commands fields to the embed # Add fields to the embed
for name, value, inline in _enso_fields: for name, value, inline in waifu_and_husbando_fields:
_enso_commands.add_field(name=name, value=value, inline=inline) waifu_and_husbando.add_field(name=name, value=value, inline=inline)
return _enso_commands # Add fields to the embed
for name, value, inline in important_fields:
important.add_field(name=name, value=value, inline=inline)
# Add fields to the embed
for name, value, inline in modmail_fields:
modmail.add_field(name=name, value=value, inline=inline)
return fun, interactive, interactive_2, relationship, \
enso, waifu_and_husbando, important, modmail
# Function to allow the third page of the help commands (Miscellaneous) # Page 9
def misc_function(self, guild_icon): def misc_function(self, guild_icon):
# Setting up the Embed for the Miscellaneous commands # Setting up the Embed for the Miscellaneous commands
misc_commands = Embed(title="(っ◔◡◔)っ Misc (っ◔◡◔)っ", misc_commands = Embed(title="(っ◔◡◔)っ Misc (っ◔◡◔)っ",
@ -182,76 +229,32 @@ def misc_function(self, guild_icon):
(f"**{self.ctx.prefix}ping**", (f"**{self.ctx.prefix}ping**",
"\nReturns latency in ms", True), "\nReturns latency in ms", True),
(f"**{self.ctx.prefix}dm `<person>`**", (f"**{self.ctx.prefix}dm `<person>`**",
f"\nFor {hammyMention} to DM Users" + f"\nFor admins to DM Users" +
"\n**(Perms: Co-Owner)**", True), "\n**(Perms: Co-Owner)**", True),
(f"**{self.ctx.prefix}remindme `<time>` `<text>`**", (f"**{self.ctx.prefix}remindme `<time>` `<text>`**",
"\nGet Enso~Chan to remind you in DMs", True)] "\nGet Enso~Chan to remind you in DMs", True)]
# Add the misc_commands fields to the embed # Add fields to the embed
for name, value, inline in misc_fields: for name, value, inline in misc_fields:
misc_commands.add_field(name=name, value=value, inline=inline) misc_commands.add_field(name=name, value=value, inline=inline)
return misc_commands return misc_commands
def modmailEmbed(self, guild_icon):
# Setting up the Embed for the Miscellaneous commands
modmailPage = Embed(title="(っ◔◡◔)っ ModMail (っ◔◡◔)っ",
colour=enso_embedmod_colours,
timestamp=datetime.datetime.utcnow())
# Setting thumbnail and author
modmailPage.set_thumbnail(url=guild_icon)
# Setting up the fields in a separate array
misc_fields = [(f"**{self.ctx.prefix}", "", True)]
# Add the misc_commands fields to the embed
for name, value, inline in misc_fields:
modmailPage.add_field(name=name, value=value, inline=inline)
return modmailPage
# Function to allow the fourth page of the help commands (Important)
def important_function(self, guild_icon):
# Setting up the Embed for the Important Commands
important_commands = Embed(title="(っ◔◡◔)っ Important (っ◔◡◔)っ",
colour=enso_embedmod_colours,
timestamp=datetime.datetime.utcnow())
# Setting thumbnail and author
important_commands.set_thumbnail(url=guild_icon)
# Setting up the fields in a separate array
important_fields = [
(f"**{self.ctx.prefix}userinfo**",
"\nReturns information about the user", True),
(f"**{self.ctx.prefix}serverinfo**",
"\nReturns information about the server", True),
(f"**{self.ctx.prefix}help**",
"\nSee every command in the bot", True)]
# Add the important_fields to the embed
for name, value, inline in important_fields:
important_commands.add_field(name=name, value=value, inline=inline)
return important_commands
def embeds(self): def embeds(self):
# Define guild icon # Define guild icon
guild_icon = self.ctx.guild.icon_url guild_icon = self.ctx.guild.icon_url
# Set the different pages of the embed # Set the different pages of the embed
page1, page2, page3, page4 = fun_function(self, guild_icon) page1, page2, page3, \
page5 = _enso(self, guild_icon) page4, page5, page6, \
page6 = waifu_husbando_function(self, guild_icon) page7, page8 = help_menu(self, guild_icon)
page7 = misc_function(self, guild_icon) page9 = misc_function(self, guild_icon)
page8 = important_function(self, guild_icon)
# Store all the categories of the menu to an array called pages # Store all the categories of the menu to an array called pages
pages = [page1, page2, page3, page4, page5, page6, page7, page8] pages = [page1, page2, page3,
page4, page5, page6,
page7, page8, page9]
return pages return pages
@ -339,7 +342,7 @@ class ReactionMenu(commands.Cog):
self.bot = bot self.bot = bot
self.bot.remove_command("help") self.bot.remove_command("help")
@command(name="help", aliases=["Help"]) @command(name="help3", aliases=["Help"])
async def help(self, ctx): async def help(self, ctx):
"""Returns a menu for help commands controlled by reactions""" """Returns a menu for help commands controlled by reactions"""

Loading…
Cancel
Save