diff --git a/README.md b/README.md index ad73e4a..53d59b4 100644 --- a/README.md +++ b/README.md @@ -41,6 +41,7 @@ Reference for available objects and structures is available [**here**](https://g - [Messages](#messages) - [System messages](#system-messages) - [Help message](#help-message) +- [Experimental features](#experimental-features) - [Issues](#issues) # Installation @@ -258,6 +259,11 @@ To configure it use the _[help](https://grz4na.github.io/CommandBot/interfaces/I > **WARNING!** You can't customize these messages after starting the bot. Changing these properties while the bot is running will have no effect. +# Experimental features + +- The package has a _[PrefixManager](https://grz4na.github.io/CommandBot/classes/PrefixManager.html)_ class which is taking care of setting different prefixes for every server that the bot is on but there is no module to store that date in a file or database so the it's lost every time the application restarts. If you want to use it in your project, you should create a data store and write a function that dumps the data there. +- _[CommandManager](https://grz4na.github.io/CommandBot/classes/CommandManager.html)_ has 2 methods to interact with the Discord Permissions API (_getPermissionsApi_ and _setPermissionsApi_) and set interaction permissions that are independent from the CommandBot permission system. This functionality has not been polished and fully tested yet. + # Issues Since this package is created by only 1 person it may contain some bugs or behave weirdly. If you notice any problem, typo etc, please create an issue in the _[Issues](https://github.com/GRZ4NA/CommandBot/issues)_ tab on GitHub. diff --git a/docs/classes/Bot.html b/docs/classes/Bot.html index 4afb4d2..030f2c2 100644 --- a/docs/classes/Bot.html +++ b/docs/classes/Bot.html @@ -1,26 +1,26 @@
Main bot constructor
-Emitted after connecting to Discord API
-Emitted whenever bot receives a Discord message
-Emitted whenever bots receives a Discord message or interaction that gets recognized as a CommandBot command
-Emitted on every bot error
-Discord API application ID
-Discord.js {@link Client} instance
-Instance command manager
-SystemMessageManager storing messages' configuration
-Bot name
-Discord Bot token
Sets or gets the default captureRejection value for all emitters.
@@ -31,7 +31,7 @@ events. Listeners installed using this symbol are called before the regularInstalling a listener using this symbol does not change the behavior once an
'error' event is emitted, therefore the process will still crash if no
regular 'error' listener is installed.
Starts your Discord bot
whether this operation has been completed successfully
A representation of CHAT_INPUT command (also known as a slash command)
-ChatCommand constructor
a manager that this command belongs to
ChatCommandInit object containing all options needed to create a ChatCommand
-Subcommands and groups of this command
-List of different names that can be used to invoke a command (when using prefix interactions)
-Whether a SUCCESS message should be sent after executing the command function (when there is no other reply)
-Discord API default_permission
-Command description displayed in the help message or in slash commands menu (Default description: "No description")
-If set to false, all interactions that get invoked from private/direct conversations (outside a guild) will result a PermissionError
-List of Discord guild (server) IDs in which this command can be used
-Manager in which this command is registered
-Command name
-List of parameters that can passed to this command
-Object containing check functions and permission bitfields
-Whether this command should be registered as a slash command (default: true)
-CommandBot's internal command type
-Command usage displayed in the help message
-Whether this command is visible in the help message (default: true)
-Returns list of attached subcommands
-Returns true if the command has subcommands attached
-Attaches subcommand or subcommand group to this ChatCommand (this makes the base command usable only via prefix interactions)
+Attaches subcommand or subcommand group to this ChatCommand
subcommand type
initialization options
A computed subcommand object
-parameter options
Discord interaction
an InputManager containing all interaction-related data or null
-subcommand name
a SubCommand object or null
-Check base command type
base command type
Whether this command can be used as the given type
-Check child command type
child command type
Whether this command can be used as a child command of the given type
-Checks command type
command type
Whether this command can be used as the given type
-Invoke the command
input data manager
-Converts ChatCommand instance to object that is recognized by the Discord API
Discord API object
Generated using TypeDoc
Bot core command object
-Command core constructor
manager bound to this command
@@ -8,30 +8,30 @@command internal type
initialization options
-Discord API default_permission
-Manager in which this command is registered
-Command name
-CommandBot's internal command type
-Check base command type
base command type
Whether this command can be used as the given type
-Check child command type
child command type
Whether this command can be used as a child command of the given type
-Checks command type
command type
Whether this command can be used as the given type
-Converts a command instance to an APICommandObject
An object that is accepted by the Discord API
Generated using TypeDoc
Object that stores the registered commands and is responsible for data exchanging with the Discord API
-client that this manager belongs to
parameters defining appearance of the help message
-List of commands registered in the manager
-Cache of Discord API commands data
-A string used to split all incoming input data from Discord messages
-Client connected to this manager
-A string used to separate subcommand groups and subcommands
-Help command associated with this manager
-A manager holding all guild-specific prefixes and a global prefix
-Discord API URL
-Discord API commands cache
-Number of commands registered in this manager
-Creates and registers command in the manager based on the given options
an object containing all properties required to create this type of command
A computed command object that inherits from Command
-Performs internal data type conversions
-Process an interaction
interaction object to fetch a command from
An InputManager containing all input data (command, arguments, target etc.)
-Get command registered in this manager
command name or alias
A command object
-Fetches command object from the Discord API
Discord command ID
Discord command object
-Retrieves cache from the manager
-Fetches command ID by name from the Discord APi
name of the command
command type you want to get ID for
Command ID from the Discord API
-Get permissions from Discord Permissions API for a specified command
-command ID
-Lists all commands in the manager
An array of commands registered in this manager
-Lists commands registered in the Discord API
List of commands from Discord API
-Register all commands in this manager in the Discord API
-Set permissions using Discord Permissions API
-command ID
permissions to set
-list of commands to cache
guild ID
-Generated using TypeDoc
Object that stores permission resolvables and properties (bouund to a PermissionCommand)
-command attached to this permissions object
-Command permissions
-Command bound to this object
-If set to "ALL", the command can only be used when all specified conditions are met. (works only for Discord.js permissions object)
-Permission bitfield
-Whether this object uses custom function to check permissions
-Checks if the interaction sender is permitted to use the command attached to this object
command interaction or Discord message
diff --git a/docs/classes/ContextMenuCommand.html b/docs/classes/ContextMenuCommand.html index 377c51d..f9af4b2 100644 --- a/docs/classes/ContextMenuCommand.html +++ b/docs/classes/ContextMenuCommand.html @@ -1,47 +1,47 @@Representation of all context menu Discord interactions
-Context menu command constructor
manager that this command belongs to
initialization options
-Whether a SUCCESS message should be sent after executing the command function (when there is no other reply)
-Type of context menu interaction
-Discord API default_permission
-If set to false, all interactions that get invoked from private/direct conversations (outside a guild) will result a PermissionError
-List of Discord guild (server) IDs in which this command can be used
-Manager in which this command is registered
-Command name
-Object containing check functions and permission bitfields
-CommandBot's internal command type
-Check base command type
base command type
Whether this command can be used as the given type
-Check child command type
child command type
Whether this command can be used as a child command of the given type
-Checks command type
command type
Whether this command can be used as the given type
-Invoke the command
input data
-Discord API object
+Discord API object
Generated using TypeDoc
Function (executable) command
-Executable command constructor
command manager attached to this command
@@ -8,45 +8,45 @@command type
command initailization options
-Command function (called on command execution)
-Whether a SUCCESS message should be sent after executing the command function (when there is no other reply)
-Discord API default_permission
-Manager in which this command is registered
-Command name
-CommandBot's internal command type
-Reply handler
Discord interaction object
result of command function execution
-Check base command type
base command type
Whether this command can be used as the given type
-Check child command type
child command type
Whether this command can be used as a child command of the given type
-Checks command type
command type
Whether this command can be used as the given type
-Invoke the command
input data manager
A Promise that resolves after the function command is completed
-Converts a command instance to an APICommandObject
An object that is accepted by the Discord API
Generated using TypeDoc
Guild-scoped executable command
-Guild-scoped command constructor
command manager attached to this command
@@ -8,40 +8,40 @@command type
command initialization options
-Whether a SUCCESS message should be sent after executing the command function (when there is no other reply)
-Discord API default_permission
-If set to false, all interactions that get invoked from private/direct conversations (outside a guild) will result a PermissionError
-List of Discord guild (server) IDs in which this command can be used
-Manager in which this command is registered
-Command name
-CommandBot's internal command type
-Check base command type
base command type
Whether this command can be used as the given type
-Check child command type
child command type
Whether this command can be used as a child command of the given type
-Checks command type
command type
Whether this command can be used as the given type
-Invoke the command
input data
-Converts a command instance to an APICommandObject
An object that is accepted by the Discord API
Generated using TypeDoc
Help message constructor
command manager related to this command
appearance properties
-Help message appearance options
-List of different names that can be used to invoke a command (when using prefix interactions)
-Whether a SUCCESS message should be sent after executing the command function (when there is no other reply)
-Discord API default_permission
-Command description displayed in the help message or in slash commands menu (Default description: "No description")
-If set to false, all interactions that get invoked from private/direct conversations (outside a guild) will result a PermissionError
-List of Discord guild (server) IDs in which this command can be used
-Manager in which this command is registered
-Command name
-List of parameters that can passed to this command
-Object containing check functions and permission bitfields
-Whether this command should be registered as a slash command (default: true)
-CommandBot's internal command type
-Command usage displayed in the help message
-Whether this command is visible in the help message (default: true)
-Returns list of attached subcommands
-Returns true if the command has subcommands attached
-Attaches subcommand or subcommand group to this ChatCommand (this makes the base command usable only via prefix interactions)
+Attaches subcommand or subcommand group to this ChatCommand
subcommand type
initialization options
A computed subcommand object
-parameter options
Discord interaction
an InputManager containing all interaction-related data or null
-Discord interaction
A computed help message in form of {@link MessageEmbed}
-subcommand name
a SubCommand object or null
-Check base command type
base command type
Whether this command can be used as the given type
-Check child command type
child command type
Whether this command can be used as a child command of the given type
-Checks command type
command type
Whether this command can be used as the given type
-Invoke the command
input data manager
-Converts ChatCommand instance to object that is recognized by the Discord API
Discord API object
Generated using TypeDoc
Object that stores all interaction input data (target, arguments, content and the interaction itself)
-command related to this manager
interaction or message
list of input arguments
-All input arguments
-Command related to this manager
-Command interaction or message
-Command target (when using context menu interactions)
-Get input values
parameter name
diff --git a/docs/classes/MissingParameterError.html b/docs/classes/MissingParameterError.html index 0118172..3798bba 100644 --- a/docs/classes/MissingParameterError.html +++ b/docs/classes/MissingParameterError.html @@ -1,10 +1,10 @@Error indicating that a required parameter is missing in the request
-missing parameter object
-Missing parameter object
-Converts error object to user-readable message
Formatted error message
Object indicating command execution success
-command that succeeded
-Command that succeeded
Generated using TypeDoc
Error indicating that an input value cannot be converted to a expected type
-value with an invalid type
expected type
-Value converted to a string
-Expected type
-Converts error object to user-readable message
Formatted error message
Executable command with attached permission system
-Constructor of command with attached permissions
command manager attached to this command
@@ -8,38 +8,38 @@command type
command initalization options
-Whether a SUCCESS message should be sent after executing the command function (when there is no other reply)
-Discord API default_permission
-Manager in which this command is registered
-Command name
-Object containing check functions and permission bitfields
-CommandBot's internal command type
-Check base command type
base command type
Whether this command can be used as the given type
-Check child command type
child command type
Whether this command can be used as a child command of the given type
-Checks command type
command type
Whether this command can be used as the given type
-Invoke the command
input data
-Converts a command instance to an APICommandObject
An object that is accepted by the Discord API
Generated using TypeDoc
Guild-scoped executable command with permissions attached
Guild-scoped, executable, permissions command constructor
command manager attached to this command
@@ -9,42 +9,42 @@command type
command initialization options
-Whether a SUCCESS message should be sent after executing the command function (when there is no other reply)
-Discord API default_permission
-If set to false, all interactions that get invoked from private/direct conversations (outside a guild) will result a PermissionError
-List of Discord guild (server) IDs in which this command can be used
-Manager in which this command is registered
-Command name
-Object containing check functions and permission bitfields
-CommandBot's internal command type
-Check base command type
base command type
Whether this command can be used as the given type
-Check child command type
child command type
Whether this command can be used as a child command of the given type
-Checks command type
command type
Whether this command can be used as the given type
-Invoke the command
input data
-Converts a command instance to an APICommandObject
An object that is accepted by the Discord API
Generated using TypeDoc
Error indicating that a caller doesn't have enough permissions to execute a command
-command that user wanted and failed to invoke
-Command that user wanted and failed to invoke
-User that doesn't have the permissions
-Converts error object to user-readable message
Formatted error message
Maps server IDs with command prefixes and allows to manage them
+manager attached to this object
-Global scope identifier
-Prefixes data
-Command manager associated with the object
-Manager global prefix
-Get prefix for a specified scope
guild object or ID
a prefix used in given scope
-Remove prefix for the specified scope
-Set prefix for a specific scope
new prefix
diff --git a/docs/classes/SubCommand.html b/docs/classes/SubCommand.html index 4377b75..d211050 100644 --- a/docs/classes/SubCommand.html +++ b/docs/classes/SubCommand.html @@ -1,49 +1,49 @@Representation of SUB_COMMAND Discord interaction
-Subcommand constructor (SUB_COMMAND parameter in Discord API)
command parent
initialization options
-Whether a SUCCESS message should be sent after executing the command function (when there is no other reply)
-Discord API default_permission
-Command description displayed in the help message or in slash commands menu (Default description: "No description")
-Manager in which this command is registered
-Command name
-List of parameters that can passed to this command
-Command parent
-Object containing check functions and permission bitfields
-CommandBot's internal command type
-Command usage displayed in the help message
-Check base command type
base command type
Whether this command can be used as the given type
-Check child command type
child command type
Whether this command can be used as a child command of the given type
-Checks command type
command type
Whether this command can be used as the given type
-Invoke the command
input data
-Discord API object
+Discord API object
Generated using TypeDoc
Group of subcommands
-group parent command
initialization options
-Group members (children)
-Discord API default_permission
-Group description (default: "No description")
-Manager in which this command is registered
-Command name
-Group parent command
-CommandBot's internal command type
-List of subcommands attached to this group
-Attach a subcommand to this group
subcommand initialization options
A computed SubCommand object
-Check base command type
base command type
Whether this command can be used as the given type
-Check child command type
child command type
Whether this command can be used as a child command of the given type
-Checks command type
command type
Whether this command can be used as the given type
-Discord API object
+Discord API object
Generated using TypeDoc
Stores configuration and generates system messages
System messages - predefined messages sent by the bot in special cases (for example after an error, or when a command doesn't exist)
Sent when an error occurs during the execution of a command
-Sent when someone tries to run a command that does not exist (mainly by using prefix interactions)
-Sent whenever caller's permissions are not sufficient to run a command
-Sent when a command function returns void without throwing an error
Client parent attached to this manager
-Global time (in ms) after a message gets deleted
Generates and sends a system message
"ERROR" | "PERMISSION" | "NOT_FOUND" | "SUCCESS"
diff --git a/docs/index.html b/docs/index.html index d277beb..2160bf1 100644 --- a/docs/index.html +++ b/docs/index.html @@ -61,6 +61,7 @@WARNING! You can't customize these messages after starting the bot. Changing these properties while the bot is running will have no effect.
+ +
Application instance
-