This commit is contained in:
22
README.md
22
README.md
@@ -20,23 +20,9 @@ Plugin Types:
|
|||||||
### How to create a plugin
|
### How to create a plugin
|
||||||
|
|
||||||
First of all, Create a new project (class library) in Visual Studio.
|
First of all, Create a new project (class library) in Visual Studio.
|
||||||

|
Then import the PluginManager.dll as project to your project.
|
||||||
|
|
||||||

|
## 1. Commands
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
Now, let's add the PluginManager reference. It can be found inside the bot's main folder under
|
|
||||||
`DiscordBot/bin/Debug/net6.0/PluginManager.dll` or `PluginManager/bin/Debug/net6.0/PluginManager.dll`
|
|
||||||
after one successfull build.
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
1. Commands
|
|
||||||
|
|
||||||
Commands are loaded when all plugins are loaded into memory. When an user executes the command, only then the Execute function is called.
|
Commands are loaded when all plugins are loaded into memory. When an user executes the command, only then the Execute function is called.
|
||||||
Commands are plugins that allow users to interact with them.
|
Commands are plugins that allow users to interact with them.
|
||||||
@@ -103,7 +89,7 @@ From here on, start coding. When your plugin is done, build it as any DLL projec
|
|||||||
Then, reload bot and execute command `lp` in bot's console. The plugin should be loaded into memory or an error is thrown if not. If an error is thrown, then
|
Then, reload bot and execute command `lp` in bot's console. The plugin should be loaded into memory or an error is thrown if not. If an error is thrown, then
|
||||||
there is something wrong in your command's code.
|
there is something wrong in your command's code.
|
||||||
|
|
||||||
2. Events
|
## 2. Events
|
||||||
|
|
||||||
Events are loaded when all plugins are loaded. At the moment when they are loaded, the Start function is called.
|
Events are loaded when all plugins are loaded. At the moment when they are loaded, the Start function is called.
|
||||||
Events are used if you want the bot to do something when something happens in server. The following example shows you how to catch when a user joins the server
|
Events are used if you want the bot to do something when something happens in server. The following example shows you how to catch when a user joins the server
|
||||||
@@ -137,7 +123,7 @@ public class OnUserJoin : DBEvent
|
|||||||
- client - the discord bot client
|
- client - the discord bot client
|
||||||
|
|
||||||
|
|
||||||
3.Slash Commands
|
## 3. Slash Commands
|
||||||
|
|
||||||
|
|
||||||
Slash commands are server based commands. They work the same way as normal commands, but they require the `/` prefix as they are integrated
|
Slash commands are server based commands. They work the same way as normal commands, but they require the `/` prefix as they are integrated
|
||||||
|
|||||||
Reference in New Issue
Block a user