Tag: telegram bot

如何使用C#使Telegram bot API中的Keyboard Button消息文本与其标题不同

我需要我的机器人打印与其标题不同的消息(通过键盘按钮元素上的电报客户端显示)。 我的自定义按钮有这样的文字: “Where am I?” 当我点击它时,它会在屏幕上打印出”Where am I?” 也。 我希望按钮打印”/location” 。(与text字段不同) 我怎样才能实现它? 我正在使用C#和Telegram Bot API 编辑: 我想要的是: 当用户单击此按钮时,电报客户端发送带有/age [作为其输入消息]的消息,但不发送show my age (即该按钮text字段) 所以:我想要一个带text的按钮。 当用户点击按钮时,我希望发送的消息与该text不同。

如何创建InlineKeyboardMarkup这个例子?

我想创建一个Button,当点击按钮用户转到群组电报时。 但是不能 使用NetTelegramBotApi; //最后一个版本 class Program { private static string Token = “……”; // private static InlineKeyboardMarkup Menu1; } public static async Task RunBot() { // var keyboardInlineMenu = new InlineKeyboardButton[20][]; ….. ….. …. …. if (text == “/start”) { // keyboardInlineMenu = new InlineKeyboardButton () { InlineKeyboardButton[][] buttons = new InlineKeyboardButton[2][]; buttons[0][0] = new […]

如何使用Telegram API从Telegram通道获取消息

如何使用注册为渠道管理员的机器人访问电报频道消息? 我试图从Telegram频道获取所有消息并在ASP.NET网页中显示它们(c#) 当新消息直接发送到机器人时,我能够获得更新: var json = wc.DownloadString(” https://api.telegram.org/bot/getUpdates”); 但它不适用于频道。

在c#,MrRoundRobin API中创建动态键盘电报机器人

我想在telegram.bot创建自定义键盘例如:我们有从数据库或其他InlineKeyboardMarkup得到的字符串数组如何将数据从数组推送到InlineKeyboardMarkup for for循环或函数 //array of Button string[] ButtonItem= new string[] { “one”, “two”, “three”, “Four” }; //function or solution to create keyboard like this var keyboard = new InlineKeyboardMarkup(new[] { new[] { new InlineKeyboardButton(“one”), new InlineKeyboardButton(“two”), }, new[] { new InlineKeyboardButton(“three”), new InlineKeyboardButton(“Four”), } });

如何在c#中解决我的机器人干扰?

我发了一封电报Bot。 事实上,机器人是一个游戏,玩猜猜某些词。但问题是当我将机器人添加到两个不同的组(作为管理员)或两个用户电报,分别使用机器人和启动机器人,放置影响他们一起玩的比赛。一个人在下一场比赛中受到干扰。 例如:如果john在Mobile中启动我的bot,而john的desired_word是Newyork,长度= 7,那么当sara在Mobile中启动我的机器人时。 约翰的Len_desiredwords例如成为5。 library = NetTelegramBotApi 4.0.0 vs = 2013 v4; 不知道该干什么。 码: using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; using NetTelegramBotApi; using NetTelegramBotApi.Requests; using NetTelegramBotApi.Types; using System.Net.Http; using System.Runtime.Remoting.Channels; using System.Data; using System.Data.SqlClient; using System; using System.Collections; using System.Text; using System.Text.RegularExpressions; namespace WordsBot { class Program { […]