Skip to content

Commit 0648edb

Browse files
feat: (/cogs/general.py): Add !help command
1 parent 66bd698 commit 0648edb

File tree

1 file changed

+105
-1
lines changed

1 file changed

+105
-1
lines changed

src/gitcord/cogs/general.py

Lines changed: 105 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1204,11 +1204,115 @@ async def createcategory_error(self, ctx: commands.Context,
12041204
logger.error("Error in createcategory command: %s", error)
12051205
await ctx.send(f"An error occurred: {error}")
12061206

1207+
@commands.command(name='help')
1208+
async def help_prefix(self, ctx: commands.Context) -> None:
1209+
"""Prefix command to show help information and link to the wiki."""
1210+
embed = create_embed(
1211+
title="🤖 GitCord Help",
1212+
description="Welcome to GitCord! Here's how to get help and learn more about the bot.",
1213+
color=discord.Color.blue(),
1214+
author=ctx.author
1215+
)
1216+
1217+
embed.add_field(
1218+
name="📚 Documentation",
1219+
value="For detailed documentation, tutorials, and guides, visit our [Wiki](https://github.com/evolvewithevan/gitcord/wiki)\n"
1220+
"To see current issues, visit our [GitHub Issues](https://github.com/users/evolvewithevan/projects/4/views/1)",
1221+
inline=False
1222+
)
1223+
1224+
embed.add_field(
1225+
name="🔧 Available Commands",
1226+
value="• `!hello` - Get a friendly greeting\n"
1227+
"• `!help` - Show help information and link to the wiki (***YOU ARE HERE***)\n"
1228+
"• `!ping` - Check bot latency\n"
1229+
"• `!fetchurl <url>` - Fetch content from a URL (Admin only)\n"
1230+
"• `!createchannel` - Create a channel from YAML (Manage Channels)\n"
1231+
"• `!createcategory` - Create a category from YAML (Manage Channels)\n"
1232+
"• `!synccommands` - Sync slash commands (Admin only)",
1233+
inline=False
1234+
)
1235+
1236+
embed.add_field(
1237+
name="⚡ Slash Commands",
1238+
value="• `/slashping` - Check bot latency\n"
1239+
"• `/fetchurl <url>` - Fetch content from a URL (Admin only)\n"
1240+
"• `/createcategory [yaml_path]` - Create category from YAML (Manage Channels)\n"
1241+
"• `/synccommands` - Sync slash commands (Admin only)",
1242+
inline=False
1243+
)
1244+
1245+
embed.add_field(
1246+
name="🔗 Quick Links",
1247+
value="• [GitHub Repository](https://github.com/evolvewithevan/gitcord)\n"
1248+
"• [Github Project](https://github.com/users/evolvewithevan/projects/4/views/1)\n"
1249+
"• [Roadmap](https://github.com/users/evolvewithevan/projects/4/views/3)\n"
1250+
"• [Wiki Documentation](https://github.com/evolvewithevan/gitcord/wiki)\n"
1251+
"• [Security Policy](https://github.com/evolvewithevan/gitcord/blob/main/SECURITY.md)",
1252+
inline=False
1253+
)
1254+
1255+
embed.set_footer(text="GitCord - Discord bot for GitOps based server structure")
1256+
1257+
await ctx.send(embed=embed)
1258+
1259+
@app_commands.command(name="help", description="Show help information and link to the wiki")
1260+
async def help_slash(self, interaction: discord.Interaction) -> None:
1261+
"""Slash command to show help information and link to the wiki."""
1262+
embed = create_embed(
1263+
title="🤖 GitCord Help",
1264+
description="Welcome to GitCord! Here's how to get help and learn more about the bot.",
1265+
color=discord.Color.blue(),
1266+
author=interaction.user
1267+
)
1268+
1269+
embed.add_field(
1270+
name="📚 Documentation",
1271+
value="For detailed documentation, tutorials, and guides, visit our [Wiki](https://github.com/evolvewithevan/gitcord/wiki)\n"
1272+
"To see current issues, visit our [GitHub Issues](https://github.com/users/evolvewithevan/projects/4/views/1)",
1273+
inline=False
1274+
)
1275+
1276+
embed.add_field(
1277+
name="🔧 Available Commands",
1278+
value="• `!hello` - Get a friendly greeting\n"
1279+
"• `!help` - Show help information and link to the wiki (***YOU ARE HERE***)\n"
1280+
"• `!ping` - Check bot latency\n"
1281+
"• `!fetchurl <url>` - Fetch content from a URL (Admin only)\n"
1282+
"• `!createchannel` - Create a channel from YAML (Manage Channels)\n"
1283+
"• `!createcategory` - Create a category from YAML (Manage Channels)\n"
1284+
"• `!synccommands` - Sync slash commands (Admin only)",
1285+
inline=False
1286+
)
1287+
1288+
embed.add_field(
1289+
name="⚡ Slash Commands",
1290+
value="• `/slashping` - Check bot latency\n"
1291+
"• `/fetchurl <url>` - Fetch content from a URL (Admin only)\n"
1292+
"• `/createcategory [yaml_path]` - Create category from YAML (Manage Channels)\n"
1293+
"• `/synccommands` - Sync slash commands (Admin only)",
1294+
inline=False
1295+
)
1296+
1297+
embed.add_field(
1298+
name="🔗 Quick Links",
1299+
value="• [GitHub Repository](https://github.com/evolvewithevan/gitcord)\n"
1300+
"• [Github Project](https://github.com/users/evolvewithevan/projects/4/views/1)\n"
1301+
"• [Roadmap](https://github.com/users/evolvewithevan/projects/4/views/3)\n"
1302+
"• [Wiki Documentation](https://github.com/evolvewithevan/gitcord/wiki)\n"
1303+
"• [Security Policy](https://github.com/evolvewithevan/gitcord/blob/main/SECURITY.md)",
1304+
inline=False
1305+
)
1306+
1307+
embed.set_footer(text="GitCord - Discord bot for GitOps based server structure")
1308+
1309+
await interaction.response.send_message(embed=embed)
1310+
12071311
@commands.Cog.listener()
12081312
async def on_command_error(self, ctx: commands.Context, error: commands.CommandError) -> None:
12091313
"""Handle command errors."""
12101314
if isinstance(error, commands.CommandNotFound):
1211-
await ctx.send("Command not found. Try `!hello` or `!ping`!")
1315+
await ctx.send("Command not found. Try `!help` or `!ping`!")
12121316
else:
12131317
logger.error("Command error in %s: %s", ctx.command, error)
12141318
await ctx.send(f"An error occurred: {error}")

0 commit comments

Comments
 (0)