From 3be0e41cd6654c4929ecf192df368f19e8a9ad59 Mon Sep 17 00:00:00 2001
From: Jacek Kowalski <Jacek@jacekk.info>
Date: Fri, 13 Jul 2012 18:36:51 +0000
Subject: [PATCH] Przeportowanie modułu kino do nowej wersji API.
---
modules/70_kino/init.php | 60 +++++
/dev/null | 285 -------------------------
modules/70_kino/handler.php | 282 +++++++++++++++++++++++++
3 files changed, 342 insertions(+), 285 deletions(-)
diff --git a/modules/70_kino.php b/modules/70_kino.php
deleted file mode 100644
index da30538..0000000
--- a/modules/70_kino.php
+++ /dev/null
@@ -1,285 +0,0 @@
-<?php
-class kino implements module {
- static function register_cmd() {
- return array(
- 'kino' => 'cmd_kino',
- 'kina' => 'cmd_kino',
- 'k' => 'cmd_kino',
- 'rep' => 'cmd_kino',
- 'repertuar' => 'cmd_kino',
- 'u' => 'cmd_ustaw',
- 'ustaw' => 'cmd_ustaw',
- );
- }
-
- static function help($cmd = NULL) {
- if($cmd === NULL) {
- GGapi::putRichText('kino ', TRUE);
- GGapi::putRichText('miasto nazwa [kiedy]', FALSE, TRUE);
- GGapi::putRichText("\n".' Repertuar kina ');
- GGapi::putRichText('nazwa', FALSE, TRUE);
- GGapi::putRichText("\n");
- GGapi::putRichText('ustaw ', TRUE);
- GGapi::putRichText('miasto nazwa', FALSE, TRUE);
- GGapi::putRichText("\n".' Ustawia domyślne kino '."\n\n");
- }
- elseif(substr($cmd, 0, 1)=='u') {
- GGapi::putRichText('ustaw ', TRUE);
- GGapi::putRichText('miasto nazwa', FALSE, TRUE);
- GGapi::putRichText("\n".' Ustawia domyślną lokalizację dla komendy kino na ');
- GGapi::putRichText('[nazwa]', FALSE, TRUE);
- GGapi::putRichText(' w mieście ');
- GGapi::putRichText('[miasto]', FALSE, TRUE);
- }
- else
- {
- GGapi::putRichText('kino ', TRUE);
- GGapi::putRichText('miasto nazwa [kiedy]', FALSE, TRUE);
- GGapi::putRichText("\n".' Repertuar kina ');
- GGapi::putRichText('nazwa', FALSE, TRUE);
- GGapi::putRichText(' w mieście ');
- GGapi::putRichText('miasto', FALSE, TRUE);
- GGapi::putRichText(' na ');
- GGapi::putRichText('[kiedy]', FALSE, TRUE);
- GGapi::putRichText(' (dziś, jutro, pojutrze)');
- }
- }
-
- static function cmd_ustaw($cmd, $arg) {
- $arg = funcs::utfToAscii($arg);
-
- database::add($_GET['from'], 'kino', 'kino', $arg);
-
- if(empty($arg)) {
- GGapi::putText('Usunięto domyślne kino. Aby otrzymać listę dostępnych obiektów wpisz:'."\n");
- GGapi::putRichText('kino', TRUE);
- GGapi::putRichText(' Miasto', FALSE, TRUE);
- }
- else
- {
- GGapi::putText('Podane kino zostało zapisane jako domyślne. Sprawdź, czy jest poprawne wpisując:'."\n");
- GGapi::putRichText('kino', TRUE);
- }
- }
-
- static function cmd_kino($cmd, $arg) {
- $arg = funcs::utfToAscii($arg);
- if(empty($arg)) {
- $arg = database::get($_GET['from'], 'kino', 'kino');
- if(empty($arg)) {
- GGapi::putText('Podaj nazwę miejscowości i kina.'."\n\n");
- GGapi::putRichText('Przykłady', FALSE, FALSE, TRUE);
- GGapi::putRichText("\n".'kino Kraków'."\n".'kino Kraków Multikino');
- return FALSE;
- }
- }
- else
- {
- $arg2 = database::get($_GET['from'], 'kino', 'kino');
- }
-
- /*
- MIASTO
- */
- $miasta = self::getMiasta(); $found = FALSE;
-
- if(!$miasta) {
- GGapi::putText('Przepraszamy, wystąpił bład przy pobieraniu listy miejscowości.');
- return FALSE;
- }
-
- foreach($miasta as $miasto => $miasto_num) {
- if(($pos = strpos($arg, funcs::utfToAscii($miasto))) !== FALSE) {
- $found = $miasto_num;
- $arg = trim(str_replace(' ', ' ', substr($arg, 0, $pos).substr($arg, $pos+strlen(funcs::utfToAscii($miasto)))));
- break;
- }
- }
-
- if($found===FALSE && !empty($arg2)) {
- foreach($miasta as $miasto => $miasto_num) {
- if(($pos = strpos($arg2, funcs::utfToAscii($miasto))) !== FALSE) {
- $found = $miasto_num;
- $arg2 = trim(str_replace(' ', ' ', substr($arg2, 0, $pos).substr($arg2, $pos+strlen(funcs::utfToAscii($miasto)))));
- break;
- }
- }
- }
-
- if($found === FALSE) {
- $txt = 'Wybrane miasto nie został odnalezione. Dostępne miejscowości:';
- foreach($miasta as $miasto => $num) {
- $txt .= "\n".$miasto;
- }
- GGapi::putText($txt);
- return FALSE;
- }
-
-
- /*
- KIEDY
- */
- $tydzien = array('niedziela', 'poniedzialek', 'wtorek', 'sroda', 'czwartek', 'piatek', 'sobota');
- $data = array(
- 'dzis' => '',
- 'teraz' => '',
- 'jutro' => '1',
- 'pojutrze' => '2',
- 'po jutrze' => '2',
- );
- for($i=0; $i<3; $i++) {
- $data[date('d.m', strtotime('+'.$i.' day'))] = ($i ? $i : '');
- $data[date('j.m', strtotime('+'.$i.' day'))] = ($i ? $i : '');
- }
-
- $czas = '';
- foreach($data as $known => $d) {
- if(($pos = strpos($arg, $known))!==FALSE) {
- $czas = $d;
- $arg = trim(str_replace(' ', ' ', substr($arg, 0, $pos).substr($arg, $pos+strlen($known))));
- break;
- }
- }
-
- /*
- KINO
- */
- $kina = self::getKina($miasto_num, $czas); $found = FALSE;
-
- if(!$kina) {
- GGapi::putText('Przepraszamy, wystąpił bład przy pobieraniu listy kin.');
- return FALSE;
- }
-
- if(empty($kina)) {
- GGapi::putText(($czas == '1' ? 'Jutro' : ($czas == '2' ? 'Pojutrze' : 'Dziś')).' żadne filmy nie są wyświetlane w podanym mieście.'."\n\n");
- GGapi::putRichText('Spróbuj też:', FALSE, FALSE, TRUE);
- GGapi::putRichText("\n".'kino '.$miasto.' '.$kino.' '.($czas != '1' ? 'jutro' : ($czas != '2' ? 'pojutrze' : 'dziś')).
- "\n".'kino '.$miasto.' '.$kino.' '.($czas != '' ? 'dziś' : ($czas != '2' ? 'pojutrze' : 'dziś')));
- return FALSE;
- }
-
- if(!empty($arg)) {
- foreach($kina as $kino => $kino_id) {
- if(levenshtein(funcs::utfToAscii($kino), $arg, 1, 1, 0) < 2) {
- $found = $kino_id;
- break;
- }
- }
- }
-
- if($found===FALSE && !empty($arg2)) {
- foreach($kina as $kino => $kino_id) {
- if(levenshtein(funcs::utfToAscii($kino), $arg2, 1, 1, 0) < 2) {
- $found = $kino_id;
- break;
- }
- }
- }
-
- if($found === FALSE) {
- $txt = (!empty($arg) ? 'Podany obiekt nie został znaleziony. ' : '').'Dostępne kina w pasujących miastach:';
- foreach($kina as $kino => $num) {
- $txt .= "\n".$miasto.' '.$kino;
- }
- GGapi::putText($txt."\n\n");
- GGapi::putRichText('Przykład:', FALSE, FALSE, TRUE);
- GGapi::putRichText("\n".'kino '.$miasto.' '.$kino.' '.($czas == '1' ? 'jutro' : ($czas == '2' ? 'pojutrze' : 'dziś')));
- return FALSE;
- }
-
- /*
- REPERTUAR
- */
- $filmy = self::getKino($miasto_num, $kino_id, $czas);
-
- if(!$filmy) {
- GGapi::putText('Przepraszamy, wystąpił bład przy pobieraniu listy wyświelanych filmów.');
- return FALSE;
- }
-
- GGapi::putRichText('Repertuar dla kina '.$kino.' ('.$miasto.') na '.($czas == '1' ? 'jutro' : ($czas == '2' ? 'pojutrze' : 'dziś')).':', TRUE);
- if(empty($filmy)) {
- GGapi::putRichText("\n".'Brak repertuaru');
- }
- else
- {
- foreach($filmy as $film) {
- $txt .= "\n".$film[0].' '.$film[1];
- }
- }
- GGapi::putRichText($txt);
- }
-
- static function tidy($code) {
- $tidy = new tidy;
- $tidy->parseString($code, array(
- 'add-xml-decl' => true,
- 'output-xml' => true,
- ), 'raw');
- $tidy->CleanRepair();
- return str_replace(array(' ', 'margin:="'), array(' ', 'margin="'), (string)$tidy);
- }
-
- static function cache($url) {
- $time = '+2 hour'; $dir = './data/kino/cache/';
-
- if(file_exists($dir.md5($url))) {
- $mtime = @filemtime($dir.md5($url));
- }
- if($mtime && $mtime > strtotime('today '.$time) && $mtime < strtotime('tomorrow '.$time)) {
- return file_get_contents($dir.md5($url));
- }
- else
- {
- $dane = @file_get_contents($url);
- if(!$dane) {
- trigger_error('Nie udało się pobrać repertuaru kina, przepraszamy.', E_USER_ERROR);
- }
- $dane = self::tidy($dane);
- file_put_contents($dir.md5($url), $dane);
- return $dane;
- }
- }
-
- static function getMiasta() {
- $return = array();
- $dane = @simplexml_load_string(self::cache('http://film.interia.pl/kino/repertuar'));
- if(!$dane) return FALSE;
- $dane = $dane->xpath('//div[@id=\'cities\']//a');
- foreach($dane as $miasto) {
- $miasto['href'] = (string)$miasto['href'];
- $return[str_replace(array("\r\n", "\r", "\n"), array(' ', ' ', ' '), (string)$miasto)] = substr($miasto['href'], strpos($miasto['href'], ',')+1);
- }
-
- return $return;
- }
-
- static function getKina($miasto, $kiedy='') {
- $return = array();
- $dane = @simplexml_load_string(self::cache('http://film.interia.pl/kino/repertuar//kina,'.$miasto.($kiedy ? ','.$kiedy : '')));
- if(!$dane) return FALSE;
- $dane = $dane->xpath('//div[@id=\'mainContent\']/table//th[@class=\'theatre\']/a[1]');
- if(!empty($dane)) {
- foreach($dane as $kino) {
- $return[str_replace(array("\r\n", "\r", "\n"), array(' ', ' ', ' '), (string)$kino)] = (string)$kino['name'];
- }
- }
- return $return;
- }
-
- static function getKino($miasto, $kino, $kiedy='') {
- $return = array();
- $dane = @simplexml_load_string(self::cache('http://film.interia.pl/kino/repertuar//kina,'.$miasto.($kiedy ? ','.$kiedy : '')));
- if(!$dane) return FALSE;
- $dane = $dane->xpath('//div[@id=\'mainContent\']/table//a[@name=\''.$kino.'\']/../../following-sibling::tr');
- if(!empty($dane)) {
- foreach($dane as $film) {
- if($film->th) break;
- $return[] = array((string)$film->td[1], str_replace(array("\r\n", "\r", "\n"), array(' ', ' ', ' '), (string)$film->td[0]->a));
- }
- }
- return $return;
- }
-}
-?>
\ No newline at end of file
diff --git a/modules/70_kino/handler.php b/modules/70_kino/handler.php
new file mode 100644
index 0000000..93b5304
--- /dev/null
+++ b/modules/70_kino/handler.php
@@ -0,0 +1,282 @@
+<?php
+class bot_kino_module implements BotModule {
+ function cache($url) {
+ $time = '+2 hour';
+ $dir = './data/kino/cache/';
+
+ if(file_exists($dir.md5($url))) {
+ $mtime = @filemtime($dir.md5($url));
+ }
+
+ if($mtime && $mtime > strtotime('today '.$time) && $mtime < strtotime('tomorrow '.$time)) {
+ $dane = file_get_contents($dir.md5($url));
+ }
+ else
+ {
+ $dane = @file_get_contents($url);
+ if(!$dane) {
+ return FALSE;
+ }
+
+ file_put_contents($dir.md5($url), $dane);
+ }
+
+ libxml_use_internal_errors(TRUE);
+
+ $dom = new DOMDocument();
+ if(!$dom->loadHTML($dane)) {
+ libxml_use_internal_errors(FALSE);
+ return FALSE;
+ }
+
+ return $dom;
+ }
+
+ function getMiasta() {
+ $xml = $this->cache('http://film.interia.pl/kino/repertuar');
+ if(!$xml) return FALSE;
+
+ $xpath = new DOMXPath($xml);
+ $dane = $xpath->query('//div[@id=\'cities\']//a');
+ $return = array();
+
+ foreach($dane as $miasto) {
+ $href = $miasto->getAttribute('href');
+ $data = trim($miasto->textContent);
+ $return[$data] = substr($href, strpos($href, ',')+1);
+ }
+
+ return $return;
+ }
+
+ function getKina($miasto, $kiedy='') {
+ $xml = $this->cache('http://film.interia.pl/kino/repertuar//kina,'.$miasto.($kiedy ? ','.$kiedy : ''));
+ if(!$xml) return FALSE;
+
+ $xpath = new DOMXPath($xml);
+ $dane = $xpath->query('//div[@id=\'mainContent\']/table//th[@class=\'theatre\']/a[1]');
+ $return = array();
+
+ foreach($dane as $kino) {
+ $name = trim($kino->textContent);
+ $return[$name] = $kino->getAttribute('name');
+ }
+
+ return $return;
+ }
+
+ function getKino($miasto, $kino, $kiedy='') {
+ $xml = $this->cache('http://film.interia.pl/kino/repertuar//kina,'.$miasto.($kiedy ? ','.$kiedy : ''));
+ if(!$xml) return FALSE;
+
+ $xpath = new DOMXPath($xml);
+ $dane = $xpath->query('//div[@id=\'mainContent\']/table//a[@name=\''.$kino.'\']/../../following-sibling::tr');
+ $return = array();
+
+ foreach($dane as $film) {
+ if($film->firstChild && $film->firstChild->nodeName == 'th') break;
+
+ $tds = $xpath->query('td', $film);
+ $name = $xpath->query('a[1]', $tds->item(0));
+
+ $more = array();
+ $more_xml = $xpath->query('span[@class=\'reper\']/span', $tds->item(0));
+ foreach($more_xml as $more_x) {
+ $more[] = $more_x->textContent;
+ }
+
+ $return[] = array(
+ trim($tds->item(1)->textContent),
+ trim($name->item(0)->textContent),
+ implode(', ', $more),
+ );
+ }
+
+ return $return;
+ }
+
+ function ustaw($msg, $params) {
+ $arg = funcs::utfToAscii($msg->args);
+
+ if(empty($arg)) {
+ unset($msg->session->kino);
+ return new BotMsg('Ustawienie domyślnego kino zostało usunięte. Aby ponownie je ustawić, wpisz:<br />'."\n"
+ . 'ustaw <i>miasto kino</i>');
+ }
+ else
+ {
+ $msg->session->kino = $arg;
+ return new BotMsg('Podane miasto/kino zostało zapisane jako domyślne. Sprawdź, czy jest poprawne wysyłając komendę <b>kino</b> bez argumentów.');
+ }
+ }
+
+ function handle($msg, $params) {
+ $arg = funcs::utfToAscii($msg->args);
+
+ if(empty($arg)) {
+ $arg = $msg->session->kino;
+ if(empty($arg)) {
+ return new BotMsg('Podaj nazwę miejscowości i kina.<br />'."\n"
+ . '<br />'."\n"
+ . '<u>Przykłady:</u><br />'."\n"
+ . 'kino Kraków<br />'."\n"
+ . 'kino Kraków Multikino');
+ }
+ }
+ else
+ {
+ $arg2 = $msg->session->kino;
+ }
+
+ /*
+ MIASTO
+ */
+ $miasta = self::getMiasta();
+ $found = FALSE;
+ $miasto_num = $miasto_nazw = '';
+
+ if(!$miasta) {
+ return new BotMsg('Przepraszamy, wystąpił bład przy pobieraniu listy miejscowości.');
+ }
+
+ foreach($miasta as $miasto => $numer) {
+ $szukaj = funcs::utfToAscii($miasto);
+ if(($pos = strpos($arg, $szukaj)) !== FALSE) {
+ $found = TRUE;
+ $miasto_nazw = htmlspecialchars($miasto);
+ $miasto_num = $numer;
+
+ $arg = trim(str_replace(' ', ' ', substr($arg, 0, $pos).substr($arg, $pos+strlen($szukaj))));
+ break;
+ }
+ }
+
+ if($found===FALSE && !empty($arg2)) {
+ foreach($miasta as $miasto => $numer) {
+ $szukaj = funcs::utfToAscii($miasto);
+ if(($pos = strpos($arg2, $szukaj)) !== FALSE) {
+ $found = TRUE;
+ $miasto_nazw = htmlspecialchars($miasto);
+ $miasto_num = $numer;
+
+ $arg2 = trim(str_replace(' ', ' ', substr($arg2, 0, $pos).substr($arg2, $pos+strlen($szukaj))));
+ break;
+ }
+ }
+ }
+
+ if($found === FALSE) {
+ $txt = 'Wybrane miasto nie został odnalezione. Obsługiwane miejscowości:';
+ foreach($miasta as $miasto => $num) {
+ $txt .= '<br />'."\n".htmlspecialchars($miasto);
+ }
+ $txt .= '<br />'."\n"
+ . '<br />'."\n"
+ . '<u>Przykład:</u><br />'."\n"
+ . 'kino '.htmlspecialchars($miasto);
+ return new BotMsg($txt);
+ }
+
+
+ /*
+ KIEDY
+ */
+ $tydzien = array('niedziela', 'poniedzialek', 'wtorek', 'sroda', 'czwartek', 'piatek', 'sobota');
+ $data = array(
+ 'dzis' => '',
+ 'teraz' => '',
+ 'jutro' => '1',
+ 'pojutrze' => '2',
+ 'po jutrze' => '2',
+ );
+ for($i=0; $i<3; $i++) {
+ $data[date('d.m', strtotime('+'.$i.' day'))] = ($i ? $i : '');
+ $data[date('j.m', strtotime('+'.$i.' day'))] = ($i ? $i : '');
+ }
+
+ $czas = '';
+ foreach($data as $known => $d) {
+ if(($pos = strpos($arg, $known))!==FALSE) {
+ $czas = $d;
+ $arg = trim(str_replace(' ', ' ', substr($arg, 0, $pos).substr($arg, $pos+strlen($known))));
+ break;
+ }
+ }
+
+ /*
+ KINO
+ */
+ $kina = self::getKina($miasto_num, $czas);
+ $found = FALSE;
+ $kino_num = $kino_nazw = '';
+
+ if(!$kina) {
+ return new BotMsg('Przepraszamy, wystąpił bład przy pobieraniu listy kin.');
+ }
+
+ if(empty($kina)) {
+ return new BotMsg(($czas == '1' ? 'Jutro' : ($czas == '2' ? 'Pojutrze' : 'Dziś')).' żadne filmy nie są wyświetlane w podanym mieście.<br />'."\n"
+ . '<br />'."\n"
+ . '<u>Spróbuj też:</u><br />'."\n"
+ . 'kino '.$miasto_nazw.' '.htmlspecialchars($arg).' '.($czas != '1' ? 'jutro' : ($czas != '2' ? 'pojutrze' : 'dziś')).'<br />'."\n"
+ . 'kino '.$miasto_nazw.' '.htmlspecialchars($arg).' '.($czas != '' ? 'dziś' : ($czas != '2' ? 'pojutrze' : 'dziś')));
+ }
+
+ if(!empty($arg)) {
+ foreach($kina as $kino => $kino_id) {
+ if(levenshtein(funcs::utfToAscii($kino), $arg, 1, 1, 0) < 2) {
+ $found = TRUE;
+ $kino_num = $kino_id;
+ $kino_nazw = htmlspecialchars($kino);
+ break;
+ }
+ }
+ }
+
+ if($found===FALSE && !empty($arg2)) {
+ foreach($kina as $kino => $kino_id) {
+ if(levenshtein(funcs::utfToAscii($kino), $arg2, 1, 1, 0) < 2) {
+ $found = TRUE;
+ $kino_num = $kino_id;
+ $kino_nazw = htmlspecialchars($kino);
+ break;
+ }
+ }
+ }
+
+ if($found === FALSE) {
+ $txt = (!empty($arg) ? 'Podany obiekt nie został znaleziony. ' : '').'Dostępne kina w pasujących miastach:';
+ foreach($kina as $kino => $num) {
+ $txt .= '<br />'."\n".$miasto_nazw.' '.htmlspecialchars($kino);
+ }
+
+ return new BotMsg($txt.'<br />'."\n"
+ . '<br />'."\n"
+ . '<u>Przykład:</u><br />'."\n"
+ . 'kino '.$miasto_nazw.' '.htmlspecialchars($kino).' '.($czas == '1' ? 'jutro' : ($czas == '2' ? 'pojutrze' : 'dziś')));
+ }
+
+ /*
+ REPERTUAR
+ */
+ $filmy = self::getKino($miasto_num, $kino_id, $czas);
+
+ if(!$filmy) {
+ return new BotMsg('Przepraszamy, wystąpił bład przy pobieraniu listy wyświelanych filmów.');
+ }
+
+ $txt = '<b>Repertuar dla kina '.$kino_nazw.' ('.$miasto_nazw.') na '.($czas == '1' ? 'jutro' : ($czas == '2' ? 'pojutrze' : 'dziś')).':</b>';
+ if(empty($filmy)) {
+ $txt .= '<br />'."\n".'Brak projekcji.';
+ }
+ else
+ {
+ foreach($filmy as $film) {
+ $txt .= '<br />'."\n".htmlspecialchars($film[0]).' '.htmlspecialchars($film[1]).($film[2]!='' ? ' ('.htmlspecialchars($film[2]).')' : '');
+ }
+ }
+
+ return new BotMsg($txt);
+ }
+}
+?>
\ No newline at end of file
diff --git a/modules/70_kino/init.php b/modules/70_kino/init.php
new file mode 100644
index 0000000..9920f4e
--- /dev/null
+++ b/modules/70_kino/init.php
@@ -0,0 +1,60 @@
+<?php
+class bot_kino_init implements BotModuleInit {
+ function register() {
+ $handler_ustaw = array(
+ array(
+ 'file' => 'handler.php',
+ 'class' => 'bot_kino_module',
+ 'method' => 'ustaw',
+ )
+ );
+ $handler_kino = array(
+ array(
+ 'file' => 'handler.php',
+ 'class' => 'bot_kino_module',
+ 'method' => 'handle',
+ )
+ );
+
+ return array(
+ 'kino' => $handler_kino,
+ 'kina' => $handler_kino,
+ 'k' => $handler_kino,
+ 'rep' => $handler_kino,
+ 'repertuar' => $handler_kino,
+ 'u' => $handler_ustaw,
+ 'ustaw' => $handler_ustaw,
+ );
+ }
+
+ function help($params = NULL) {
+ if($params === NULL) {
+ return new BotMsg('<b>kino</b> <i>miasto nazwa [kiedy]</i><br />'."\n"
+ . ' Repertuar kina.<br />'."\n"
+ . '<b>ustaw</b> <i>miasto nazwa</i><br />'."\n"
+ . ' Ustawia domyślne kino<br />'."\n"
+ . '<br />'."\n");
+ }
+ elseif(substr($params, 0, 1)=='u') {
+ return new BotMsg('<b>ustaw</b> <i>[miasto] [nazwa]</i> (alias: <b>u</b>)<br />'."\n"
+ . ' Ustawia domyślne kino/miasto dla komendy kino. W przypadku niepodania argumentów kasuje uprzednio ustawione informacje. Komenda nie sprawdza, czy dane miasto jest obsługiwane - po ustawieniu danych należy wykonać komendę kino.<br />'."\n"
+ . '<br />'."\n"
+ . '<u>Przykład:</u><br />'."\n"
+ . 'ustaw Kraków<br />'."\n"
+ . 'ustaw Kraków Multikino');
+ }
+ else
+ {
+ return new BotMsg('<b>kino</b> <i>miasto nazwa [kiedy]</i> (aliasy: <b>k, repertuar, rep</b>)<br />'."\n"
+ . ' Podaje repertuar kina <i>nazwa</i> w mieście <i>miasto</i> na <i>kiedy</i> (dziś, jutro, pojutrze). W przypadku pominięcia wszystkich argumentów, podawana jest lista obsługiwanych miast. Pominięcie nazwy skutkuje wylistowaniem kin w danym mieście. Domyślnie podawany jest repertuar na dziś. Jeśli brakuje któregoś argumentu, podejmowana jest próba zastąpienia go danymi zapisanymi za pomocą komendy <b>ustaw</b>.<br />'."\n"
+ . '<br />'."\n"
+ . '<u>Przykład:</u><br />'."\n"
+ . 'kino<br />'."\n"
+ . 'kino Kraków<br />'."\n"
+ . 'kino Kraków Multikino');
+ }
+ }
+}
+
+return 'bot_kino_init';
+?>
\ No newline at end of file
--
Gitblit v1.9.1