Example #1
0
 def show_help(self, msg, channel):
     """Show help info about the bot's recognized commands."""
     try:
         command = msg.split()[1]
         if not command:
             raise IndexError
     except IndexError:
         self.say(channel, help_info)
     else:
         self.say(channel, utils.get_help_info(command))
Example #2
0
# third-party imports
from twisted.internet import defer
from twisted.words.protocols import irc

# local imports
import fpaste
import utils
from . import APP_LOGGER
from .commands import commands
from .logger import get_logger_instance
from .queue import Queue
from .user import IRCUser, InvalidUserError


help_info = utils.get_help_info()


class LogBot(irc.IRCClient):
    """A logging IRC bot.

    Implemented as an extension of `IRCClient` from the Twisted
    framework.

    Args:
        config: Configuration instance.

    Attributes:
        config: Bot configuration data.
        nickname: IRC nick of the bot.
        channel: IRC channel bot is connected to.