# synarere -- a trivial Python IRC bot.
# Copyright (C) 2010 Michael Rodriguez.
# Rights to this code are documented in docs/LICENSE.

"""Example module."""

# Import required source module.
from src import commands

def cmd_example(conn, (nick, user, host), target, message):
    """What we do when '.example' is said in a channel. Just say HELLO back."""

    conn.sendq.append('PRIVMSG %s :HELLO!' % target)

def module_init():
    """
    Module entry point. This is used to create commands, attach to
    specific IRC events, etc.
    """

    commands.create('.example', cmd_example, commands.chan)

def module_fini():
    """
    Module exit point. This is used to destroy commands, detach from
    specific IRC events, etc. You MUST do this, or memory will be leaked!
    """

    commands.destroy('.example', cmd_example, commands.chan)
