bots


Telegram Bot PHP keyboard doesn't works


I have a problem to creating a custom keyboard for my telegram bot.
Simply, it doesn't works and I don't know the reason...
This is my code:
<?
$botToken = "363035762:AAGgw_724oEvgDa9d9BuBWUGVqF91NWDwb0";
$website = "https://api.telegram.org/bot".$botToken;
$update = file_get_contents('php://input');
$update = json_decode($update, TRUE);
$chatId = $update["message"]["chat"]["id"];
$message = $update["message"]["text"];
$telegramusername = $update["message"]["from"]["username"];
$message_id = $update["message"]["message_id"];
$message_name = $update["message"]["chat"]["first_name"];
switch($message)
{
case "ciao":
funzioneCiao($chatId);
break;
case "youtube":
TastieraInline($chatId);
break;
default:
TastieraMenuPrincipale($chatId);
break;
}
function inviaMessaggio($chatId, $messaggio)
{
$url = "$GLOBALS[website]/sendMessage?chat_id=$chatId&parse_mode=HTML&text=".urlencode($messaggio);
file_get_contents($url);
}
function funzioneCiao($chatId)
{
$messaggio = "ciao";
inviaMessaggio($chatId, $messaggio);
}
function TastieraMenuPrincipale($chatId)
{
$messaggio = "ciaaaao";
$tastiera = '&reply_markup={"keyboard":[["Menu Principale"],["Developer"]]}';
$url = "$GLOBALS[website]"."/sendMessage?chat_id=".$chatId."&parse_mode=HTML&text=".$messaggio.$tastiera;
file_get_contents($url);
}
function TastieraInline($chatId)
{
$message = "Iscriviti subito";
$tastiera = '&reply_markup={"inline_keyboard":[[{"text":"SEGUIMI!","url":"http://www.youtube.com"}]]}';
$url = $GLOBALS[website].'/sendMessage?chat_id='.$chatId.'&parse_mod=HTML&text='.$message.$tastiera;
file_get_contents($url);
}
?>
Functions: "funzioneCiao($chatId);" and "inviaMessaggio($chatId, $messaggio)" works but,
"TastieraMenuPrincipale($chatId)" and "TastieraInLine($ChatId)" doesn't works.
I'm a beginner in PHP so I have a lot difficult...
Thank you.
I just tested the code, it works perfectly...

Related Links

Telegram bot issue
Design custom entities for api.ai
How can I make a program to operate another program? [closed]
How to get the Skype username using skype calling feature
How to Resolve this issue “Could not find a stock quote for GOOGL or some other company names”
Open messenger chatbot webview extension in Chrome
How to pass control from one LUIS method to another?
How to transfer conversation from Bot to human agents?
How to speak skype user with the bot using skype calling feature?
Test connection to your bot getting failed : Bot Framework
How to find out programs communicate?
API.AI vs. WIT.AI from analytics and logging aspects
Call FormDialog from within a LUIS Dialog
How to access .wav file in bot simulator
How to call a LUIS Dialog outside of the MessagesController class
How to develop skype calling functionality using Azure Bot Service

Categories

HOME
libgdx
apache-nifi
xcode
kendo-dropdown
bots
selenium-builder
foaf
embedded-resource
portable-class-library
drag-and-drop
sentry
angular-meteor
ag-grid
ui-automation
save
tfs2010
anchor
reportviewer
azure-graph-api
scrape
fasm
cqrs
clish
vimeo
business-intelligence
spring-amqp
squid
rest-assured
exe
hidden
susy-sass
substring
cell
ratio
webviewclient
running-object-table
oracleforms
credit-card
locks
winsock
sca
quickcheck
creation
textmate2
cargo
elastica
widestring
spring-restcontroller
utf
viewcontroller
1wire
optionaldataexception
git-tfs
oracle-bmcs
moinmoin
django-static-precompiler
jgrapht
redisson
webvtt
mura
case-when
bpms
gapi
xcode6.4
dcount
gcloud-node
meld
unsigned
textblock
taco
wepay
lovefield
place
chicagoboss
nastran
ambiguity
alwayson
signed
mod-auth-openidc
jolie
rubber
rebar
storing-data
visual-c++-2012
siena
screwturn
.htpasswd
bittorrent-sync
jomsocial
nosql-aggregation
lync-2010
lru
axacropdf
delphi-xe4
email-verification
clrprofiler
taskkill
uitextfielddelegate
pageheap
microblogging
glassfish-esb
net-use
office-automation
mediacontroller
downgrade
resharper-5.0
suggestbox

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App