-
-
Notifications
You must be signed in to change notification settings - Fork 0
API Documentation
Here is the API guide and what modules can be linked to and what can you do.
Here is all the API information relating to the main bot itself
Where you can find all the handlers
Where you can find all the Discord bot handling information
Type: Handlers.DiscordBot
This is a static instance that can be used after the main DiscordLab.Bot plugin has been enabled. This contains all the values listed below
Type: DiscordSocketClient
This is the bot client itself and how you should interact with the Discord API if DiscordLab does not have a method for you
Returns: void
Initialises the bot, do not run this in your own module.
Returns: void
Disables the handler, do not run this in your own module.
Params:
-
id
- The ID of the guild you want to get inulong
Returns: SocketGuild
Get a guild by ID
Get all extension methods supplied by the main bot
Gets all extensions related to the IMessage
class.
Params:
-
message
- TheIMessage
you wish to check
Returns: bool
Checks if an IMessage
is a user message and not a system message
Get all features the main bot has.
Get all constants for config variables.
Type: string
Gets the string for GuildId in Config
Type: string
Gets the string for IsEnabled in Config
Type: string
Gets the string for Debug in Config
Public class for creating new modules that can be used inside DiscordLab to update/install modules/main bot.
Type: string
Get or set the module name
Type: Version
Get or set the version
Type: string
Get or set the download URL of the module/main bot
Get the interfaces used on classes
Get the DiscordLab config interface
Type: ulong
The Guild ID where this module/main bot should run
Get the interface for handlers so they can be found
Returns: void
Here is where you should put your code for when the module/main bot is enabled
Returns: void
Here is what you should put for when the module/main bot is disabled
Here is the interface to create slash commands
Type: SlashCommandBuilder
The defining information about your slash command, like name, options, description, etc
Type: ulong
Where this command should be registered
Params:
-
command
- TheSocketSlashCommand
This is what should happen when your slash command is executed
Here is where all the modules are, includes methods which you should touch.
A module that allows you to register all IRegisterable
and ISlashCommand
classes in your code.
Should be instantiated and bound to a variable so it can be run in OnEnabled
and OnDisabled
Params:
-
assembly
- Your project'sAssembly
Returns: void
Load the module/main bot.
Returns: void
Unloads the module/main bot.
Run stuff in a queue based system
Params:
-
id
- The unique ID of this queue, should be something that doesn't change unless it's part of a different queue. -
action
- The code that should run when the initial 5 seconds is over
Returns: void
Run code after 5 seconds of it's initial call. Any requests to send the same ID again will be ignored.
Allows you to manually load slash commands, recommended to use HandlerLoader
.
Static class
Params:
-
assembly
- Your plugin's Assembly
Returns: void
Loads the ISlashCommand
classes in the plugin
Returns: void
Clears all commands, dangerous.
Auto-updater / update warning system.
Static class
Also holds 2 classes GitHubRelease
and GitHubReleaseAsset
, allows interaction with the GitHub API Response
Type: List<DiscordLab.Bot.API.Features.UpdateStatus>
Get the currently created modules/main bot from the GitHub API
Params:
-
bytes
- The file content in abyte[]
format. -
name
- The plugin/module/main bot name
Params:
-
status
TheDiscordLab.Bot.API.Features.UpdateStatus
to download.
Downloads and writes a plugin to the plugins folder
Gets all DiscordLab modules/main bot via the GitHub API and adds them to the Statuses
list.
Allows you to read/write JSON config values from/to `EXILED/Configs/DiscordLab/config.json
Returns: JObject
Get the current config
Params:
-
key
- The key where the object should add the data, as typestring
-
value
- The data to save, asJToken
Returns: void
Write a config value