EarwigBot: Base IRC Command
This package provides built-in IRC “commands” used by the bot’s front-end component. Additional commands can be installed as plugins in the bot’s working directory.
This class (import with from earwigbot.commands import Command), can be subclassed to create custom IRC commands.
This docstring is reported to the user when they type "!help <command>".
Return whether this command should be called in response to data.
Given a Data instance, return True if we should respond to this activity, or False if we should ignore it and move on. Be aware that since this is called for each message sent on IRC, it should be cheap to execute and unlikely to throw exceptions.
Most commands return True only if data.command == self.name, or data.command is in self.commands if that list is overriden. This is the default behavior; you should only override it if you wish to change that.
Main entry point for doing a command.
Handle an activity (usually a message) on IRC. At this point, thanks to check() which is called automatically by the command handler, we know this is something we should respond to. Place your command’s body here.