Compare commits
No commits in common. "1144e0b21782933fe1b09f2e2afa2ec986a9f90a" and "0043c8ab028155256f892bc7102cf4d1b80bfea5" have entirely different histories.
1144e0b217
...
0043c8ab02
39
webhook.php
39
webhook.php
|
@ -1,5 +1,4 @@
|
||||||
<?php
|
<?php
|
||||||
# vim: set tabstop=2 shiftwidth=2 expandtab:
|
|
||||||
$bot_name = "quadnite_bot";
|
$bot_name = "quadnite_bot";
|
||||||
$bot_api = require('api_key.php');
|
$bot_api = require('api_key.php');
|
||||||
|
|
||||||
|
@ -156,10 +155,10 @@ function rand_words($onewordmode) {
|
||||||
$num++;
|
$num++;
|
||||||
$words = array();
|
$words = array();
|
||||||
if (is_integer($num)) {
|
if (is_integer($num)) {
|
||||||
if ($num > 50) {
|
if ($num > 50) {
|
||||||
send_text("Too many words.", true);
|
send_text("Too many words.", true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$wordlist = file("/usr/share/dict/words");
|
$wordlist = file("/usr/share/dict/words");
|
||||||
for ($word=1; $word < $num; $word++) {
|
for ($word=1; $word < $num; $word++) {
|
||||||
$words[] = $wordlist[rand(0,count($wordlist))];
|
$words[] = $wordlist[rand(0,count($wordlist))];
|
||||||
|
@ -206,13 +205,13 @@ function media_wiki($base_url) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function coin() {
|
function coin() {
|
||||||
$random = rand(0,1);
|
$random = rand(0,1);
|
||||||
if ($random == 1) {
|
if ($random == 1) {
|
||||||
send_text('Heads', true);
|
send_text('Heads', true);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
send_text('Tails', true);
|
send_text('Tails', true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function get_gif($force) {
|
function get_gif($force) {
|
||||||
|
@ -352,15 +351,11 @@ function start() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function rate() {
|
function rate() {
|
||||||
send_html('<a href="https://t.me/tgdrbot?start=quadnite_bot">Vote for me on Telegram Directory!</a>');
|
send_html('<a href="https://t.me/tgdrbot?start=quadnite_bot">Vote for me on Telegram Directory!</a>');
|
||||||
}
|
}
|
||||||
|
|
||||||
function help() {
|
function help() {
|
||||||
send_html('You can either check /commands for a short overview or check the <a href="https://t.me/quadnite/9">Help Page</a>.');
|
send_html('<a href="https://t.me/quadnite/9">Help Page</a>');
|
||||||
}
|
|
||||||
|
|
||||||
function commands() {
|
|
||||||
send_text(file_get_contents('command_list.txt'));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get JSON from post, store it and decode it.
|
// Get JSON from post, store it and decode it.
|
||||||
|
@ -462,19 +457,15 @@ $modules = array(
|
||||||
array(
|
array(
|
||||||
"command" => "/rate",
|
"command" => "/rate",
|
||||||
"function" => "rate();"
|
"function" => "rate();"
|
||||||
),
|
|
||||||
array(
|
|
||||||
"command" => "/commands",
|
|
||||||
"function" => "commands();"
|
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!isset($decoded->{"message"}->{"text"})){
|
if (!isset($decoded->{"message"}->{"text"})){
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($decoded->{"message"}->{"pinned_message"})){
|
if (isset($decoded->{"message"}->{"pinned_message"})){
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
$command_list = explode(" ", $decoded->{"message"}->{"text"});
|
$command_list = explode(" ", $decoded->{"message"}->{"text"});
|
||||||
|
|
Loading…
Reference in New Issue