EZPeaZeeBot 3.0.0

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

// Install EZPeaZeeBot as a Cake Tool
#tool nuget:?package=EZPeaZeeBot&version=3.0.0

EZPeaZeeBot

Create a discord bot in 2 lines! <br></br> <a href="https://discord.gg/CM57nS8Kc4"> <img src="https://discord.com/api/guilds/877249283726905475/widget.png" alt="Help Discord"> </a> <br></br> <br></br>

Creating A Bot

After you reference the bot with nuget you can create a bot by adding these two lines

Config _config = Config.Create("path\to\your\config\file"); //config file must end with .config or it will throw an error
DiscordSocketClient client = await Bot.Create(_config);

This will start the bot completely. If you want custom DiscordSocketConfig use this instead:

Config _config = Config.Create("path\to\your\config\file"); //config file must end with .config or it will throw an error
DiscordSocketClient client = await Bot.CreateAdvanced(_config, new DiscordSocketConfig());

For writing to a Console Application add this line

client.OnLog += CustomConsole.WriteDiscordLog;

this will color the text related to its severity:

Cyan -> Debug
Green -> Info
Dark Yellow -> Warning
Red -> Error
Dark Red -> Critical

For registering commands add these 2 lines

InteractionService _interaction = EZPeaZeeBot.Interactions.Create();
CommandService _commands = EZPeaZeeBot.Commands.Create();

The bot comes with a help command in-built. If you want to use your own help command change thoes lines to

InteractionService _interaction = EZPeaZeeBot.Interactions.Create(false);
CommandService _commands = EZPeaZeeBot.Commands.Create(false);

<br></br> Finally for creating your own commands you can do this <br></br> For Prefix Commands

using Discord.Commands;

namespace EZPeaZeeBot
{
    public class ExampleCmd : ModuleBase<SocketCommandContext>
    {
        [Command("example")] //adding spaces within the command name will cause the bot to ignore this command
        [Summary("an example command")]
        public async Task Run()
        {
            await ReplyAsync("Command Run!");
        }
    }
}

For Slash Commands:

using Discord.Interactions;

namespace EZPeaZeeBot
{
    public class ExampleSlash : InteractionModuleBase<SocketInteractionContext>
    {
        [SlashCommand("example","an example command")] //adding spaces within the command name will cause the bot to ignore this command
        public async Task Run()
        {
            await RespondAsync("Command Run!");
        }
    }
}

By the way, you must set the namespace to be EZPeaZeeBot or the program will not be able to find the command. (This may be fixed at a later stage)

Product Compatible and additional computed target framework versions.
.NET 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. 
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
3.0.0 424 6/30/2022
2.0.0 397 6/30/2022
1.0.0 405 6/16/2022