ShablePrefix 1.0.6

dotnet add package ShablePrefix --version 1.0.6
NuGet\Install-Package ShablePrefix -Version 1.0.6
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="ShablePrefix" Version="1.0.6" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add ShablePrefix --version 1.0.6
#r "nuget: ShablePrefix, 1.0.6"
#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 ShablePrefix as a Cake Addin
#addin nuget:?package=ShablePrefix&version=1.0.6

// Install ShablePrefix as a Cake Tool
#tool nuget:?package=ShablePrefix&version=1.0.6

ShablePrefix

Simple custom prefix handler on c# for discord bot

possibilities:

  • Discord.NET compatible
  • up to 500 servers(actually unlimited count of servers, but response speed decreases(depends on cpu))
  • Default prefix
  • simple to use

How to use:

To connect custom prefixes to your bot you need:

using ShablePrefics;
.
.
.
//when bot is ready
private async Task OnReady()
{
            /*
            if you connecting Shable prefix first time, 
            before checking you must to create json file for guilds and their prefixes.
            Just write await Prefix.StartShable(), and you don't have to touch it anymore.
            */
            
            await Prefix.StartShable();
            
            //ready stuff
}
.
.
.
//your command handler
private async Task HandleCommandAsync(SocketMessage rawMessage)
{
            //your code
            
            /*
            when you're checking for prefix you must replace your default string prefix with
            await Prefix.GetPrefix(guild that requested(Example: context.Guild),
            default prefix of your bot)
            */
            if (message.HasStringPrefix(await Prefix.GetPrefix(context.Guild,_defaultPrefics),
               ref argPos)&& !(message.HasMentionPrefix(_client.CurrentUser, ref argPos)))
            {
                        //command responding etc
            }


}

More on https://github.com/NascuBB/ShablePrefix

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  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. 
.NET Core netcoreapp3.1 is compatible. 
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.0.6 354 9/28/2021
1.0.5.2 273 9/26/2021
1.0.5.1 726 9/24/2021
1.0.5 695 9/23/2021