Skip to content

Instantly share code, notes, and snippets.

💭
Dubium sapientiae initium

Salvatore Cordiano salvatorecordiano

💭
Dubium sapientiae initium
Block or report user

Report or block salvatorecordiano

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View requestPhoneNumber.php
<?php
$chatId = '---YOUR USER ID---';
$request = [
'chat_id' => $chatId,
'text' => 'Fai tap su condividi numero telefonico',
'reply_markup' => [
'keyboard' => [
[
@salvatorecordiano
salvatorecordiano / webhook.php
Last active May 5, 2020
Sample Telegram Bot (2)
View webhook.php
<?php
$content = file_get_contents("php://input");
$update = json_decode($content, true);
if(!$update)
{
exit;
}
$message = isset($update['message']) ? $update['message'] : "";
@salvatorecordiano
salvatorecordiano / webhook.php
Last active Apr 26, 2020
Sample Telegram Bot (1)
View webhook.php
<?php
$content = file_get_contents("php://input");
$update = json_decode($content, true);
if(!$update)
{
exit;
}
$message = isset($update['message']) ? $update['message'] : "";
@salvatorecordiano
salvatorecordiano / webhook.php
Last active Apr 8, 2020
Sample Telegram Bot (3)
View webhook.php
<?php
// recupero il contenuto inviato da Telegram
$content = \file_get_contents('php://input');
// converto il contenuto da JSON ad array PHP
$update = \json_decode($content, true);
// se la richiesta è null interrompo lo script
if(!$update) {
exit;
}
// assegno alle seguenti variabili il contenuto ricevuto da Telegram
View webhook.php
<?php
// recupero il contenuto inviato da Telegram
$content = file_get_contents("php://input");
// converto il contenuto da JSON ad array PHP
$update = json_decode($content, true);
// se la richiesta è null interrompo lo script
if(!$update)
{
exit;
}
View webhook.php
<?php
// recupero il contenuto inviato da Telegram
$content = file_get_contents("php://input");
// converto il contenuto da JSON ad array PHP
$update = json_decode($content, true);
// se la richiesta è null interrompo lo script
if(!$update)
{
exit;
}
@salvatorecordiano
salvatorecordiano / webhook.php
Last active Apr 7, 2020
Sample Telegram Bot (4)
View webhook.php
<?php
// insert here your Bot API token
define("BOT_TOKEN", "...");
$content = file_get_contents("php://input");
$update = json_decode($content, true);
if(!$update)
{
exit;
}
$message = isset($update['message']) ? $update['message'] : "";
View gist:ef5cdf789d7d983c9e717a90777d7743
ssh-keygen -t rsa -b 4096 -C "your_email@example.com"
View gist:ac6ca35ac032f50d861675b092e017a4
# first way
sudo apt-get remove docker docker-engine docker.io containerd runc
sudo apt-get update
sudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
gnupg-agent \
software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
View webhook.php
<?php
header('Content-Type: application/json');
$content = file_get_contents('php://input');
$update = json_decode($content, true);
if (!$update) {
exit;
}
$chatId = $update['message']['chat']['id'] ?? null;
You can’t perform that action at this time.