telegram-bot

handle deleted message by user in telegram bot

前提是你 提交于 2019-12-01 23:51:34
问题 Is there any way that can handle deleted message by user in one-to-one chat or groups that bot is member of it ? there is method for edited message update but not for deleted message . 回答1: No. There is no way to track whether messages have been deleted or not. 来源: https://stackoverflow.com/questions/48484272/handle-deleted-message-by-user-in-telegram-bot

How can I detect whether a user deletes the Telegram Bot chat?

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-01 17:53:12
Is it possible to check, via an API, whether somebody has deleted the Bot Chat in Telegram? My test : Currently if a user deletes a chat, new messages will not stop sending to user. Nope. Only by getting error while sending user something. Even calling sendChatAction method does not return error if user blocked the chat: $ curl https://api.telegram.org/bot***/sendChatAction -d 'chat_id=7975895' -d "action=typing" {"ok":true,"result":true} $ curl https://api.telegram.org/bot***/sendMessage -d 'chat_id=81083738' -d "text=ololo" {"ok":false,"error_code":403,"description":"[Error]: Bot was blocked

How can I detect whether a user deletes the Telegram Bot chat?

柔情痞子 提交于 2019-12-01 16:24:08
问题 Is it possible to check, via an API, whether somebody has deleted the Bot Chat in Telegram? My test : Currently if a user deletes a chat, new messages will not stop sending to user. 回答1: Nope. Only by getting error while sending user something. Even calling sendChatAction method does not return error if user blocked the chat: $ curl https://api.telegram.org/bot***/sendChatAction -d 'chat_id=7975895' -d "action=typing" {"ok":true,"result":true} $ curl https://api.telegram.org/bot***

How to find out whether it's user's current location or a chosen spot on map

和自甴很熟 提交于 2019-12-01 11:14:15
I need to get user's current location. I can ask for location by location keyboard and user will send his current location clicking on it. But he can also reply to message, choose any location on map and share it. Either way, the returned results to my Bot are identical.(At least as I see.) Is there a way or a trick to make sure that the shared location is also his current? FYI - I'm using TeleBot library written in Node.js .(Even though I don't think it will affect the answer.) My workaround is I ask user send the location twice. If two location are different. I will keep ask them to send new

How to store sessions of a telegram bot user in my db

对着背影说爱祢 提交于 2019-12-01 10:28:11
问题 I wanna code a telegram bot, so when I gonna receive messages from a user I should know about last message he/she sent to me and in which step does he/she located. So I should store sessions of the user (I understood this when I searched) but I don't know what exactly should I do? I know I need a table in a db that stores UserId, ChatId but I don't know these: How to make a root for steps and store them in db (I mean how do I understand where the user is located now) What are other columns

send message in telegram bot

十年热恋 提交于 2019-12-01 09:46:58
问题 I write telegram bot with php . I save users chatid for send message ; use this command for send message : /admin sendall:hellow and in php app use this code : case '/admin': if ($chat_id == 'my chatid') { $array = str_replace('/admin', '', $message); $array = trim($array); $array = explode(':', $array); $Admin = new AdminCommand(); $Admin->getCommand($array[0], $array[1]); } else { sendMessage($chat_id, 'block '); } break; AdminCommand class: class AdminCommand extends Database { public

How can create menu for telegram bot in bot father?

十年热恋 提交于 2019-12-01 06:38:54
I'm new in telegram bot and see this bot: that but when type /start show menu to me and with out type slash to command just fire the menu button,how can i create menu in telegram like that bot? You must add the return ajax call a string like this: '{ "keyboard": [["uno :+1:"],["uno \ud83d\udc4d", "due"],["uno", "due","tre"],["uno", "due","tre","quattro"]]}'; The result is: 来源: https://stackoverflow.com/questions/41956166/how-can-create-menu-for-telegram-bot-in-bot-father

Clear “pending_update_count” in Telegram Bot

两盒软妹~` 提交于 2019-12-01 03:56:31
I want to clear all pending_update_count in my bot! The output of below command : https://api.telegram.org/botxxxxxxxxxxxxxxxx/getWebhookInfo Obviously I replaced the real API token with xxx is this : { "ok":true,"result": { "url":"", "has_custom_certificate":false, "pending_update_count":5154 } } As you can see, I have 5154 unread updates til now!! ( I'm pretty sure this pending updates are errors! Because no one uses this Bot! It's just a test Bot) By the way, this pending_update_count number are increasing so fast! Now that I'm writing this post the number increased 51 and reached to 5205 !

How can create menu for telegram bot in bot father?

淺唱寂寞╮ 提交于 2019-12-01 03:44:12
问题 I'm new in telegram bot and see this bot: that but when type /start show menu to me and with out type slash to command just fire the menu button,how can i create menu in telegram like that bot? 回答1: You must add the return ajax call a string like this: '{ "keyboard": [["uno :+1:"],["uno \ud83d\udc4d", "due"],["uno", "due","tre"],["uno", "due","tre","quattro"]]}'; The result is: 来源: https://stackoverflow.com/questions/41956166/how-can-create-menu-for-telegram-bot-in-bot-father

Telegram bot weird error : Bad Request: wrong file identifier/HTTP URL specified

て烟熏妆下的殇ゞ 提交于 2019-12-01 03:24:17
I am sending message to telegram channel using bot. With using webhook method. I'm sending file_id via the link. I got the file_id from a channel post. For some files like GIF & video format (MP4), when i use this code: $url = 'https://api.telegram.org/bot'.token.'/sendVideo?chat_id='.uid."&video=".$file."&caption=" .urlencode($caption); file_get_contents($url); i get such this error : {"ok":false,"error_code":400,"description":"Bad Request: wrong file identifier/HTTP URL specified"} I really don't know why i get this, It's like this is random for errors, Because the code is depended to