telegram-bot

Telegram Bot sendPhoto via node.js

↘锁芯ラ 提交于 2019-12-21 20:36:47
问题 i'm using this function for sending photo via node.js but that not work. telegram-bot-api https://www.npmjs.com/package/telegram-bot-api var telegram = require('telegram-bot-api'); var api = new telegram({ token: '<PUT YOUR TOKEN HERE>', }); api.sendPhoto({ chat_id: <YOUR CHAT ID>, caption: 'This is my test image', // you can also send file_id here as string (as described in telegram bot api documentation) photo: '/path/to/file/test.jpg' }) .then(function(data) { console.log(util.inspect(data

Telegram bot api limit of incoming updates

感情迁移 提交于 2019-12-21 12:38:29
问题 I was testing the Telegram bot api in order to get updates using https://api.telegram.org/bot<tokenOfBot>/getUpdates However, I realized I can get only 100 updates, and other ones don't appear. Is there any way to get the rest of my updates? 回答1: You may use the limit parameter to control how many updates you received. However, according to the documentation: limit: ... Values between 1—100 are accepted. Defaults to 100 That means you cannot receive more than 100 updates at a time. If you

Telegram BOT Api: how to send a photo using PHP?

孤街醉人 提交于 2019-12-20 09:24:20
问题 The sendPhoto command require an argument photo defined as InputFile or String . The API doc tells: Photo to send. You can either pass a file_id as String to resend a photo that is already on the Telegram servers, or upload a new photo using multipart/form-data. And InputFile This object represents the contents of a file to be uploaded. Must be posted using multipart/form-data in the usual way that files are uploaded via the browser. So I tried this method $bot_url = "https://api.telegram.org

Telegram Bot API: Server down when use getUserProfilePhotos()

十年热恋 提交于 2019-12-20 04:25:31
问题 Context I am using telegraf.js for more than 3 bots which run very well in plenty of groups. Currently one of the bots needs to request for Display Picture of the user who does not have a display picture. It works very well as expected but unfortunately the bot throws an error and the server goes down Current Code // Request for display picture const requestDP = async (ctx, next) => { const { from, chat } = ctx.message; const { can_delete_messages:canDelete } = await deletePermision(ctx); let

Telegram Bot send Message to bot

风格不统一 提交于 2019-12-20 01:39:51
问题 I have programmed a telegram bot. This works fine when sending to groups or to users. However I do a special requirement. I need to be able to send to another bot. When adding both bots to a group as administrators. I still cannot receive the message with my second bot. I only see it with my real user account, that is added to this group. What am I missing? I used OKHttp to send the message Request request = new Request.Builder() .url("https://api.telegram.org/bot"+telSetup.getToken()+"

Telegram Bot send Message to bot

风格不统一 提交于 2019-12-20 01:39:02
问题 I have programmed a telegram bot. This works fine when sending to groups or to users. However I do a special requirement. I need to be able to send to another bot. When adding both bots to a group as administrators. I still cannot receive the message with my second bot. I only see it with my real user account, that is added to this group. What am I missing? I used OKHttp to send the message Request request = new Request.Builder() .url("https://api.telegram.org/bot"+telSetup.getToken()+"

Why i get Wrong file identifier/HTTP URL specified error in telegram bot?

白昼怎懂夜的黑 提交于 2019-12-19 11:44:08
问题 I'm new in telegram bot and try to send photo to user with this code: await Bot.SendPhotoAsync(update.Message.Chat.Id, "http://182.126.201.42/" + "iisstart" + ".png"); but when i try run that code,get this error: Bad Request: Wrong file identifier/HTTP URL specified How can i solve that problem?thanks. 回答1: The problem can be originated from the following issues: the image file extension is not allowed by the telegram. file size is larger than that allowed by the telegram. You can start with

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

若如初见. 提交于 2019-12-19 10:07:29
问题 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.) 回答1: My

Telegram Bot API Webhooks Self-signed Certificate issue

孤人 提交于 2019-12-18 16:56:16
问题 I'm working on a Ruby language server to manage multiple Telegram Bots via setwebhooks BTW, I'll delivery the server as opensource at BOTServer PROBLEM I have troubles receiving webhook updates from Telegram Bot API Server. I have set a webhook token (Telegram reply "success") but I do not receive any update on the succesfully configured webhook. I think the problem could be around self-signed Certificate mysteries. See old reddit question and answers. I have similar problem and I fair the

How to get Telegram channel users list with Telegram Bot API

本秂侑毒 提交于 2019-12-18 12:27:51
问题 Anybody give a starter on how may I get information about users from my telegram bot. Imagine my bot in an admin user in my channel and I want to get my channel user list or to be noticed when a new user joins. How can I do that. Telegram's documents are so unorganized. So far I have looked at these: https://core.telegram.org/bots https://core.telegram.org/bots/api https://core.telegram.org/bots/samples https://core.telegram.org/bots/faq But none of these really helps. 回答1: In order to get