Skip to content

Commit

Permalink
Added documentation commands
Browse files Browse the repository at this point in the history
  • Loading branch information
MonzUn committed Jan 20, 2024
1 parent bb8d841 commit 7d90435
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
1 change: 1 addition & 0 deletions Commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ All Eco and Discord commands are case insensitive.
|----------------------------|---------------------|-------------------|-------------------------------------------------------------------------|-----------------|----------------------------------------------------------------------------------------------------------------------|
| Version | | Both | | User | Displays the installed and latest available plugin version. |
| About | | Both | | User | Displays information about the DiscordLink plugin. |
| Documentation | | Both | | User | Opens the documentation web page. |
| LinkInformation | | Both | | User | Presents information about account linking. |
| PluginStatus | | Both | Verbose (true/false) | Admin | Displays the plugin status. Displays more information if the verbose parameter is set to true. |
| ListLinkedChannels | | Both | | Admin | Presents a list of all channel links. |
Expand Down
11 changes: 11 additions & 0 deletions DiscordLink/Source/Commands/DiscordCommands.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
using static Eco.Plugins.DiscordLink.Enums;
using static Eco.Plugins.DiscordLink.SharedCommands;
using static Eco.Plugins.DiscordLink.Utilities.MessageBuilder;
using Eco.Gameplay.Players;
using Eco.Gameplay.Systems.Messaging.Chat.Commands;

namespace Eco.Plugins.DiscordLink
{
Expand Down Expand Up @@ -287,6 +289,15 @@ public async Task About(InteractionContext ctx)
}, ctx);
}

[SlashCommand("Documentation", "Opens the documentation web page.")]
public async Task Documentation(InteractionContext ctx)
{
await ExecuteCommand<object>(PermissionType.User, async (lCtx, args) =>
{
await RespondToCommand(ctx, "The documentation can be found here: <https://github.com/Eco-DiscordLink/EcoDiscordPlugin>");
}, ctx);
}

[SlashCommand("PluginStatus", "Displays the current plugin status.")]
public async Task PluginStatus(InteractionContext ctx, [Option("Verbose", "Use verbose output with extra information.")] bool verbose = false)
{
Expand Down
9 changes: 9 additions & 0 deletions DiscordLink/Source/Commands/EcoCommands.cs
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,15 @@ public static async Task About(User callingUser)
}, callingUser);
}

[ChatSubCommand("DiscordLink", "Open the documentation web page", ChatAuthorizationLevel.User)]
public static async Task Documentation(User callingUser)
{
await ExecuteCommand<object>(async (lUser, args) =>
{
callingUser.OpenWebpage("https://github.com/Eco-DiscordLink/EcoDiscordPlugin");
}, callingUser);
}

[ChatSubCommand("DiscordLink", "Shows the plugin status.", ChatAuthorizationLevel.Admin)]
public static async Task PluginStatus(User callingUser, bool verbose = false)
{
Expand Down

0 comments on commit 7d90435

Please sign in to comment.