Skip to content

Instantly share code, notes, and snippets.

View amin-ak's full-sized avatar
😉
im good

Amin Akmali amin-ak

😉
im good
View GitHub Profile
@amin-ak
amin-ak / hellobot.php
Created December 20, 2018 14:15 — forked from ingria/hellobot.php
Simple PHP Telegram Bot
<?php
define('BOT_TOKEN', '12345678:replace-me-with-real-token');
define('API_URL', 'https://api.telegram.org/bot'.BOT_TOKEN.'/');
function apiRequestWebhook($method, $parameters) {
if (!is_string($method)) {
error_log("Method name must be a string\n");
return false;
}
<?php
/* wp_signon can only be executed before anything is outputed in the page because of that we're adding it to the init hook */
global $wppb_login;
$wppb_login = false;
function wppb_signon(){
global $error;
global $wppb_login;