Guilded.Commands 1.7.1

dotnet add package Guilded.Commands --version 1.7.1
NuGet\Install-Package Guilded.Commands -Version 1.7.1
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Guilded.Commands" Version="1.7.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Guilded.Commands --version 1.7.1
#r "nuget: Guilded.Commands, 1.7.1"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Guilded.Commands as a Cake Addin
#addin nuget:?package=Guilded.Commands&version=1.7.1

// Install Guilded.Commands as a Cake Tool
#tool nuget:?package=Guilded.Commands&version=1.7.1

🟡 Guilded.Commands

Adds the ability for Guilded.NET clients to process text commands.

📥 Installing

You can run this command to add Guilded.NET commands to an existing .NET project:

# If you haven't installed Guilded yet
dotnet add package Guilded
# To install Guilded.Commands
dotnet add package Guilded.Commands

Otherwise, you can use Guilded.NET commands from a template while creating a new Guilded.NET projects:

dotnet new -i Guilded.Templates
dotnet new guilded.command

⚙️ Using Guilded.NET commands

You can check out commands page in Guilded.NET's docs to get started with Guilded.NET commands.

It is recommended to use .NET 6 or above for Guilded.NET Commands and Guilded.NET. While all Guilded.NET packages support .NET 5 for now, this will definitely change in the future.

📙 Example

Here's a quick example of a starter Guilded.NET bot with a few commands using Guilded.NET commands:

// Program.cs
using System.Reactive.Linq;
using Guilded;
using ProjectName;

string auth   = "your_bots_auth_token",
       prefix = "!";

await using var client = new GuildedBotClient(auth).AddCommands(new BotCommands(), prefix);

client
    .Prepared
    .Subscribe(me =>
        Console.WriteLine("The bot is prepared!\nLogged in as \"{0}\" with the ID \"{1}\"", me.Name, me.Id)
    );

await client.ConnectAsync();

// Don't close the program when the bot connects; not recommended to put code after this
await Task.Delay(-1);
// BotCommands.cs
using Guilded;
using Guilded.Commands;

namespace ProjectName;

public partial class BotCommands : CommandModule
{
    [Command(Aliases = new string[] { "p" })]
    public static Task Ping(CommandEvent invokation) =>
        invokation.ReplyAsync("Pong!");

    [Command(Aliases = new string[] { "commands", "h" })]
    public Task Help(CommandEvent invokation)
    {
        var commandNames = CommandNames;

        return invokation.ReplyAsync($"Here are available commands: `{string.Join("`, `", commandNames)}`");
    }

    [Description("This does stuff.")]
    [Command(Aliases = new string[] { "ex", "e" })]
    [Example("10"), Example("ex", "50")]
    public static async Task Example(CommandEvent invokation, [CommandParam("number to say")] int number)
    {
        await invokation.ReplyAsync($"Someone secretly said number `{number}`");

        // Delete the command message ("/example 10")
        await invokation.DeleteAsync();
    }
}

Note: The code above uses enabled implicit usings option.

⁉️ Support

If you need any help related to Guilded.NET, you can check out the following sources:

Product Compatible and additional computed target framework versions.
.NET net5.0 is compatible.  net5.0-windows was computed.  net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.7.1 153 1/10/2024
1.7.0 121 1/3/2024
1.6.0 192 7/1/2023
1.5.1 178 4/11/2023
1.5.0 185 4/1/2023
1.3.0 281 12/22/2022
1.2.0 299 11/24/2022
1.1.5 296 11/16/2022
1.1.4 303 11/9/2022
1.1.3 319 11/4/2022
1.1.2 334 10/31/2022
1.1.1 338 10/30/2022
1.1.0 339 10/29/2022
1.0.2 407 9/16/2022
1.0.1 438 9/13/2022
1.0.0 435 9/13/2022
0.10.0 393 8/26/2022
0.9.3 369 8/7/2022
0.9.2 398 7/31/2022
0.9.1 383 7/25/2022
0.9.0 379 7/21/2022
0.8.6 400 6/24/2022
0.8.5 375 6/23/2022
0.8.4 382 6/12/2022
0.8.2 379 6/4/2022
0.8.1 378 6/3/2022
0.8.0 387 5/16/2022