Open chopind16 opened 3 years ago
Hello chopind16,
actually the only way to send an image is to use the library version v3.0.0 (see the v3.0.0 branch) and calling the sendImage()
method.
You can send only binary data stored locally in memory or in a file (for example in a SD).
I have to add some examples, it's a work in progress work.
I'm wondering if I will add this functionality, maybe in the future.
Cheers,
Stefano
`#include "CTBot.h"
CTBot myBot; String ssid = "idih"; String pass = "ngapo nanyo aku."; String token = "1880656074:AAHurevCe1Kw9UMeokrvs-2eDeAVdd_tMGY"; const int id = 780422297; String foto = "https://www.arduino.cc/en/uploads/Trademark/ArduinoCommunityLogo.png";
void setup() { Serial.begin(9600); Serial.println("Starting TelegramBot..."); myBot.wifiConnect(ssid, pass); myBot.setTelegramToken(token);
if (myBot.testConnection()) { Serial.println("Koneksi Bagus"); } else { Serial.println("Koneksi Jelek"); }
}
void loop() { TBMessage msg; if (myBot.getNewMessage(msg)){ if (msg.text.equalsIgnoreCase("/image")) {
myBot.sendMessage(msg.sender.id, foto); } } } `
as you can see i make command /image, so my bot can send me an image every time i type my command. but my bot still send me link of image first. can someone help me how to make my bot directly send image from link without having to send a link again to me