1 %%%-------------------------------------------------------------------
2 %%% File : flood_monitor.erl
3 %%% Author : ortitz <orbitz@blong.orbitz>
6 %%% Created : 10 Oct 2006 by ortitz <orbitz@blong.orbitz>
7 %%%-------------------------------------------------------------------
10 -export([start
/0, init
/0, deps
/0, loop
/0]).
14 spawn(flood_monitor
, init
, []).
17 msg_dispatch:add(["PRIVMSG"]),
18 flood_policy:start_link(),
19 flood_policy:add(privmsg
, 15, 30),
27 {"PRIVMSG", [From
, To
, _Message
], [Bot
]} ->
28 case flood_policy:update(privmsg
, {From
, To
, Bot
}) of
30 irc_bot:say(Bot
, "orbitz", lists:flatten(io_lib:format("Flood ~s ~s", [From
, To
])));