Skip to content

Commit

Permalink
v0.1.6-b
Browse files Browse the repository at this point in the history
  • Loading branch information
Hamziee committed Feb 27, 2024
1 parent 1ceacbe commit 86c6666
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 47 deletions.
90 changes: 46 additions & 44 deletions commands/help.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,58 +2,60 @@
from discord.ext import commands
from discord import app_commands
import config
prefix = config.PREFIX
PREFIX = config.PREFIX
MIA_VERSION = config.MIA_VERSION

class Buttons(discord.ui.View):
def __init__(self, *, timeout=180):
super().__init__(timeout=timeout)

# General
@discord.ui.button(label="General",style=discord.ButtonStyle.primary)
async def general_button(self, interaction: discord.Interaction, button: discord.ui.Button):
embed = discord.Embed(
color=discord.Colour.blurple(),
title="Mia | General Commands",
description="Here is some information about my commands :)")
embed.add_field(name='/help', value='Shows up this.', inline=False)
embed.add_field(name='/about', value='Some information about me!', inline=False)
embed.add_field(name='/chat', value='Chat with my AI!', inline=False)
embed.set_footer(text=f"Mia | version: {MIA_VERSION}", icon_url="https://cdn.discordapp.com/avatars/1209925239652356147/38e76bc9070eb00f2493b6edeab22b33.webp")
await interaction.response.defer()
await interaction.edit_original_response(embed=embed, view=Buttons())

# Music
@discord.ui.button(label="Music",style=discord.ButtonStyle.primary)
async def music_button(self, interaction: discord.Interaction, button: discord.ui.Button):
embed = discord.Embed(
color=discord.Colour.blurple(),
title="Music | General Commands",
description="Here is some Information about my music commands :)")
embed.add_field(name=f'{PREFIX}leave, {PREFIX}l, {PREFIX}disconnect', value='Clears the queue and leaves the voice channel.', inline=False)
embed.add_field(name=f'{PREFIX}now, {PREFIX}current, {PREFIX}playing', value='Displays the currently playing song.', inline=False)
embed.add_field(name=f'{PREFIX}pause, {PREFIX}pa', value='Pauses the currently playing song.', inline=False)
embed.add_field(name=f'{PREFIX}resume, {PREFIX}r', value='Resumes a currently paused song.', inline=False)
embed.add_field(name=f'{PREFIX}stop, {PREFIX}st, {PREFIX}close', value='Stops playing song and clears the queue.', inline=False)
embed.add_field(name=f'{PREFIX}skip, {PREFIX}s, {PREFIX}sk', value='Vote to skip a song. The requester can automatically skip.', inline=False)
embed.add_field(name=f'{PREFIX}queue, {PREFIX}q', value='Shows the queue. You can optionally specify the page to show. Each page contains 10 songs.', inline=False)
embed.add_field(name=f'{PREFIX}remove', value='Removes a song from the queue at a given index.', inline=False)
embed.add_field(name=f'{PREFIX}play, {PREFIX}p', value='Plays a song.', inline=False)
embed.set_footer(text=f"Mia | version: {MIA_VERSION}", icon_url="https://cdn.discordapp.com/avatars/1209925239652356147/38e76bc9070eb00f2493b6edeab22b33.webp")
await interaction.response.defer()
await interaction.edit_original_response(embed=embed, view=Buttons())

class help(commands.Cog):
def __init__(self, client: commands.Bot):
self.client = client

@app_commands.command(name="help", description="Information about my commands.")
@app_commands.rename(category='category')
@app_commands.describe(category='Specify a category of the help command. (general, music)')
async def help(self, interaction: discord.Interaction, category: str):
if category == 'music'.lower():
try:
embed = discord.Embed(
color=discord.Colour.blurple(),
title="Hi I'm Mia! <:MIA_CatBlush:1210004576082853939>",
description="Here is some Information about my music commands :)")
embed.add_field(name='Music', value=
f"""**{prefix}leave, {prefix}l, {prefix}disconnect** - Clears the queue and leaves the voice channel.
**{prefix}now, {prefix}current, {prefix}playing** - Displays the currently playing song.
**{prefix}pause, {prefix}pa** - Pauses the currently playing song.
**{prefix}resume, {prefix}r** - Resumes a currently paused song.
**{prefix}stop, {prefix}st, {prefix}close** - Stops playing song and clears the queue.
**{prefix}skip, {prefix}s, {prefix}sk** - Vote to skip a song. The requester can automatically skip.
**{prefix}queue, {prefix}q** - Shows the player's queue. You can optionally specify the page to show. Each page contains 10 songs.
**{prefix}remove** - Removes a song from the queue at a given index.
**{prefix}play, {prefix}p** - Plays a song.""", inline=False)
embed.add_field(name='Other commands', value=
""" Run **/help** for all the other commands.""", inline=False)
embed.set_footer(text=f"Mia | version: {MIA_VERSION}", icon_url="https://cdn.discordapp.com/avatars/1209925239652356147/38e76bc9070eb00f2493b6edeab22b33.webp")
await interaction.response.send_message(embed=embed)
except Exception as e:
print(e)
await interaction.followup.send(content='Error occured.')
else:
try:
embed = discord.Embed(
color=discord.Colour.blurple(),
title="Hi I'm Mia! <:MIA_CatBlush:1210004576082853939>",
description="Here is some information about my commands :)")
embed.add_field(name='General', value=
"""**/help** - Shows up this.
**/about** - Some information about me!
**/chat** - Chat with my AI!""", inline=False)
embed.add_field(name='Music commands', value=
""" Run **/help music** for information about all my music commands.""", inline=False)
embed.set_footer(text=f"Mia | version: {MIA_VERSION}", icon_url="https://cdn.discordapp.com/avatars/1209925239652356147/38e76bc9070eb00f2493b6edeab22b33.webp")
await interaction.response.send_message(embed=embed)
except Exception as e:
print(e)
await interaction.followup.send(content='Error occured.')
async def help(self, interaction: discord.Interaction):
embed = discord.Embed(
color=discord.Colour.blurple(),
title="Hi I'm Mia! <:MIA_CatBlush:1210004576082853939>",
description="Choose a category below.")
embed.set_footer(text=f"Mia | version: {MIA_VERSION}", icon_url="https://cdn.discordapp.com/avatars/1209925239652356147/38e76bc9070eb00f2493b6edeab22b33.webp")
await interaction.response.send_message(embed=embed, view=Buttons())


async def setup(client:commands.Bot) -> None:
await client.add_cog(help(client))
2 changes: 1 addition & 1 deletion ex_config (change me to config.py).py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
MIA_VERSION='v0.1.5-b' # Do not change this, it will help with troubleshooting later
MIA_VERSION='v0.1.6-b' # Do not change this, it will help with troubleshooting later

PREFIX = '$' # deprecated, only used for admin and music commands.
OWNER_ID = 496673945211240462 # used for admin commands and ChatAI recognition.
Expand Down
2 changes: 0 additions & 2 deletions todo.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
fix help command instead of typing make buttons

add make embeds command

0 comments on commit 86c6666

Please sign in to comment.