Make case insensitive, reply to message.
This commit is contained in:
parent
f289a8b377
commit
45ffed60e2
|
@ -367,7 +367,7 @@ function weebify() {
|
||||||
global $decoded;
|
global $decoded;
|
||||||
global $command_list;
|
global $command_list;
|
||||||
if(count($command_list) <= 1){
|
if(count($command_list) <= 1){
|
||||||
send_text("Need text to weebify. Send /weebify text");
|
send_text("Need text to weebify. Send /weebify text", true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$letters = array(
|
$letters = array(
|
||||||
|
@ -398,7 +398,7 @@ function weebify() {
|
||||||
"y" => "丫",
|
"y" => "丫",
|
||||||
"z" => "乙"
|
"z" => "乙"
|
||||||
);
|
);
|
||||||
$chars = str_split(preg_replace('/^\/[^ ]+ /', '', $decoded->{"message"}->{"text"}));
|
$chars = str_split(preg_replace('/^\/[^ ]+ /', '', strtolower($decoded->{"message"}->{"text"})));
|
||||||
$text = "";
|
$text = "";
|
||||||
foreach($chars as $char){
|
foreach($chars as $char){
|
||||||
if(key_exists($char, $letters)) {
|
if(key_exists($char, $letters)) {
|
||||||
|
@ -408,7 +408,7 @@ function weebify() {
|
||||||
$text .= $char;
|
$text .= $char;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
send_text($text);
|
send_text($text, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get JSON from post, store it and decode it.
|
// Get JSON from post, store it and decode it.
|
||||||
|
|
Loading…
Reference in New Issue