BotBase 1.1.3

The owner has unlisted this package. This could mean that the package is deprecated, has security vulnerabilities or shouldn't be used anymore.
dotnet add package BotBase --version 1.1.3
NuGet\Install-Package BotBase -Version 1.1.3
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="BotBase" Version="1.1.3" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add BotBase --version 1.1.3
#r "nuget: BotBase, 1.1.3"
#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 BotBase as a Cake Addin
#addin nuget:?package=BotBase&version=1.1.3

// Install BotBase as a Cake Tool
#tool nuget:?package=BotBase&version=1.1.3
  1. Create a DatabaseProvider
// Use these methods to store all the objects in a database
public class MyDatabaseProvider : IDatabaseProvider
{
    // Warning: If GetServer returns null, the library will throw an exception, so make sure it won't return null
    public Server GetServer(ulong id)
    {
        ...
    }

    public Task UpdateServer(Server server)
    {
        ...
    }

    public User GetUser(ulong id)
    {
        ...
    }

    public Task UpdateUser(User user)
    {
        ...
    }
}
  1. Initialize a instance of BotBase
// I recommend you configuring the Configs like you wish and not use this too simplified error handler
var client = new BotBase(new Configuration{Token = "YourBotToken"}, new DiscordSocketConfig(), new CommandServiceConfig(), (context, result) => Console.WriteLine(result.Error), new MyDatabaseProvider());

// This initializes the bot 
var task = client.InitializeAsync();

// Because task will never return to let your bot stay alive, at the end of your initialization you want to await the task
task.Wait();
  1. Create your bot

    • Adding services

        // To add a service, you just need to add the IsService attribute to your service class
        [IsService]
        public class SomeService
        {
        	...
        }
      
    • Adding modules

        // To add a module, you need to inherit CommandBase or CommandBase<TServer, TUser>
        public class SomeModule : CommandBase
        {
        	[Command]
        	public async Task SomeCommand()
        	{
        		...
        	}
        }
      
  2. Extending Server and User

// If you want to extend Server or User you need to create classes inheriting these
public class SomeServer : Server
{
	public string SomeString;
}

public class SomeUser : User
{
	public string SomeString;
}
// Then you need to pass the types into new BotBase
var client = new BotBase<SomeServer, SomeUser>(...);
// But you are not done, not yet
// You need to modify the modules to not inherit CommandBase, but CommandBase<TServer, TUser>
public class SomeModule : CommandBase<SomeServer, SomeUser>
{ 
	...
}
  1. Go to your friends and make them envious about your bot, then tell them you made it with this library and enjoy your bot and stop complaining and reading this shit

  2. If you still got questions, just join my discord server https://discord.gg/7e9Vhzs

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 netcoreapp2.1 is compatible.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 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