-
Notifications
You must be signed in to change notification settings - Fork 2
/
funcs.php
34 lines (31 loc) · 994 Bytes
/
funcs.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<?php
//HEADERS PARA A MANIPULAÇÃO DO TEXTO
header("Access-Control-Allow-Origin: *");
header("Access-Control-Allow-Methods: GET, POST, PUT, DELETE, OPTIONS");
header("Access-Control-Allow-Headers: x-test-header, Origin, X-Requested-With, Content-Type, Accept");
//DEBUGADOR PARA VERIFICAR ERROS
if($debug != 0){
ini_set('display_errors',1);
ini_set('display_startup_erros',1);
error_reporting(E_ALL);
}
/////////////////////
// FUNCOES DO BOT
/////////////////////
function creditos(){
echo "<br /><br />Bot feito por +5591993922203(WallaceWebs)";
}
function contar_piada(){
$opts = [
"http" => [
"method" => "GET",
"header" => "Accept: application/json\r\n" .
"Content-Type: application/json\r\n"
]
];
$saida = json_decode(file_get_contents('https://us-central1-kivson.cloudfunctions.net/charada-aleatoria', false, stream_context_create($opts)), true);
echo $saida['pergunta'] . "<br /><br />" . $saida['resposta'];
}
function hora(){
echo time();
}