EasyDiscordBot 1.1.4

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

// Install EasyDiscordBot as a Cake Tool
#tool nuget:?package=EasyDiscordBot&version=1.1.4

ReadMe for EasyDiscordBot

Introduction and Setup:

This is an overly simplified way to create a new bot without having your token exposed and needing to remember so many EventHandlers among other things that this package handles for you.

First, you need to create a new Console Application (.NET FrameWork v4.7.2+). Other application types should also work, but Console Applications are the only tested applications for EasyDiscordBot.

Next, you'll need to setup your bot!

Bot Setup:

Inside of your Program.cs file, you will want to add this property either above or below the Main method.

public static EasyBot MY_BOT_NAME;

This is the EasyBot that needs to be created to launch your bot. When that is ready, you can enter your Main method and initialize the EasyBot like so:

MY_BOT_NAME = new EasyBot();

This will initialize your bot and automatically setup the DiscordSocketClient property. After initializing the bot, you will want the bot to start with the code below.

MY_BOT_NAME.Start("BOT_PREFIX");

This is all you need for the bot to activate in the Console. Once the console activates, you'll see some text that states:

Please enter your bot token for encryption:

When you see this, find your bot's secret token and paste it in there. When you press ENTER the bot will restart. This will encrypt your token so that it isn't visible to random people. Once you've entered the token, it will save the encrypted token to a "TokenSaved.txt" where your .exe for your bot is.

Now, every time you start your bot, it will decrypt your token and continue to power up the bot. When your bot says "Ready", this means that the bot successfully booted up and is listening for commands with the prefix you've entered.

Your bot is now set up!

Setup Commands:

You now have a bot listening for commands. You can now choose to run commands the old way or to run commands using the EasyCommands class.

To run commands using the EasyCommands class, go and create a new class and name it Commands. When the class is created, inherit EasyCommands like so.

public class Commands : EasyCommands<DiscordSocketClient> {

}

Once that is done, you now have the Commands class ready for new commands for your bot!

EasyCommands Usage:

EasyCommands makes it simple for you to send messages.

await SendMessage("MESSAGE_TO_SEND");

This sends a message to the current channel the command came from.

As for embeds, EasyCommands makes it very simple to send one.

await SendEmbed("This is a Test", "Testing");

This is all that will be explicitly explained. The rest will have breif descriptions.

EasyBot Documentation:

This documentation contains all public Methods that are usable for EasyBot.

 

AddActionForConsole();

When the bot is ready and is fully loaded, this will invoke the provided Action.

 

AddActionWhenCommandUnknown();

When the bot receives a message that containes the prefix, but it does not contain the command provided, this will invoke the provided Action.

 

AddActionWhenErrorOccurs();

When a command runs and there is an unexpected error, this will invoke the provided Action.

 

AddActionWhenMessageDeleted();

When a message gets deleted from a channel the bot has access to, this will invoke the provided Action.

 

AddActionWhenMessageReceived();

When a message is received from a channel or DM the bot has access to, this will invoke the provided Action.

 

AddActionWhenMessageUpdated();

When a message is updated from a channel the bot has access to, this will invoke the provided Action.

 

AddActionWhenReactionAdded();

When a reaction is added to a message in a channel the bot has access to, this will invoke the provided Action.

 

AddActionWhenUserTyping();

When a user starts typing in a channel the bot has access to, this will invoke the provided Action.

 

Kill();

Kills the bot if it is frozen. If you can avoid using this, please do. Use Stop(); instead

 

SetActionForConsoleLoop();

This runs a loop and constantly reads what is entered into the console. The only way to escape is to enter the Escape string that is provided. If you want the bot to logout and shutdown when the loop is exited, set Exit to true; otherwise false.

 

Start();

This will start the bot and launch it to be ready to accept commands.

 

Stop();

This will take time and try to stop your bot. It will first log out, then stop itself completely.

<br><br>

EasyCommands Documentation:

This documentation contains all public Methods that are usable for EasyCommands.

AddReaction();

Call this Method when you want to add a reaction to a message. This will grab all guild emojis (by id or name) and system emojis.

 

AddReactions();

Call this Method when you want to add multiple reactions to a message. This will grab all guild emojis (by id or name) and system emojis.

 

Delay();

Call this Method when you want to delay a certain action by a certain amount of milliseconds.

 

DelayUntil();

Call this Method when you want to delay a certain action until a certain condition is met.

 

DeleteMessage();

Call this Method when you want to delete a message from a channel (DM or Guild channels).

 

DeleteReaction();

Call this Method when you want to remove a reaction from a message. This will grab all guild emojis (by id or name) and system emojis.

 

DeleteReactions();

Call this Method when you want to remove multiple reactions from a message. This will grab all guild emojis (by id or name) and system emojis.

 

EditEmbed();

Call this Method when you want to edit an embeded message.

 

EditMessage();

Call this Method when you want to edit a normal message.

 

EmoteFinder();

Call this Method when you want to get an emote that the bot shares a guild with, or a system emoji (Searched by the emote name, id or raw emoji).

 

GetWebsiteData();

Call this Method when you want to retreive HTML Data from a specific website url.

 

Load();

Call this Method when you want to retreive your data into a Dictionary.

 

LoadXmlDocument();

Call this Method when you want to retreive your data into a local XmlDocument variable.

 

MakeEmbed();

Call this Method when you don't want to send an embed, but just to make one for later usage.

 

MentionEmote();

Call this Method when you want to get the string of an emote to use properly in a text or embeded message.

 

Save();

Call this Method when you want to save a class into an XML file.

 

SendEmbed();

Call this Method when you want to send an embeded message to a channel (DM or Guild channels).

 

SendMessage();

Call this Method when you want to send a normal message to a channel (DM or Guild channels).

 

UserFinder();

Call this Method when you want to get a user that the bot shares a guild with (Searched by id, username and nickname).

Product Compatible and additional computed target framework versions.
.NET Framework net472 is compatible.  net48 was computed.  net481 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
1.1.4 340 3/6/2021
1.1.3 323 3/6/2021
1.1.2 334 3/6/2021
1.1.1 336 3/6/2021
1.1.0 340 3/6/2021
1.0.1 306 3/5/2021
1.0.0 296 3/5/2021

Fixed issue where UserFinder and EmoteFinder would not find the user or emote by ID.