1. Przeportowanie modułu version (wersja) do nowej wersji API.
2. Przeportowanie modułu czesc do nowej wersji API.
3. Zmiana kolejności ładowania modułu legacy (zmiana numeru).
2 files deleted
2 files renamed
4 files added
New file |
| | |
| | | <?php |
| | | class bot_wersja_module implements BotModule { |
| | | function handle($msg, $params) { |
| | | return new BotMsg('<img src="./data/version/jacekk.png" /><br />'."\n" |
| | | . '<span color="#F70">Bot Gadu-Gadu</span> wersja '.main::VERSION.'<br />'."\n" |
| | | . 'http://jacekk.info/botgg'); |
| | | } |
| | | } |
| | | ?> |
New file |
| | |
| | | <?php |
| | | class bot_wersja_init implements BotModuleInit { |
| | | function register() { |
| | | $handler = array( |
| | | array( |
| | | 'file' => 'handler.php', |
| | | 'class' => 'bot_wersja_module', |
| | | 'method' => 'handle', |
| | | ) |
| | | ); |
| | | |
| | | return array( |
| | | 'version' => $handler, |
| | | 'wersja' => $handler, |
| | | 'wersia' => $handler, |
| | | 'v' => $handler, |
| | | ); |
| | | } |
| | | |
| | | function help($params = NULL) { |
| | | if($params === NULL) { |
| | | return new BotMsg('<b>wersja</b><br />'."\n" |
| | | . ' Wersja bota.<br />'."\n"); |
| | | } |
| | | else |
| | | { |
| | | return new BotMsg('<b>wersja</b> (aliasy: <b>v, version</b>)<br />'."\n" |
| | | . ' Zwraca wersję bota.'); |
| | | } |
| | | } |
| | | } |
| | | |
| | | return 'bot_wersja_init'; |
| | | ?> |
New file |
| | |
| | | <?php |
| | | class bot_wersja_module implements BotModule { |
| | | function czesc($msg, $params) { |
| | | $arg = funcs::utfToAscii($msg->args); |
| | | |
| | | $dozwolone = array('przyjacielu', 'kolego', 'bocie', ':)', '.', ':d', ':D'); |
| | | if(!in_array($arg, $dozwolone) && !empty($arg)) { |
| | | return new BotMsg('Funkcja <b>czesc</b> nie przyjmuje argumentów!'); |
| | | } |
| | | |
| | | return new BotMsg('<p>Witam!</p>'."\n" |
| | | . '<p>Jestem prostym botem Gadu-Gadu, który poda Ci kursy walut (wpisz: <b>kursy</b>), sprawdzi dane s³owo w s³owniku ortograficznym (wpisz: <b>ort s³owo</b>) lub przywita siê (tak jak teraz)!</p>'."\n" |
| | | . '<p>Informacje o wszystkich dostêpnych poleceniach otrzymasz po wys³aniu do mnie s³owa <b>pomoc</b>.</p>'); |
| | | } |
| | | |
| | | function hello($msg, $params) { |
| | | $arg = funcs::utfToAscii($msg->args); |
| | | |
| | | $dozwolone = array('friend', 'buddy', 'bot', 'evening', 'afternoon', 'morning', '.', ':)', ':d', ':D'); |
| | | if(!in_array($arg, $dozwolone) && !empty($arg)) { |
| | | return new BotMsg('Function <b>hello</b> does not have any arguments!'); |
| | | } |
| | | |
| | | return new BotMsg('<p>Hello!</p>'."\n" |
| | | . '<p>I am simple bot for Gadu-Gadu communicator, which will give you exchange rates (send: <b>kursy</b>), check word in polish dictionary (send: <b>ort word</b>) or say hello (just like now)!</p>'."\n" |
| | | . '<p>Write <b>help</b> to me to get information about all available commands.</p>'); |
| | | } |
| | | |
| | | function zachcianki($msg, $params) { |
| | | $txt = array('Ech... Czego siê tym ludziom zachciewa...', 'Znajd¼ sobie kogo¶.', 'CO?!'); |
| | | return new BotMsg($txt[array_rand($txt)]); |
| | | } |
| | | |
| | | function kocham($msg, $params) { |
| | | $arg = funcs::utfToAscii($msg->args); |
| | | |
| | | $dozwolone = array('cie', 'ci', 'cie przyjacielu', 'cie kolego', 'ci bocie', 'cie bocie', 'cie :)', 'przyjacielu', 'kolego', 'bocie', '.', ':)', ':d', ':D'); |
| | | if(!in_array($arg, $dozwolone) && !empty($arg)) { |
| | | return new BotMsg('Funkcja <b>kocham</b> nie przyjmuje epitetów!'); |
| | | } |
| | | |
| | | return new BotMsg('Mi³o mi!'); |
| | | } |
| | | |
| | | function odp($msg, $params) { |
| | | $txt = array( |
| | | 'lol' => array( |
| | | 'Co w tym takiego ¶miesznego? :P', |
| | | 'Nie widzê w tym nic, co mog³oby sprawiæ, ¿e tarzasz siê po pod³odze ;)', |
| | | 'LOL' |
| | | ), |
| | | 'do' => array( |
| | | 'Do... Du ³ot?!', |
| | | ), |
| | | ); |
| | | |
| | | $cmd = $msg->command; |
| | | return new BotMsg($txt[$cmd][array_rand($txt[$cmd])]); |
| | | } |
| | | } |
| | | ?> |
New file |
| | |
| | | <?php |
| | | class bot_czesc_init implements BotModuleInit { |
| | | function register() { |
| | | $handler_czesc = array( |
| | | array( |
| | | 'file' => 'handler.php', |
| | | 'class' => 'bot_czesc_module', |
| | | 'method' => 'czesc', |
| | | ) |
| | | ); |
| | | $handler_hello = array( |
| | | array( |
| | | 'file' => 'handler.php', |
| | | 'class' => 'bot_czesc_module', |
| | | 'method' => 'hello', |
| | | ) |
| | | ); |
| | | $handler_zachcianki = array( |
| | | array( |
| | | 'file' => 'handler.php', |
| | | 'class' => 'bot_czesc_module', |
| | | 'method' => 'zachcianki', |
| | | ) |
| | | ); |
| | | $handler_kocham = array( |
| | | array( |
| | | 'file' => 'handler.php', |
| | | 'class' => 'bot_czesc_module', |
| | | 'method' => 'kocham', |
| | | ) |
| | | ); |
| | | $handler_odp = array( |
| | | array( |
| | | 'file' => 'handler.php', |
| | | 'class' => 'bot_czesc_module', |
| | | 'method' => 'odp', |
| | | ) |
| | | ); |
| | | |
| | | return array( |
| | | 'czesc' => $handler_czesc, |
| | | 'witaj' => $handler_czesc, |
| | | 'witam' => $handler_czesc, |
| | | 'siema' => $handler_czesc, |
| | | 'hej' => $handler_czesc, |
| | | 'heeej' => $handler_czesc, |
| | | 'elo' => $handler_czesc, |
| | | 'haj' => $handler_czesc, |
| | | 'test' => $handler_czesc, |
| | | 'good' => $handler_hello, |
| | | 'hello' => $handler_hello, |
| | | 'hi' => $handler_hello, |
| | | 'sex' => $handler_zachcianki, |
| | | 'fiut' => $handler_zachcianki, |
| | | 'chuj' => $handler_zachcianki, |
| | | 'huj' => $handler_zachcianki, |
| | | 'seks' => $handler_zachcianki, |
| | | 'seksu' => $handler_zachcianki, |
| | | 'porno' => $handler_zachcianki, |
| | | 'ssij' => $handler_zachcianki, |
| | | 'obciagniesz' => $handler_zachcianki, |
| | | 'wal' => $handler_zachcianki, |
| | | 'kocham' => $handler_kocham, |
| | | 'lubie' => $handler_kocham, |
| | | 'dzieki' => $handler_kocham, |
| | | 'dziekuje' => $handler_kocham, |
| | | 'lol' => $handler_odp, |
| | | 'do' => $handler_odp, |
| | | ); |
| | | } |
| | | |
| | | function help($params = NULL) { |
| | | if($params === NULL) { |
| | | return new BotMsg('<b>czesc</b><br />'."\n" |
| | | . ' Odpowiada na przywitanie.<br />'."\n"); |
| | | } |
| | | else |
| | | { |
| | | return new BotMsg('<b>czesc</b> (aliasy: <b>witam, witaj, hej</b>)<br />'."\n" |
| | | . ' Bot przedstawia się i odpowiada na przywitanie.'); |
| | | } |
| | | } |
| | | } |
| | | |
| | | return 'bot_czesc_init'; |
| | | ?> |