telegram-bot

How to create pagination with inline keyboard in telegram

醉酒当歌 提交于 2019-12-05 07:09:27
问题 I am creating a Telegram bot wit Node.js and I am using node-telegram-bot-api module. My current issue is: To create pagination with inline keyboard. In documentation here, has an interesting example of what I need. For appearances, I must use method editMessageText but for update inline keyboard I need to transfer param inline_message_id . Unfortunately I could not understand how to do it. I will be very much appreciate for any example to update inline keyboard and how it release in this

Iinline keyboard. I made a button, but what to do with the callback_data?

本小妞迷上赌 提交于 2019-12-05 06:34:45
问题 Need help with inline keyboard. I made a button, but what to do with the callback? I understand I need to somehow get a callback_data and issue a new message. <?php $access_token = 'xxx'; $api = 'https://api.telegram.org/bot' . $access_token; $output = json_decode(file_get_contents('php://input'), TRUE); $chat_id = $output['message']['chat']['id']; $first_name = $output['message']['chat']['first_name']; $message = $output['message']['text']; $callback_query = $output['callback_query']; $data

send long message with photo on telegram with php bot

萝らか妹 提交于 2019-12-05 06:32:13
I need send to telegram long text with photo but telegram image caption has 200 character limit. How can send long text with photo using php and bot? sendPhoto method has 200 character limit. I see a telegram bot it's send long text and photo see my sample photo. You can use empty character! Just set parse_mode Field to HTML in sendMessage method , then in text Field insert the URL of the image into href The hyperlink will not be seen when you use empty character : <a href="https://www.nafasbekesh.ir/wp-content/uploads/2016/10/img1.jpg"> ⁠</a> Copy the empty character for your own use. You can

firebase.intializeApp is not a function

萝らか妹 提交于 2019-12-05 05:09:17
so im stuck at this error. Im making a telegram bot with the telegram bot api and now im trying to set up a firebae DB to save the score of a group member - so the score is not resetted after restarting the bot. can someone tell me what the problem is? i read a lot of other issues here with similiar problems, but none of these answers fixed my problem. bot.js var TelegramBot = require('node-telegram-bot-api'); var firebase = require('firebase'); var token = 'mytoken'; // Setup polling way var bot = new TelegramBot(token, {polling: true}); var app = firebase.intializeApp({ serviceAccount: "C:

Telegram bot api keyboard

依然范特西╮ 提交于 2019-12-05 04:54:40
I have problem with Telegram Bot Api and with "ReplyKeyboard". I'm using Python 2.7 and I send post request: TelegramAPI.post(TELEGRAM_URL + "sendMessage", data=dict(chat_id=CHAT_ID, text="", keyboard={'keyboard': keyboard, 'one_time_keyboard': False, 'resize_keyboard': True}) keyboard in this format: [["A button"], ["B button"]] But in Telegram I don't see keyboard. What problem can be? According to the Bot API documentations , a custom keyboard requires a reply_markup parameter, whose value is a JSON-serialized specification of the keyboard. Assuming your TelegramAPI.post() function does not

How to hide Telegram BOT commands when it is part of a group?

江枫思渺然 提交于 2019-12-05 04:25:42
I'm trying to use a Telegram BOT to send messages to a group. First, I thought that it'd be enough to know the group chat id to accomplish that, but it's not. The BOT MUST be part of that group. OK, it kind of make sense, but the problem is: When you add a BOT into a group (a large group in this case) everyone start seeing a new icon on their devices, a "slash" icon. And what do they do ? They click on it, see the list of commands, choose one of them, and all of a sudden everyone is getting a new message from the group: a "/something". Imagine dozens of people doing that ? It's pretty annoying

Setting up a Telegram bot without a server

主宰稳场 提交于 2019-12-05 02:57:00
问题 I'm not well versed with web techniques and would like to know if there's a way - an idea would be to use setWebhook - to make a telegram bot do simple stuff (like simply repeat the same message over and over again whenever someone sends it a message) without setting up a server . I think there might be no way around it because I need to parse the JSON object to get the chat_id to be able to send messages... but I'm hoping someone here might know a way. e.g. https://api.telegram.org/bot<token

How can I get messages from a Telegram channel with the Telegram API

大憨熊 提交于 2019-12-05 02:09:08
How can I access to a Telegram channel messages with a bot registered as channel admin? I am trying to get all the messages from Telegram channel and display them in an ASP.NET webpage (c#) I am able to get updates when new message sent directly to the bot: var json = wc.DownloadString(" https://api.telegram.org/bot<token>/getUpdates"); but its not working for the channel. unfortunately it's not possible yet.(they may come up with something in future) as admin you can just send messages to channel. The only way until now is as follows: Your bot be added to the channel by its administrator. You

what information about user can a telegram bot access?

試著忘記壹切 提交于 2019-12-05 01:25:40
I'm new to telegram bots, I want to know when we add a telegram bot to a group, can it access to any information about group members?? and I know about privacy mode, whether it is on or off , can bot access to any information about the user who sent a message that the bot can read?? A bot has access to: The user's unique identifier (user id) The user's first name The user's last name (if the user has specified his last name in the settings) The user's username (if the user has configured a username) The bot can only extract this info from a Message (i.e. it cannot query the group member's

Telegram, getting file_id for existing sticker

大憨熊 提交于 2019-12-05 00:51:47
I'm writing a Telegram bot and I want it to send a sticker. It is said here , that to send a sticker that already exists on Telegram servers we can simply pass file_id . The thing is, I have absolutely no idea how to obtain file_id of any sticker. E.g. how do I send any sticker from Greater Minds pack? I suppose, this pack is on Telegram servers since they include it in every app. To discover a sticker's file_id : Send the sticker from Telegram App to your bot. Use the bot's getUpdates method to receive the sticker. You should see the sticker's file_id in the message. Your bot may use that