telegram-bot

Telegram-bot user control

不羁的心 提交于 2019-12-23 17:27:06
问题 I want to create a telegram bot for a home project and i wish the bot only talk to 3 people, how can I do this? I thought to create a file with the chat id of each of us and check it before responding to any command, I think it will work. the bot will send the correct info if it's one of us and "goodbye" to any other But is there any other way to block any other conversation with my bot? Pd: I'm using python-telegram-bot 回答1: For the first part of your question you can make a private group

How to handle multiple users on Telegram bot in C#?

被刻印的时光 ゝ 提交于 2019-12-23 12:46:53
问题 I wrote a bot which asks your name and writes it on a photo and sends it to you and it works. But the problem is when there is more than one user on the bot It doesn't work and crashes and I wanted to know how to separate users entries and outputs.(like each user who connects get a separated session because now everything happens in one session and it crashes) This is my code: void bot_OnMessage(object sender, Telegram.Bot.Args.MessageEventArgs e) { KeyboardButton[] btns = new KeyboardButton

How To Limit Access To A Telegram Bot

允我心安 提交于 2019-12-23 07:29:25
问题 When I send a message to my Telegram Bot, it responses with no problems. I wanna limit the access such that me and only me can send message to it. How can I do that? 回答1: As this question is related to python-telegram-bot, information below is related to it: When you add handlers to your bot's dispatcher, you can specify various pre-built filters (read more at docs, github) or you can create custom ones in order to filter incoming updates. To limit access to a specific user, you need to add

Telegram Bots: secret chats possible?

最后都变了- 提交于 2019-12-23 06:56:10
问题 Telegram offers "secret chats". Is it possible that a bot opens a secret chat and sends a message? I could not find any method or parameter for this function. 回答1: Telegram's Bot API does not support secret chats at the moment. You can read the documentation, but a short explanation is: end-to-end encryption is used in secret chats which is tricky to implement for bots and requires additional work. There's no word on when it'll be supported, if ever. At any rate, Telegram Bots are generally

Message not receiving automatically for Telegram CHATBOT funciton using PHP

纵饮孤独 提交于 2019-12-23 04:33:31
问题 In order to integrate Telegram Chatbot using PHP, I have already followed below steps. Server with SSL certificate Webhook with working condition URL : https://api.telegram.org/bot/setWebhook?url=https://mywebsite.com/path/to/filename.php Created ChatBot and have a valid Token After that, I have made simple PHP file using following line of code. <?php define('BOT_TOKEN', 'CHANGE-ME'); define('API_URL', 'https://api.telegram.org/bot'.BOT_TOKEN.'/'); // This is to read incoming message and

Telegram bot on OpenSSL

﹥>﹥吖頭↗ 提交于 2019-12-22 12:22:10
问题 I have problem with https://core.telegram.org/bots. Get token from BotFather. Create self-signed ssl sertificate (https://core.telegram.org/bots/self-signed): openssl req -newkey rsa:2048 -sha256 -nodes -keyout YOURPRIVATE.key -x509 -days 365 -out YOURPUBLIC.pem -subj "/C=US/ST=New York/L=Brooklyn/O=Example Brooklyn Company/CN=YOURDOMAIN.EXAMPLE" Run server: openssl s_server -accept 88 -key YOURPRIVATE.key -cert YOURPUBLIC.pem Send hook: curl -F "url=https://URL:88/bot" -F "certificate=

send long message with photo on telegram with php bot

陌路散爱 提交于 2019-12-22 04:37:24
问题 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. 回答1: 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

what information about user can a telegram bot access?

馋奶兔 提交于 2019-12-22 02:42:29
问题 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?? 回答1: 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

Telegram, getting file_id for existing sticker

自闭症网瘾萝莉.ら 提交于 2019-12-22 01:45:56
问题 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. 回答1: To discover a sticker's file_id : Send the sticker from Telegram App to your bot. Use the bot's getUpdates

Telegram bot - receive photo URL

吃可爱长大的小学妹 提交于 2019-12-21 22:31:07
问题 When a user send an image via Telegram bot it there any way to get the image URL? or I just need to save the image somewhere? 回答1: In the message array you receive you can find the key photo . There you will find multiple arrays with the following format "file_id" : "XXXX", "file_size" : 1107, "width" : 90, "height" : 51 From one of those array you need to take the file_id . You can then request the file_path with a simple get get on the url https://api.telegram.org/bot<token>/getFile?file_id