Skip to content
sebauer edited this page Oct 18, 2012 · 1 revision

Beelzebot can be easily extended by IRC Command modules

Introduction

Beelzebot has a modular command interface for IRC which easily allows to enable/disable existing commands and to extend Beelzebot by new commands on the fly without restarting the bot.

This page will describe the usage/handling of commands and how to write your own commands for Beelzebot

Managing existing Commands

Commands are seperate "modules" in Beelzebot which can be enabled/disabled without any stress.

All commands can be found inside the commands directory. Beelzebot already ships with several commands. Theoretically all of them can be disabled but some of them (like CommandQuit, CommandHelp and CommandRescanCommands) are recommended to stay active.

Enabling Commands

Enabling commands is easy as is: Command modules are all stored inside the commands directory. Every valid command module inside this directory will be loaded when starting Beelzebot.

NOTE: Only commands matching the proper file naming guideline will be detected by Beelzebot. Correct naming wound be Command<CommandName>.php. Note that the naming of command files is pascal-cased, which means, every word begins with a capital letter.

To enable commands which have been added while Beelzebob was already running, execute the CommandRescanCommands command via IRC. This will rescan all available commands and enables them immediately.

Disabling Commands

To disable commands, simply remove the specific command modules from the commands directory or rename them in order to no more match the proper command file naming pattern, e.g. __CommandLfs.php.

Commands not matching the file pattern or removed from the commands directory won't be loaded when starting Beelzebot.

To disable commands on the fly while Beelzebot is already running, remove/rename the specific command modules and execute the CommandRescanCommands command using IRC to apply the changes.

Reload Commands

After adding new commands or removing/renaming existing ones, you need to execute the CommandRescanCommands command to apply those changes. You can also use this command to reload all commands and reset them to their initial state.

Writing your own Command

API

tbd

API TODOs

  • Overriding existing commands
  • Running multiple command modules for one command?
  • Validation of commands when loading
  • Dependencies
  • Priorization
    • Enable/disable command on the fly

Clone this wiki locally