Compare commits
2 Commits
45ffed60e2
...
45b613ca9b
Author | SHA1 | Date |
---|---|---|
Ceda EI | 45b613ca9b | |
Ceda EI | 04e26c69e6 |
|
@ -7,6 +7,7 @@ wiki - Search Wikipedia
|
|||
arch_wiki - Search the Arch wiki
|
||||
insult - As expected, insults
|
||||
weebify - Weebifies the given text
|
||||
absurdify - mAke tExT aBSUrd
|
||||
is - Is <your question>
|
||||
are - Are <your question>
|
||||
can - Can <your question>
|
||||
|
|
24
webhook.php
24
webhook.php
|
@ -411,6 +411,26 @@ function weebify() {
|
|||
send_text($text, true);
|
||||
}
|
||||
|
||||
function absurdify() {
|
||||
global $decoded;
|
||||
global $command_list;
|
||||
if(count($command_list) <= 1){
|
||||
send_text("Need text to absurdify. Send /absurdify text", true);
|
||||
return;
|
||||
}
|
||||
$chars = str_split(preg_replace('/^\/[^ ]+ /', '', strtolower($decoded->{"message"}->{"text"})));
|
||||
$text = "";
|
||||
foreach($chars as $char){
|
||||
if (rand(0,1) == 0){
|
||||
$text .= strtolower($char);
|
||||
}
|
||||
else {
|
||||
$text .= strtoupper($char);
|
||||
}
|
||||
}
|
||||
send_text($text, true);
|
||||
}
|
||||
|
||||
// Get JSON from post, store it and decode it.
|
||||
$var = file_get_contents('php://input');
|
||||
$decoded = json_decode($var);
|
||||
|
@ -518,6 +538,10 @@ $modules = array(
|
|||
array(
|
||||
"command" => "/weebify",
|
||||
"function" => "weebify();"
|
||||
),
|
||||
array(
|
||||
"command" => "/absurdify",
|
||||
"function" => "absurdify();"
|
||||
)
|
||||
);
|
||||
|
||||
|
|
Loading…
Reference in New Issue