Add help command

This commit is contained in:
Parker M. 2024-04-02 17:38:40 -05:00
parent 8a4b8c3998
commit 437d768e55
No known key found for this signature in database
GPG Key ID: 95CD2E0C7E329F2A

89
code/cogs/help.py Normal file
View File

@ -0,0 +1,89 @@
import discord
from discord.ext import commands
import re
from discord import app_commands
from global_variables import BOT_COLOR, BOT_INVITE_LINK
class InviteButton(discord.ui.View):
def __init__(self, timeout=180.0):
super().__init__(timeout=timeout)
self.value = None
self.add_item(discord.ui.Button(label="Invite Me", url=BOT_INVITE_LINK, row=1))
class Help(commands.Cog):
def __init__(self, bot):
self.bot = bot
@app_commands.command()
async def help(self, interaction: discord.Interaction):
"Sends the bots commands"
embed = discord.Embed(
title=f":musical_note: Guava Help :musical_note:", color=BOT_COLOR
)
embed.add_field(
name="`/play <name/URL>`", value="Plays the requested song", inline=False
)
embed.add_field(
name="`/skip`",
value="Skips the song that is currently playing",
inline=False,
)
embed.add_field(
name="`/queue (page #)`",
value="Sends the songs currently in queue",
inline=False,
)
embed.add_field(
name="`/stop`",
value="Stops music, clears queue, and leaves VC",
inline=False,
)
embed.add_field(
name="`/np`", value="Sends the song that is currently playing", inline=False
)
embed.add_field(
name="`/clear`", value="Completely clears the queue", inline=False
)
embed.add_field(
name="`/remove <song #>`",
value="Removes the specified song from the queue",
inline=False,
)
embed.add_field(
name="`/repeat <song/queue/off>`",
value="Forever repeats the current song, queue, or turns repetition off",
inline=False,
)
embed.add_field(
name="`/shuffle <on/off>`",
value="Turns song shuffling on or off",
inline=False,
)
embed.add_field(
name="`/pause`", value="Pauses the currently playing song", inline=False
)
embed.add_field(name="`/resume`", value="Resumes the paused song", inline=False)
embed.add_field(
name="`/bug`",
value="Fill out a bug report to let the developer know of any issues",
inline=False,
)
embed.add_field(
name="`/feedback`",
value="Give the developer feedback about Guava",
inline=False,
)
embed.set_thumbnail(url=self.bot.user.avatar.url)
view = InviteButton()
await interaction.response.send_message(embed=embed, view=view, ephemeral=True)
async def setup(bot):
await bot.add_cog(Help(bot))