DeBot Framework


DeBot\Module
core/Module.php at line 12

Class Module

Module

public abstract class Module

DeBot Core - Module Created by dab Jul ?? 2010 Last Edited: Aug 15 2010 This outlines all of the currently possible callbacks available to the bot.

Author:
David (dab)
Version:
v1.0

Method Summary
void

onConnect()

Once the MOTD is done, the bot is declared connected.

void

onJoin(string sWho, string sChan)

When a user joins the channel

void

onKick(string sWho, string sChan, string sLeft, string sWhy)

This is called when a user is kickd.

void

onMode(string sWho, string sMode, string sParam)

When a mode is changed on the channel

void

onMsg(string sFrom, string sTo, string sMsg, string sSpecial)

Most obvious.

void

onNick(string sOld, string sNew)

This is called when a user changes his/her nickname

void

onNotice(string sFrom, string sTo, string sMsg, string sSpecial)

When a channel notice is received.

void

onPart(string sWho, string sChan, string sWhy)

When a user parts

void

onPrivMsg(string sFrom, string sMsg)

Called when someone sends a message directly to the bot

void

onPrivNotice(string sFrom, string sMsg)

Private notice (/notice DeBot ohi! )

void

onQuit(string sWho, string sWhy)

When a user Quits the IRC network

void

onRaw(integer iCode, string sLine)

This is called when we receive a raw command.

void

onTopic(string sChan, string sTopic)

When the topic is changed

void

onWhois(string sWho, mixed sId, string sLine)

onWhois.

void

setNick(string sNick)

what? Why would we want to change the module bot's nick? Oh..

Method Detail

core/Module.php at line 193

onConnect

public void onConnect()

Once the MOTD is done, the bot is declared connected. We can get that callback here. :D


core/Module.php at line 135

onJoin

public void onJoin(string sWho, string sChan)

When a user joins the channel

Parameters:
sWho - The user who joined
sChan - The channel that the user joined /

core/Module.php at line 206

onKick

public void onKick(string sWho, string sChan, string sLeft, string sWhy)

This is called when a user is kickd.

Parameters:
sWho - The person doing the kicking
sChan - The channel the user was kicked from
sLeft - The user who was kicked from teh channel
sWhy - The reason for being kicked

core/Module.php at line 123

onMode

public void onMode(string sWho, string sMode, string sParam)

When a mode is changed on the channel

Parameters:
sWho - The User who changed the mode
sMode - the modes altered
sParam - Optional. The Parameters (+b ie)

core/Module.php at line 75

onMsg

public void onMsg(string sFrom, string sTo, string sMsg, string sSpecial)

Most obvious. Called when a channel message is received.

Parameters:
sFrom - who the message is from
sTo - Where the message was sent
sMsg - The message itself
sSpecial - Optional. Was the message sent in a special way? %#channel @#channel

core/Module.php at line 62

onNick

public void onNick(string sOld, string sNew)

This is called when a user changes his/her nickname

Parameters:
sOld - The old nickname (the person performing the change)
sNew - The new nickname (what to refer them as now)

core/Module.php at line 100

onNotice

public void onNotice(string sFrom, string sTo, string sMsg, string sSpecial)

When a channel notice is received. Not many people know you can notice a channel. :P

Parameters:
sFrom - the person who sent the notice
sTo - the channel the notice is sent to
sMsg - The message sent
sSpecial - Optional. The message sent via ops/halfops only? %#chan, etc

core/Module.php at line 147

onPart

public void onPart(string sWho, string sChan, string sWhy)

When a user parts

Parameters:
sWho - The user who parted
sChan - The channel parted
sWhy - Optional. The reason for parting (Part message)

core/Module.php at line 86

onPrivMsg

public void onPrivMsg(string sFrom, string sMsg)

Called when someone sends a message directly to the bot

Parameters:
sFrom - the user sending the message
sMsg - the message sent

core/Module.php at line 111

onPrivNotice

public void onPrivNotice(string sFrom, string sMsg)

Private notice (/notice DeBot ohi! )

Parameters:
sFrom - The user sending the notice
sMsg - the message sent

core/Module.php at line 158

onQuit

public void onQuit(string sWho, string sWhy)

When a user Quits the IRC network

Parameters:
sWho - The user who quit
sWhy - The quit message

core/Module.php at line 51

onRaw

public void onRaw(integer iCode, string sLine)

This is called when we receive a raw command. Usually one we don't have a callback for.

Parameters:
iCode - The code of the message
sLine - The line message /

core/Module.php at line 169

onTopic

public void onTopic(string sChan, string sTopic)

When the topic is changed

Parameters:
sChan - the channel where the topic is changed
sTopic - The topic changed to

core/Module.php at line 182

onWhois

public void onWhois(string sWho, mixed sId, string sLine)

onWhois. Due to the nature of a whois, more than 1 ID can be sent, so we allow the parameter for it.

Parameters:
sWho - The person we are whois-ing
sLine - the line sent by the WHOIS

core/Module.php at line 38

setNick

public void setNick(string sNick)

what? Why would we want to change the module bot's nick? Oh.. I get it This is for when the bot's nick is updated but the System doesn't refer to the bot by its new nick. So this is useless.

Parameters:
sNick - The nickname of the bot to change to
Deprecated:
since v0.01

DeBot Framework