telegram

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

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

php extract Emoji from a string

我是研究僧i 提交于 2019-12-01 06:49:41
I have a string contain emoji. I want extract emoji's from that string,i'm using below code but it doesn't what i want. $string = "😃 hello world 🙃"; preg_match('/([0-9#][\x{20E3}])|[\x{00ae}\x{00a9}\x{203C}\x{2047}\x{2048}\x{2049}\x{3030}\x{303D}\x{2139}\x{2122}\x{3297}\x{3299}][\x{FE00}-\x{FEFF}]?|[\x{2190}-\x{21FF}][\x{FE00}-\x{FEFF}]?|[\x{2300}-\x{23FF}][\x{FE00}-\x{FEFF}]?|[\x{2460}-\x{24FF}][\x{FE00}-\x{FEFF}]?|[\x{25A0}-\x{25FF}][\x{FE00}-\x{FEFF}]?|[\x{2600}-\x{27BF}][\x{FE00}-\x{FEFF}]?|[\x{2900}-\x{297F}][\x{FE00}-\x{FEFF}]?|[\x{2B00}-\x{2BF0}][\x{FE00}-\x{FEFF}]?|[\x{1F000}-\x{1F6FF}

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

Telegram inline keyboard and keyboard

会有一股神秘感。 提交于 2019-12-01 03:22:23
I have question about Telegram bot. I want keyboard and inline keyboard, Can I enable both of the features at the same time ? According to Telegram documentation , it's currently impossible to pass two or more objects for reply_markup at the same time. reply_markup only accepts one of these objects at the same time: InlineKeyboardMarkup ReplyKeyboardMarkup ReplyKeyboardRemove ForceReply And of course you cannot combine two or more objects together. If you wanna show keyboard and have inline keyboard too, you can show the keyboard in a message and after that send another message with inline

Clear “pending_update_count” in Telegram Bot

霸气de小男生 提交于 2019-12-01 00:18:19
问题 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

Error:Execution failed for task

China☆狼群 提交于 2019-11-30 20:15:36
I get this problem when I use source code of Telegram in Android studio. So I use android studio preview 3.0.0 beta 2, gradle 4.1-all.zip, mainsdk:15. I did everything but it's not working properly. Error is : Error:Execution failed for task: TMessagesProj:transformDexArchiveWithExternalLibsDexMergerForDebug. java.lang.RuntimeException: java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException: Unable to merge dex build.gradle file is : buildscript { repositories { mavenCentral() } dependencies { classpath 'com.android.tools.build:gradle:3.0.0-beta4' } } apply plugin: