telegram-bot

How to obtain the chat_id of a private Telegram channel?

你离开我真会死。 提交于 2019-12-17 15:09:06
问题 I use curl to update my public channels. This kind of syntax: >curl -X POST "https://api.telegram.org/bot144377327:AAGqdElkZ-77zsPRoAXXXXXXXXXX/sendMessage" -d "chat_id=@MyChannel&text=my sample text" But what's the chat_id of a private channel? It's not the one you have in the private invite. Because now we can pass a channel username (in the format @channelusername) in the place of chat_id in all methods (and instead of from_chat_id in forwardMessage). But what's the @channelusername of a

How to add Inline button in asp net telegram bot?

好久不见. 提交于 2019-12-14 02:27:47
问题 how can I add inline buttons, cause this code examle doesn't work? var keyboard = new InlineKeyboardMarkup ( new InlineKeyboardButton[][] { // First row new InlineKeyboardButton[] { // First column InlineKeyboardButton("one","callback1"), // Second column InlineKeyboardButton("two","callback2"), }, } ); 回答1: All you need to do is defining the Inline Keyboard first and then use it when you send any kind of message to the user. To define an inline keyboard you should use the code below right

How to get the response from the keyboard input in telegram bot?

佐手、 提交于 2019-12-13 22:24:54
问题 I want to use custom keyboard to get the selected option. How to get the selected option ? Is there any example? my question is answered by "node-telegram-bot-api" here: How to get the response of the keyboard selection? Is there any solution for c#? 回答1: When you call SendTextMessageAsync, you pass an IReplyMarkup object which specifies a "custom reply keyboard". I don't know much about the Telegram Bot API, but this looks to be the same feature referred to by the GitHub issue you linked.

How to handle this error in telegrambot with visual 2013?

心不动则不痛 提交于 2019-12-13 15:27:56
问题 I want with bot telegram Response any message when The request comes from the user's side for bot by webform, but When the value of rs.message is null, Program error. error: An exception of type 'System.NullReferenceException' occurred in BotTelegramWeb.dll but was not handled in user code C# 2013 update3 webform 2013 update3 Summary code: using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using Telegram

Commands not recognised in php-telegram-bot on a laravel Project

孤者浪人 提交于 2019-12-13 03:50:48
问题 I'm using php-telegram-bot/core in larvel 5.5 to make a telegram bot. I followed all installation and add custom commands described here. First in the web.php route file I added this : Route::get('/setwebhook', 'BotController@setWebhook'); Route::post('/webhook', ['as' => 'webhook', 'uses' => 'BotController@Webhook']); and this is BotController structure : namespace App\Http\Controllers; use Illuminate\Support\Facades\Log; use Longman\TelegramBot\Request; class BotController extends

Simulate sending a message to a bot from url

雨燕双飞 提交于 2019-12-13 02:56:14
问题 I'm trying to simulate how to send a message to a bot from a url but it doesn't work. I try to explain (note: all the ids and tokens are not real, they are only to explain !!) .. I've built a first bot from BotFather named Bot1Bot and then, form url if I try https://api.telegram.org/bot532708503:BBGn5ORfLppFu05-bi088F4SyKAiITfXH1w/getme the response is {"ok":true,"result":{"id":532708503,"is_bot":true,"first_name":"Bot1Bot","username":"Bot1Bot"}} Then I've built a second bot from BotFather

What are Telegram Client Messaging limits?

旧城冷巷雨未停 提交于 2019-12-13 02:26:38
问题 From here I know that Telgram limits BOT messages like this: > 1msg/second per chat > 30msg/second different chats Happens that I'am not using the python-telegram-bot API, I'am using a normal client through telethon's library. I'am getting Flood\Spam error from Telegram when trying to send messages in that cadence. BTW, I'am using delayQueue Class to control the messages limits like this: dqueue = DelayQueue(burst_limit=29, time_limit_ms=1014) dqueue(client.send_message,inputPeerUser,msg)

Telegram bot API - Inline bot getting Error 400 while trying to answer inline query

大城市里の小女人 提交于 2019-12-12 19:19:02
问题 I have a problem coding a bot in Python that works with the new inline mode. The bot gets the query, and while trying to answer, it receives error 400 . Here is a sample of data sent by the bot at this time: { 'inline_query_id': '287878416582808857', 'results': [ { 'type': 'article', 'title': 'Convertion', 'parse_mode': 'Markdown', 'id': '287878416582808857/0', 'message_text': 'blah blah' } ] } I use requests library in to make requests, and here is the line that does it in the code: requests

How to read messages from Telegram group with bot?

两盒软妹~` 提交于 2019-12-12 18:08:24
问题 I would like to connect a simple telegram bot to read messages from a group, (where I'm not admin). I already added the bot to the group, but it doesn't work. Here is the code I have in Python: import telepot from pprint import pprint import time from telepot.loop import MessageLoop key = "MY API" bot = telepot.Bot(key) def handle(msg): pprint(msg) bot.message_loop(handle) while 1: time.sleep(10) If I open the chat (of the bot) and write a message, everything works well. But when someone send

Telegram bot inline keyboard via Node.JS

喜你入骨 提交于 2019-12-12 10:19:45
问题 I'm using the node-telegram-bot-api module, How can I make my keyboard to inline Keyboard? This is my code: bot.onText(/^\/start$/, function (msg) { const opts = { reply_to_message_id: msg.message_id, reply_markup: { resize_keyboard: true, one_time_keyboard: true, keyboard: [ ['Level 1'] ] } }; bot.sendMessage(msg.chat.id, "I'm a test robot", opts); }); 回答1: I answered a question similar to this link: How can create menu for telegram bot in bot father? in your case you could use: keyboard: [[