Permalink
Browse files

Housekeeping. Adjust behaviour callbacks and make sure they are exported

  • Loading branch information...
mazenharake committed Apr 10, 2011
1 parent e8bd4be commit b2eb0ba38e854af9f9b82e5024d36555de2a04f8
Showing with 12 additions and 3 deletions.
  1. +1 −1 Makefile
  2. +4 −1 src/eirc_example_bot.erl
  3. +7 −1 src/gen_eircbot.erl
View
@@ -2,7 +2,7 @@
BEAMS := $(patsubst src/%, ebin/%, $(patsubst %.erl, %.beam, $(wildcard src/*.erl)))
ECINCLUDES := -I include
-ECFLAGS := +debug_info
+ECFLAGS := -pa ebin +debug_info
all: $(BEAMS)
View
@@ -31,6 +31,9 @@
-include("eirc.hrl").
+-export([init/2, on_connect/1, on_text/4, on_notice/4, on_join/3, on_part/3,
+ on_ctcp/4, handle_call/3, terminate/2]).
+
-compile(export_all).
-record(botstate, { cl, nick, waiting }).
@@ -98,7 +101,7 @@ handle_call({stop, QuitMsg}, _From, State) ->
terminate(Reason, _State) ->
io:format("Bot terminating ~p...~n", [Reason]),
ok.
-
+
%% This happens when the bot gets a normal message sent to it
View
@@ -142,8 +142,14 @@ callback(Module) ->
%% Behaviour API
%% =============================================================================
behaviour_info(callbacks) ->
- [{init, 1},
+ [{init, 2},
{on_connect, 1},
+ {on_text, 4},
+ {on_notice, 4},
+ {on_join, 3},
+ {on_part, 3},
+ {on_ctcp, 4},
+ {handle_call, 3},
{terminate, 2}];
behaviour_info(_) -> undefined.

0 comments on commit b2eb0ba

Please sign in to comment.