Compare commits
No commits in common. "45ffed60e277ef5368d713411082eb13bb43d4d3" and "1144e0b21782933fe1b09f2e2afa2ec986a9f90a" have entirely different histories.
45ffed60e2
...
1144e0b217
|
@ -6,7 +6,6 @@ coin - Tosses a coin
|
||||||
wiki - Search Wikipedia
|
wiki - Search Wikipedia
|
||||||
arch_wiki - Search the Arch wiki
|
arch_wiki - Search the Arch wiki
|
||||||
insult - As expected, insults
|
insult - As expected, insults
|
||||||
weebify - Weebifies the given text
|
|
||||||
is - Is <your question>
|
is - Is <your question>
|
||||||
are - Are <your question>
|
are - Are <your question>
|
||||||
can - Can <your question>
|
can - Can <your question>
|
||||||
|
|
52
webhook.php
52
webhook.php
|
@ -363,54 +363,6 @@ function commands() {
|
||||||
send_text(file_get_contents('command_list.txt'));
|
send_text(file_get_contents('command_list.txt'));
|
||||||
}
|
}
|
||||||
|
|
||||||
function weebify() {
|
|
||||||
global $decoded;
|
|
||||||
global $command_list;
|
|
||||||
if(count($command_list) <= 1){
|
|
||||||
send_text("Need text to weebify. Send /weebify text", true);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
$letters = array(
|
|
||||||
"a" => "卂",
|
|
||||||
"b" => "乃",
|
|
||||||
"c" => "匚",
|
|
||||||
"d" => "刀",
|
|
||||||
"e" => "乇",
|
|
||||||
"f" => "下",
|
|
||||||
"g" => "厶",
|
|
||||||
"h" => "卄",
|
|
||||||
"i" => "工",
|
|
||||||
"j" => "丁",
|
|
||||||
"k" => "长",
|
|
||||||
"l" => "乚",
|
|
||||||
"m" => "从",
|
|
||||||
"n" => "𠘨",
|
|
||||||
"o" => "口",
|
|
||||||
"p" => "尸",
|
|
||||||
"q" => "㔿",
|
|
||||||
"r" => "尺",
|
|
||||||
"s" => "丂",
|
|
||||||
"t" => "丅",
|
|
||||||
"u" => "凵",
|
|
||||||
"v" => "リ",
|
|
||||||
"w" => "山",
|
|
||||||
"x" => "乂",
|
|
||||||
"y" => "丫",
|
|
||||||
"z" => "乙"
|
|
||||||
);
|
|
||||||
$chars = str_split(preg_replace('/^\/[^ ]+ /', '', strtolower($decoded->{"message"}->{"text"})));
|
|
||||||
$text = "";
|
|
||||||
foreach($chars as $char){
|
|
||||||
if(key_exists($char, $letters)) {
|
|
||||||
$text .= $letters[$char];
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
$text .= $char;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
send_text($text, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Get JSON from post, store it and decode it.
|
// Get JSON from post, store it and decode it.
|
||||||
$var = file_get_contents('php://input');
|
$var = file_get_contents('php://input');
|
||||||
$decoded = json_decode($var);
|
$decoded = json_decode($var);
|
||||||
|
@ -514,10 +466,6 @@ $modules = array(
|
||||||
array(
|
array(
|
||||||
"command" => "/commands",
|
"command" => "/commands",
|
||||||
"function" => "commands();"
|
"function" => "commands();"
|
||||||
),
|
|
||||||
array(
|
|
||||||
"command" => "/weebify",
|
|
||||||
"function" => "weebify();"
|
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue