3 * This file is part of IrBot, irc robot.
4 * Copyright (C) 2007 Bellière Ludovic
6 * This program is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
21 CREATE TABLE IF NOT EXISTS `fortunes` (
22 `id` int(11) NOT NULL auto_increment,
23 `pseudo` varchar(25) NOT NULL,
24 `ip` varchar(15) default NULL,
25 `email` varchar(25) NOT NULL,
26 `site` varchar(70) NOT NULL,
27 `fortunes` text NOT NULL,
28 `date` datetime NOT NULL,
30 ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
34 private $IRCConn,$formater;
38 public function __construct() {
39 $this->IRCConn
= bot
::GetInstance();
40 $this->formater
= text_format
::GetInstance();
41 $this->commands
= array(
45 'help' => 'Print out one random fortune',
51 'help' => 'Print out the last fortune added. If an argument is passed, print the \'n\' last fortune added (max 10).',
57 'help' => 'Print out the \'n\' fortune, where \'n\' is the id.',
63 public function commands_list() {
64 return $this->commands
;
67 public function current_message ($message) {
68 /* gived by irc::parse_get
70 'type' => PRIVMSG|NOTICE,
71 'from' => Nick (reply to),
72 'to' => BotName / ChannelName,
73 'message' => The message
76 $this->message
= $message;
79 public function random() {}
80 public function last($n=1) {}
81 public function number($n) {}