General Configuration Settings

Command Management and Execution Module

This module is responsible for managing and executing commands in the bot, including setting up command configurations, processing messages to detect and execute commands, and handling command outputs.

Features

  • Execute Commands on Connect or Join
    • Execute specified commands when the bot connects to a server or joins a channel.
  • Command Execution
    • Execute commands received via private messages or channel messages.
    • Supports aliasing and contextual checking for commands.
    • Supports command outputs with customizable methods (PRIVMSG, NOTICE).
  • Permissions and Context Checking
    • Check and enforce permissions for commands.
    • Ensure commands are executed in the correct context (channel or private).
  • Command Outputs
    • Handle command outputs with customizable formatting and handling for stdout and stderr.
    • Support for splitting long outputs into multiple messages.

Configuration Options

  • Command Prefix
    • Set the command prefix for channels, servers, or globally.
    • Usage:
      • ,config channel:<channel_name> command-prefix <prefix>
      • ,config server:<server_name> command-prefix <prefix>
      • ,config bot command-prefix <prefix>
    • Example:
      • ,config channel:#examplechannel command-prefix !
      • ,config server:example_server command-prefix .
  • Command Method
    • Set the method used to respond to commands (PRIVMSG or NOTICE).
    • Usage:
      • ,config channel:<channel_name> command-method PRIVMSG|NOTICE
      • ,config server:<server_name> command-method PRIVMSG|NOTICE
      • ,config bot command-method PRIVMSG|NOTICE
    • Example:
      • ,config channel:#examplechannel command-method NOTICE
      • ,config server:example_server command-method PRIVMSG
  • Hide Prefix
    • Enable or disable hiding the prefix in command responses.
    • Usage:
      • ,config channel:<channel_name> hide-prefix true|false
    • Example:
      • ,config channel:#examplechannel hide-prefix true
  • Enable/Disable Commands
    • Enable or disable responding to commands in a channel.
    • Usage:
      • ,config channel:<channel_name> commands true|false
    • Example:
      • ,config channel:#examplechannel commands false
  • Enable/Disable Prefixed Commands
    • Enable or disable responding to prefixed commands in a channel.
    • Usage:
      • ,config channel:<channel_name> prefixed-commands true|false
    • Example:
      • ,config channel:#examplechannel prefixed-commands true

Commands and Usage

  • Perform Commands Configuration
    • Configure commands to execute on connect or join.
    • Usage:
      • ,perform list
      • ,perform add <command>
      • ,perform remove <index>
    • Example:
      • ,perform list
      • ,perform add JOIN #examplechannel
      • ,perform remove 0
  • Channel Perform Commands Configuration
    • Configure commands to execute on channel join.
    • Usage:
      • ,cperform list
      • ,cperform add <command>
      • ,cperform remove <index>
    • Example:
      • ,cperform list
      • ,cperform add PRIVMSG #examplechannel :Hello, everyone!
      • ,cperform remove 0

Examples

  • To list all configured on-connect commands:
    • ,perform list
      • Response:
        • Configured commands: JOIN #examplechannel, MODE #examplechannel +o
  • To add a command to be executed on connect:
    • ,perform add JOIN #examplechannel
      • Response:
        • Added command
  • To remove the first command from the on-connect list:
    • ,perform remove 0
      • Response:
        • Removed command 0 (JOIN #examplechannel)
  • To list all configured on-join commands for a channel:
    • ,cperform list
      • Response:
        • Configured commands: PRIVMSG #examplechannel :Hello, everyone!
  • To add a command to be executed on channel join:
    • ,cperform add PRIVMSG #examplechannel :Hello, everyone!
      • Response:
        • Added command

Notes

  • Commands must be configured with the appropriate permissions to be executed.
  • Ensure the correct context for commands (channel or private) to avoid execution errors.