Guilded.Commands
1.5.1
See the version list below for details.
dotnet add package Guilded.Commands --version 1.5.1
NuGet\Install-Package Guilded.Commands -Version 1.5.1
<PackageReference Include="Guilded.Commands" Version="1.5.1" />
paket add Guilded.Commands --version 1.5.1
#r "nuget: Guilded.Commands, 1.5.1"
// Install Guilded.Commands as a Cake Addin #addin nuget:?package=Guilded.Commands&version=1.5.1 // Install Guilded.Commands as a Cake Tool #tool nuget:?package=Guilded.Commands&version=1.5.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 | Versions 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 was computed. 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 was computed. 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. |
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 | 197 | 1/10/2024 |
1.7.0 | 149 | 1/3/2024 |
1.6.0 | 221 | 7/1/2023 |
1.5.1 | 200 | 4/11/2023 |
1.5.0 | 208 | 4/1/2023 |
1.3.0 | 313 | 12/22/2022 |
1.2.0 | 325 | 11/24/2022 |
1.1.5 | 323 | 11/16/2022 |
1.1.4 | 328 | 11/9/2022 |
1.1.3 | 347 | 11/4/2022 |
1.1.2 | 360 | 10/31/2022 |
1.1.1 | 359 | 10/30/2022 |
1.1.0 | 366 | 10/29/2022 |
1.0.2 | 433 | 9/16/2022 |
1.0.1 | 472 | 9/13/2022 |
1.0.0 | 470 | 9/13/2022 |
0.10.0 | 416 | 8/26/2022 |
0.9.3 | 398 | 8/7/2022 |
0.9.2 | 425 | 7/31/2022 |
0.9.1 | 407 | 7/25/2022 |
0.9.0 | 408 | 7/21/2022 |
0.8.6 | 431 | 6/24/2022 |
0.8.5 | 405 | 6/23/2022 |
0.8.4 | 409 | 6/12/2022 |
0.8.2 | 411 | 6/4/2022 |
0.8.1 | 410 | 6/3/2022 |
0.8.0 | 407 | 5/16/2022 |