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.
<PackageVersion Include="Guilded.Commands" Version="1.7.1" />
                    
Directory.Packages.props
<PackageReference Include="Guilded.Commands" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version 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.
#:package Guilded.Commands@1.7.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Guilded.Commands&version=1.7.1
                    
Install as a Cake Addin
#tool nuget:?package=Guilded.Commands&version=1.7.1
                    
Install as a Cake Tool

🟡 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.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.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 251 1/10/2024
1.7.0 185 1/3/2024
1.6.0 265 7/1/2023
1.5.1 251 4/11/2023
1.5.0 265 4/1/2023
1.3.0 367 12/22/2022
1.2.0 381 11/24/2022
1.1.5 381 11/16/2022
1.1.4 383 11/9/2022
1.1.3 402 11/4/2022
1.1.2 415 10/31/2022
1.1.1 415 10/30/2022
1.1.0 421 10/29/2022
1.0.2 493 9/16/2022
1.0.1 530 9/13/2022
1.0.0 529 9/13/2022
0.10.0 477 8/26/2022
0.9.3 460 8/7/2022
0.9.2 492 7/31/2022
0.9.1 474 7/25/2022
0.9.0 474 7/21/2022
0.8.6 499 6/24/2022
0.8.5 474 6/23/2022
0.8.4 479 6/12/2022
0.8.2 479 6/4/2022
0.8.1 477 6/3/2022
0.8.0 479 5/16/2022