public function custom1($weekday) { $weekday_ptbr = i::weekday_ptBR($weekday); $day["Sun"] = "Whazaaaapp??? Sunday is the day of the week following Saturday but before Monday. Know as {$weekday_ptbr} in pt_BR"; $day["Mon"] = "Hey.. today is Monday.. Monday is the day of the week between Sunday and Tuesday. pt_BR translated to {$weekday_ptbr}"; $day["Tue"] = "Hey... today is Tue.."; $day["Wed"] = "Yeah today is weed.. ops, Wed."; $day["Thu"] = "Hmmm.."; $day["Fri"] = "TGIF!"; $day["Sat"] = "SAT! :D"; return $day[$weekday]; }
//check and ignore replieds $str_id = 1; echo $from_chatid . ":" . $update_id . ":" . $from . ": " . $text . "\n"; $reply = b::reply_get($text, $from, $str_id, $pp = false, $custom); //GENERATE A REPLY TEXT BASED ON YOUR TRIGGER AND BAD WORDS, SEE/EDIT reply_get() ON src/classes.php if ($chat_type != "private") { if (strpos($text, $conf["trigger"]) === false and $pvt == true) { i::fwrite_a($conf["replieds"], $update_id . "\r\n"); return false; } $reply = $from . " " . $reply; } echo "replying > {$reply}"; $reply = urlencode($reply); //encode reply text to use on HTTP POST $reply_textbuffer = $reply; $reply = b::telegrambot_sendReply($from_chatid, $reply); //POST a reply to group/pvt //i::vd($reply); //enable for debuggin $httpcode = $reply["header"]["http_code"]; if ($httpcode == 200 or $httpcode == 403) { if (isset($conf["debug_chatid"])) { $replydebug = b::telegrambot_sendReply($conf["debug_chatid"], $from . " {$text} :: {$from_chattitle} :: " . $reply_textbuffer); //send a reply to debug chatid too.. } i::fwrite_a($conf["replieds"], $update_id . "\r\n"); //if ok, stores it to avoid duplicates } } } }