Welcome to NickelBot’s documentation!¶
API¶
NickelBot:¶
-
class
NickelBot.plugin(name, version)¶ The main interface class for interacting with the API and Bot.
Parameters:
Argument Optional Type Description name No String Used to define tha name of the plugin. version No String Set the Version Id of your Plugin. author Yes String Give the Api the plugin creator’s name. desc Yes String Give a short Description of the plugin. -
getInfo()¶ Used to get the set info for the plugin
Returns: [
name,version]
-
getConfig(args)¶ - Used to get the Config Manager for the Bot
Returns:
config
-
getCmd(command)¶ Used to get the Config Manager for the Bot
Parameters:
Argument Optional Type Description command No String The Name of the command that is being requested Returns:
command
-
addEvent(event, function)¶ Used to add an Event Listner
Parameters:
Argument Optional Type Description event No EventThe Event name function No function The function used when event invoked.
-
-
class
NickelBot.logger¶ -
info(text)¶ Use to send info to the bot logs
Argument Optional Type Description text No String The Text to Log
-
note(text)¶ Use to send info/note to the bot logs
Argument Optional Type Description text No String The Text to Log
-
ok(text)¶ Use to send a sucessfull event to the bot logs
Argument Optional Type Description text No String The Text to Log
-
-
class
NickelBot.command(name, plugin)¶ The main interface class for Bot Commands
Parameters:
Argument Optional Type Description name No String Used to define tha name of the command plugin No pluginThe Plugin Assined -
addListner(Function)¶ Assign a Function to A Command. The function must have five Pararamters. Following the style of a
command-functionArgument Optional Type Description function No function The Function to Assign Returns: Success (Bool)
-
setDesc(Text)¶ Set the Description of a command. Showen in the HELP Command.
Argument Optional Type Description text No String The Text to set as the Description Returns: Success (Bool)
-
setUsage(Usage)¶ Set the Usage of a command. Showen in the HELP Command.
- The Command and Invoke are Already Included. Example:
- <Invoke> <Command> <usage> | !Hello <usage>
Argument Optional Type Description usage No String The Text to set as the Useage e.g.
Returns: Success (Bool)
-
name¶ The name of the command. e.g. !Hello –> Hello
Returns: String
-
plugin¶ The plugin that first registered the command.
Returns:
Plugin
-
usage¶ Get the usage set for the command that is displayed in the help command
Returns: String
-
desc¶ - Short for description. Get the description set for the command that is displayed in the help command
Returns: String
-