EZPeaZeeBot 3.0.0
dotnet add package EZPeaZeeBot --version 3.0.0
NuGet\Install-Package EZPeaZeeBot -Version 3.0.0
<PackageReference Include="EZPeaZeeBot" Version="3.0.0" />
paket add EZPeaZeeBot --version 3.0.0
#r "nuget: EZPeaZeeBot, 3.0.0"
// 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 | Versions 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. |
-
net6.0
- Discord.Net (>= 3.7.2)
- Discord.Net.Commands (>= 3.7.2)
- Discord.Net.Core (>= 3.7.2)
- Discord.Net.Interactions (>= 3.7.2)
- Discord.Net.Rest (>= 3.7.2)
- Discord.Net.Webhook (>= 3.7.2)
- Discord.Net.WebSocket (>= 3.7.2)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.