telegram-bot

how save photo in telegram python bot?

女生的网名这么多〃 提交于 2020-01-10 20:11:10
问题 i want to write a telegram bot that save photos . this is my code , but its not working. and i don't know what is my problem? def image_handler(bot, update): file = bot.getFile(update.message.photo.file_id) print ("file_id: " + str(update.message.photo.file_id)) file.download('image.jpg') updater.dispatcher.add_handler(MessageHandler(Filters.photo, image_handler)) updater.start_polling() updater.idle() pleas help me to solve my problem. 回答1: update.message.photo is an array of photos sizes

Where to find the Telegram Api Key

时光怂恿深爱的人放手 提交于 2020-01-07 09:55:09
问题 I am trying to find the Api Key for Telegram but I cannot find it. Where do I find it on the website? If I use the Api Id, I get the error Incorrect Token Format in the C# Console Application. 回答1: In special official bot: https://telegram.me/BotFather Additional information on official Telegram FAQ page: https://core.telegram.org/bots/faq#how-do-i-create-a-bot 回答2: If someone knows how to make the images a bit smaller through formatting please go ahead and do so because that size is insane.

Where to find the Telegram Api Key

老子叫甜甜 提交于 2020-01-07 09:52:33
问题 I am trying to find the Api Key for Telegram but I cannot find it. Where do I find it on the website? If I use the Api Id, I get the error Incorrect Token Format in the C# Console Application. 回答1: In special official bot: https://telegram.me/BotFather Additional information on official Telegram FAQ page: https://core.telegram.org/bots/faq#how-do-i-create-a-bot 回答2: If someone knows how to make the images a bit smaller through formatting please go ahead and do so because that size is insane.

Where to find the Telegram Api Key

Deadly 提交于 2020-01-07 09:52:10
问题 I am trying to find the Api Key for Telegram but I cannot find it. Where do I find it on the website? If I use the Api Id, I get the error Incorrect Token Format in the C# Console Application. 回答1: In special official bot: https://telegram.me/BotFather Additional information on official Telegram FAQ page: https://core.telegram.org/bots/faq#how-do-i-create-a-bot 回答2: If someone knows how to make the images a bit smaller through formatting please go ahead and do so because that size is insane.

Google App Script - Telegram Bot - callback_data of an inline_keyboard

情到浓时终转凉″ 提交于 2020-01-06 08:44:08
问题 I don't want to use any library and i want to create the function that can react to a pressed botton of an inline_keyboard. I use webhook. The following code works great for incoming messages but I need help to add the callback_query data. function doPost(e) { var data = JSON.parse(e.postData.contents); if(data.message){//working great var text = data.message.text; var id = data.message.from.id; sendText(id,text); } if(data.callback_data){//this part doesn't work and i need help for this. /

Google App Script - Telegram Bot - callback_data of an inline_keyboard

*爱你&永不变心* 提交于 2020-01-06 08:43:59
问题 I don't want to use any library and i want to create the function that can react to a pressed botton of an inline_keyboard. I use webhook. The following code works great for incoming messages but I need help to add the callback_query data. function doPost(e) { var data = JSON.parse(e.postData.contents); if(data.message){//working great var text = data.message.text; var id = data.message.from.id; sendText(id,text); } if(data.callback_data){//this part doesn't work and i need help for this. /

telegram keyboard not showing non English languages chracters?

守給你的承諾、 提交于 2020-01-06 08:17:27
问题 I'm trying to write a php telegram bot in Persian which is a non English utf8 language. when I try to send plain text in Persian to my client it works perfectly ok $array = [ "chat_id" => $chat_id, "text" => $someNonEnglishText ]; $telegram->sendMessage($array); but when I try to send keyboard data with the code below it just show some question marks like ???????????????? on my keyboard buttons $reply_markup = $telegram->replyKeyboardMarkup([ 'keyboard' => $someNonEnglishkeyboard, 'resize

telegram keyboard not showing non English languages chracters?

浪子不回头ぞ 提交于 2020-01-06 08:16:12
问题 I'm trying to write a php telegram bot in Persian which is a non English utf8 language. when I try to send plain text in Persian to my client it works perfectly ok $array = [ "chat_id" => $chat_id, "text" => $someNonEnglishText ]; $telegram->sendMessage($array); but when I try to send keyboard data with the code below it just show some question marks like ???????????????? on my keyboard buttons $reply_markup = $telegram->replyKeyboardMarkup([ 'keyboard' => $someNonEnglishkeyboard, 'resize

Google App Script - Telegram Bot - Custom Keyboard

这一生的挚爱 提交于 2020-01-06 06:09:30
问题 I want to create a custom keyboard. I have this GAS code: function sendText(chatId,text){ var payload = { "method": "sendMessage", "chat_id": String(chatId),"text": text, "parse_mode": "HTML" } var data = { "method": "post", "payload": payload, "reply_markup": JSON.stringify({ "keyboard": [ [ "A", "B" ], [ "C", "D" ] ], "resize_keyboard":true }) } UrlFetchApp.fetch('https://api.telegram.org/bot' + token + '/', data); } it works great as echo bot but I am not able to create a custom keyboard.

how to make my python telegram bot to send message at certain time every day?

岁酱吖の 提交于 2020-01-04 18:17:30
问题 I'm trying to make a bot which will be able to notify users at a certain time every day. how can I make bot to send notification at certain time every day? I've tried to use while loop but it s @bot.callback_query_handler(func=lambda c:True) def CalendarAnswer(c): Cid = c.message.chat.id if c.data == 'ShowTime': bot.send_message(Cid, timeToday) if c.data == 'ShowDate': bot.send_message(Cid, dateToday) if c.data == 'SetNotification': Ask = bot.send_message(Cid, 'Напиши мне время') bot.register