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

Microsoft Bot Skype Group Chat
BotFramework sorry the service was upgraded and we need to start over
Best way to find moving function for a bot
api.ai domain intent query response
How to define string as luis entity
Luis V2 Remove action parameter/prompt
Telegram Bot PHP keyboard doesn't works
How can I use PromptDialog.Choice while allowing the user to type the options without worrying about accented letters?
Messenger Bot Webview not closing on IOS
Slack bot cannot post message to private channel
Slack bot to pre-format channel responses
Is it possible to display a table in skype from bot framework?
Connecting api of android app to bot framework
IntentDialog matches only once at the start in bot framework
Multiple assistant.ask or assistant.tell statement without user input
Api.ai be public for all not only for tester, developer, admin

Categories

HOME
apache-nifi
functional-programming
focus
hdfs
initialization
whmcs
android-emulator
autocomplete
video-streaming
native-base
azure-logic-apps
locationmanager
circleci
google-awareness
bundler
max-msp-jitter
pywinauto
c#-7.0
fosuserbundle
cpu-usage
neo4j.rb
kamailio
web-push
tsung
mdns
toad
winsock
rspec-rails
apptentive
polyml
keyboard-layout
formsauthenticationticket
testlink
eclipse-gmf
xll
utf
data-uri
icepdf
raytracing
vungle-ads
elasticsearch-aggregation
destroy
common-table-expression
roracle
scala-breeze
ilrepack
skip-lists
watir-webdriver
connect-direct
mobile-angular-ui
apache-modules
alertify
msxml
instafeedjs
email-injection
deviare
xcode6.4
s-function
tsqlt
system.net.mail
jenkins-workflow
qtcpsocket
eclemma
odp.net-managed
maximize
apple-configurator
wif4.5
webgrind
phpquery
arbre
place
wlanapi
search-form
domino-designer-eclipse
swagger-maven-plugin
karma-coverage
maven-shade-plugin
nhibernate-criteria
juttle
xml-signature
multivariate-testing
angular-ui-select
libgcc
maven-central
jini
miglayout
sql-function
preorder
gpu-programming
typesafe-stack
boinc
acitree
dynamic-rdlc-generation
donut-chart
semantic-merge
arrow
struts2-s2hibernate
datacontracts
3des
pyjamas
gaelyk
hungarian-notation
cassini
multiple-users
tessellation
iphone-sdk-4.3

Resources

Database Users
RDBMS discuss
Database Dev&Adm
javascript
java
csharp
php
android
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App