Fluxify.Bot 0.1.0-preview1

This is a prerelease version of Fluxify.Bot.
There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package Fluxify.Bot --version 0.1.0-preview1
                    
NuGet\Install-Package Fluxify.Bot -Version 0.1.0-preview1
                    
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="Fluxify.Bot" Version="0.1.0-preview1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Fluxify.Bot" Version="0.1.0-preview1" />
                    
Directory.Packages.props
<PackageReference Include="Fluxify.Bot" />
                    
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 Fluxify.Bot --version 0.1.0-preview1
                    
#r "nuget: Fluxify.Bot, 0.1.0-preview1"
                    
#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 Fluxify.Bot@0.1.0-preview1
                    
#: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=Fluxify.Bot&version=0.1.0-preview1&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Fluxify.Bot&version=0.1.0-preview1&prerelease
                    
Install as a Cake Tool

Fluxify

.NET library for building applications that interact with fluxer

NuGet Version GitHub License

Getting Started

See Example.cs for a simple starting point

Building a Bot

Start with the Fluxify.Bot package.

var cfg = new FluxerConfig
{
    // for configuring the fluxer instance you can provide the instance option
    // InstanceUri = new Uri("https://api.<your-instance>/"),
    Credentials = new BotTokenCredentials("...")
};

var bot = new Bot("!", cfg)

// the parameters to the command will be resolved from the configured service provider
//   or (still in progress as of 0.1.0-preview) from the command reader
bot.Commands.Command("ping", (CommandContext ctx) => ctx.ReplyAsync("Pong!"));

bot.Commands.Command("hug", async (CommandContext ctx) =>
{
    var userMention = ctx.Reader.GetNext<Mentionable.Member>();

    var message = new MessageBuilder($"<@{userMention.Id}> you have been hugged!")
            .WithEmbed(e => e
                .WithImage("https://gifprovider/image.gif")
            .Build());

    await ctx.Message.Channel.SendMessageAsync(message);
});

await bot.RunAsync();

Preconditions

var botOwnerPrecondition = new Precondition(
    "bot-owner",
    "User needs to be the bot owner"
    static ctx => ctx.Message.Author.Id == 27842764872883298 
        ? PreconditionResult.Success
        : PreconditionResult.Fail("Youre not the bot owner!"));

bot.Module("secret", m =>
    {
        m.Command("isCool", (CommandContext ctx) => ctx.ReplyAsync("Yes you are cool!"))
    }, botOwnerPrecondition)
    .Command(
        "open-pod-bay-doors",
        (CommandContext ctx) => ctx.ReplyAsync("I'm sorry dave I'm afraid I can't do that"),
        botOwnerPrecondition
    );

Logging (Simple)

Fluxify does not privide any logging by itself, to use logging use any logging package that supports the ILoggerFactory interface Using FluxerConfig provide a ILoggerFactory.

Example with Microsoft.Extensions.Logging.Console:

var cfg = new FluxerConfig
{
    ...
    LoggerFactory = LoggerFactory.Create(builder => builder.AddConsole())
};
...

Dependency Injection

Configure your IServiceProvider using the Services option. A new service scope will be created per Command execution.

var cfg = new FluxerConfig
{
    ...
    Services = ...
};

Bot Presence

This is configured using the gateway configuration so you will have to pass another configuration to the bot class.

var gatewayConfig = new GatewayConfig
{
    // IgnoredGatewayEvents = ...,
    DefaultPresence = new PresenceUpdate(
        Status: UserStatus.Online,
        CustomStatus: new CustomStatus(
            Text: "hello world!"))
};

var bot = new Bot(..., gatewayConfig);
...

Help I cannot find request X

Currently not all REST functionality is exposed via the Entities. This means in cases you need functions not exposed in the higher level entities you should look into Bot.Rest. It currently implements all Guild and User endpoints and almost all Channel endpoints. If something is missing, feel free to create an issue or contribute.

Product Compatible and additional computed target framework versions.
.NET 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 is compatible.  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 is compatible.  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
0.2.4.1-preview 62 10/13/2026
0.2.4-preview 68 10/4/2026
0.2.3.1-preview 74 10/3/2026
0.2.3-preview 128 8/2/2026
0.2.2-preview 109 7/9/2026
0.2.1-preview 109 5/10/2026
0.2.0.1-preview 80 4/20/2026
0.2.0-preview 94 4/12/2026
0.1.7-preview 114 4/2/2026
0.1.6-preview 107 3/30/2026
0.1.5-preview 132 3/28/2026
0.1.4.1-preview 82 3/26/2026
0.1.4-preview 85 3/26/2026
0.1.3-preview 130 3/22/2026
0.1.2-preview 77 3/21/2026
0.1.1-preview 85 3/18/2026
0.1.0-preview1 99 3/15/2026
0.1.0-preview 89 3/15/2026