Minor bugfix
This commit is contained in:
parent
b35d8831a3
commit
f626fbe632
|
@ -57,6 +57,7 @@
|
||||||
|
|
||||||
$WELCOME_MESSAGE = "$EMOJI_BOT GOLEMbot
|
$WELCOME_MESSAGE = "$EMOJI_BOT GOLEMbot
|
||||||
$EMOJI_MSG Se scrivi un messaggio ti chiedo se inoltrarlo al canale
|
$EMOJI_MSG Se scrivi un messaggio ti chiedo se inoltrarlo al canale
|
||||||
|
Supporto anche **<b>grassetto</b>**, __<i>corsivo</i>__ e `<code>codice</code>`
|
||||||
$EMOJI_TOOLS Se scrivi un comando eseguo operazioni.
|
$EMOJI_TOOLS Se scrivi un comando eseguo operazioni.
|
||||||
Comandi disponibili: /help, /list";
|
Comandi disponibili: /help, /list";
|
||||||
?>
|
?>
|
||||||
|
|
26
main.php
26
main.php
|
@ -358,7 +358,7 @@ if (isset ($row->callback_query)) {
|
||||||
|
|
||||||
for ($i = 8; $i <= 21; $i++) {
|
for ($i = 8; $i <= 21; $i++) {
|
||||||
if ($i < $firstHour)
|
if ($i < $firstHour)
|
||||||
$kbd->insertItem(" ", null);
|
$kbd->insertItem(" ", "null");
|
||||||
else
|
else
|
||||||
$kbd->insertItem("$i".":00", $i);
|
$kbd->insertItem("$i".":00", $i);
|
||||||
|
|
||||||
|
@ -373,7 +373,6 @@ if (isset ($row->callback_query)) {
|
||||||
|
|
||||||
|
|
||||||
$text="A che ora vuoi inviare il messaggio?";
|
$text="A che ora vuoi inviare il messaggio?";
|
||||||
$reply = json_encode($container);
|
|
||||||
|
|
||||||
//~ $url = API_URL.API_TOKEN."/editMessageText?chat_id=".($chatID).
|
//~ $url = API_URL.API_TOKEN."/editMessageText?chat_id=".($chatID).
|
||||||
//~ "&message_id=".$inlineID .
|
//~ "&message_id=".$inlineID .
|
||||||
|
@ -491,6 +490,22 @@ elseif (isset($row->message)) {
|
||||||
}
|
}
|
||||||
if (DEBUG) info("Starting from status $status");
|
if (DEBUG) info("Starting from status $status");
|
||||||
|
|
||||||
|
// Reset CMD
|
||||||
|
if (($command = getCommand($row->message))['command'] == '/reset') {
|
||||||
|
warning("Reset command received");
|
||||||
|
$all_keys = $mc->getAllKeys();
|
||||||
|
foreach ($all_keys as $index => $key) {
|
||||||
|
if (strpos($key,$chatID) !== 0) {
|
||||||
|
$mc->delete($key);
|
||||||
|
info("Deleting $key");
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
unset($all_keys[$index]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
sendMessage($chatID, "Reset completato");
|
||||||
|
}
|
||||||
|
else {
|
||||||
switch($status) {
|
switch($status) {
|
||||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||||
* entering STATE_IDLE - message *
|
* entering STATE_IDLE - message *
|
||||||
|
@ -504,13 +519,12 @@ elseif (isset($row->message)) {
|
||||||
case '/help':
|
case '/help':
|
||||||
case '/start':
|
case '/start':
|
||||||
// Send some explainations about this bot
|
// Send some explainations about this bot
|
||||||
sendMessage($chatID,$WELCOME_MESSAGE);
|
sendMessage($chatID,$WELCOME_MESSAGE, "HTML");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case '/edit':
|
case '/edit':
|
||||||
// not yet implemented
|
// not yet implemented
|
||||||
sendMessage($chatID, "Bravo! Hai trovato un comando non ancora implementato. Apri il codice su GitHub e lavoraci su",
|
sendMessage($chatID, "Bravo! Hai trovato un comando non ancora implementato. Apri il codice su GitHub e lavoraci su");
|
||||||
"HTML", false, false, null, $reply);
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case '/list':
|
case '/list':
|
||||||
|
@ -621,7 +635,7 @@ elseif (isset($row->message)) {
|
||||||
default:
|
default:
|
||||||
wrong_action($chatID);
|
wrong_action($chatID);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// a not supported message (i.e. from a channel)
|
// a not supported message (i.e. from a channel)
|
||||||
else {
|
else {
|
||||||
|
|
Loading…
Reference in New Issue