telegram-webhook

How can i create a private message from telegram bot?

我与影子孤独终老i 提交于 2021-02-19 06:36:31
问题 I'm connecting to telegram bot with webhook and i wanted to respond in private chat through telegram but if i send UID it doesn't send any message to the user from the bot. this is what i did. I created a Web API Project with .net framework to connect to webhook with telegram bot. As a user, i wrote a command that will return some list of objects. From the WebAPI i got the command and processed correctly on sending response back i passed this {"method":"sendMessage","chat_id":"[user's UID who

How to use telegram webhook on google cloud functions?

主宰稳场 提交于 2021-01-29 07:50:36
问题 I have set up a telegram bot using webhooks in python on google cloud functions. Based on some sample code from the internet I got it to work as a simple echo-bot however the structure is very different to the bots I coded before using long polling: # main.py import os import telegram def webhook(request): bot = telegram.Bot(token=os.environ["TELEGRAM_TOKEN"]) if request.method == "POST": update = telegram.Update.de_json(request.get_json(force=True), bot) chat_id = update.message.chat.id #

Why cannot I receive any POST request on my Telegram bot written with Flask (Python)?

北慕城南 提交于 2020-07-07 07:19:14
问题 I don't want to use getUpdates method to retrieve updates from Telegram, but a webhook instead. Error from getWebhookInfo is: has_custom_certificate: false, pending_update_count: 20, last_error_date: 1591888018, last_error_message: "SSL error {error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed}" My code is: from flask import Flask from flask import request from flask import Response app = Flask(__name__) @app.route('/', methods=['POST', 'GET']) def bot(): if

Why cannot I receive any POST request on my Telegram bot written with Flask (Python)?

a 夏天 提交于 2020-07-07 07:18:25
问题 I don't want to use getUpdates method to retrieve updates from Telegram, but a webhook instead. Error from getWebhookInfo is: has_custom_certificate: false, pending_update_count: 20, last_error_date: 1591888018, last_error_message: "SSL error {error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed}" My code is: from flask import Flask from flask import request from flask import Response app = Flask(__name__) @app.route('/', methods=['POST', 'GET']) def bot(): if

How can i get file_path of telegram bot

◇◆丶佛笑我妖孽 提交于 2020-05-12 07:05:09
问题 I have a telegram bot webhook message like { "update_id":236420475, "message":{ "message_id":26577, "from":{ "id":xxxxxxxx, "first_name":"DB", "last_name":"Ks", "username":"xxxxxxxx" }, "chat":{ "id":193044649, "first_name":"DB", "last_name":"Ks", "username":"xxxxxxxx", "type":"private" }, "date":1493266832, "voice":{ "duration":2, "mime_type":"audio/ogg", "file_id":"AwADBQADBAADQKMIVC978KStO6ZhAg", "file_size":7532 } } } From the telegram bot API documentation there is a file_path specified

encountering “Read timeout expired” error by Webhook after 60 Sec of execution

这一生的挚爱 提交于 2020-01-23 03:59:07
问题 lately Im facing a problem with telegram bot api which i haven't had before... Im using Webhook method of connection to catch bot requests and respoding with PHP script and sometimes the triggered script takes more than a minute to finish processing. about a month ago everything was working fine and telegram bot wait long enough for script to completely execute, but now my connection suspend and im getting this Webhook error through telegram api "Read timeout expired" after 60 Seconds of

Can I store bot state data on the involved telegram chat itself?

无人久伴 提交于 2019-12-25 17:18:21
问题 I'm trying to store a bit of data regarding the bot's conversation within a group (i.e. the bot manages kind of a text-based chat scape room and I want to save which "world" and "stage" the group is in at the time), and so I was wondering whether you can just store this little amount of data within the chat itself (instead of saving it on the bot server side*, which seems quite a lot of work for something that should be so simple). So following this python zen philosophy, I'm trying to find a

Can I store bot state data on the involved telegram chat itself?

血红的双手。 提交于 2019-12-25 17:18:05
问题 I'm trying to store a bit of data regarding the bot's conversation within a group (i.e. the bot manages kind of a text-based chat scape room and I want to save which "world" and "stage" the group is in at the time), and so I was wondering whether you can just store this little amount of data within the chat itself (instead of saving it on the bot server side*, which seems quite a lot of work for something that should be so simple). So following this python zen philosophy, I'm trying to find a