B4J Tutorial CallMeBot: A Free "Personal Use" Bot to send WhatsApp, Telegram, Messenger & Voice Calls

Mashiane

Expert
Licensed User
Longtime User
Sending messages to Telegram...

One can use HTTPUtils to achieve this also. Your parameters for HTTPUtils should be user and the encoded text to send.




I am using this in BANano and thus using fetch for a GET method

B4X:
Private Sub btnSendTelegram_Click (e As BANanoEvent)
    'save settings
    Dim ls As Map = CreateMap()
    ls.Put("phone", txtTelephone.Value)
    ls.Put("api", txtAPIKey.Value)
    banano.SetLocalStorage2("callmebot", banano.ToJson(ls))
    '
    btnSendTelegram.Loading = True
    Dim api As SDUIFetch
    api.Initialize("https://api.callmebot.com/text.php")
    api.AddParameter("user", txtTelephone.Value)
    api.AddParameter("text", txtMessage.Value)
    banano.Await(api.GetWait)
    btnSendTelegram.Loading = False
End Sub

The received message will go to your callmebot API contact on your telepram.
 
Last edited:

Mashiane

Expert
Licensed User
Longtime User
Sending Messages to WhatsApp

1. You will need your APIKey
2. You will need you cellphone number including county code.

B4X:
Private Sub btnSend_Click (e As BANanoEvent)
    'save settings
    Dim ls As Map = CreateMap()
    ls.Put("phone", txtTelephone.Value)
    ls.Put("api", txtAPIKey.Value)
    banano.SetLocalStorage2("callmebot", banano.ToJson(ls))
    '
    btnSend.Loading = True
    Dim api As SDUIFetch
    api.Initialize("https://api.callmebot.com/whatsapp.php")
    api.AddParameter("source", "web")
    api.AddParameter("phone", txtTelephone.Value)
    api.AddParameter("apikey", txtAPIKey.Value)
    api.AddParameter("text", txtMessage.Value)
    banano.Await(api.GetWait)
    btnSend.Loading = False
End Sub

The parameters to use are, source, phone (country code + number), apikey + text as message.

output:



Input...

 

Mashiane

Expert
Licensed User
Longtime User
Sending Messages to Facebook Messenger

B4X:
Private Sub btnSendMessenger_Click (e As BANanoEvent)
    'save settings
    Dim ls As Map = CreateMap()
    ls.Put("phone", txtTelephone.Value)
    ls.Put("api", txtAPIKey.Value)
    banano.SetLocalStorage2("callmebot", banano.ToJson(ls))
    '
    btnSendMessenger.Loading = True
    Dim api As SDUIFetch
    api.Initialize("https://api.callmebot.com/facebook/send.php")
    api.AddParameter("apikey", txtAPIKey.Value)
    api.AddParameter("text", txtMessage.Value)
    banano.Await(api.GetWait)
    btnSendMessenger.Loading = False
End Sub

 

syerif

Active Member
Licensed User
Longtime User
hi
it is possible to send interactive messages?

best regards
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…