我试图发送消息到人民的用户名,例如朋友的用户名是@ ... 但没有事情happend 没有错误 并没有发送 我可以使用这个库? 或只是用tlsharp? 我怎样才能找到我的机器人的apiid和hashid?通过用户ID C#机器人发送消息
使用Telegram.Bot;
和
public partial class Form1 : Form
{
Telegram.Bot. TelegramBotClient bot = new TelegramBotClient("token");
Thread a;
public Form1()
{
InitializeComponent();
}
public void GetUpdates()
{
int offset = 0;
while (true)
{
Telegram.Bot.Types.Update[] updates =
bot.GetUpdatesAsync(offset).Result;
foreach (var update in updates)
{
offset = update.Id + 1;
if (update.Message == null)
continue;
var from = update.Message.From.FirstName;
var text = update.Message.Text;
string chatid = update.Message.Chat.Id;
string username = update.Message.From.Username;
// label1.BeginInvoke(delegate { label1.Text = label1.BeginInvoke(delegate { label1.Text = string.Format("sender:{0}\ntext:{1}\ncatid:{2}", from, text, chatid); }); });
// lblshow.Text = string.Format("sender:{0}\ntext:{1}\ncatid:{2}", from, text, chatid);
//label1.Text = string.Format("sender:{0}\ntext:{1}\ncatid:{2}", from, text, chatid);
this.BeginInvoke((System.Windows.Forms.MethodInvoker)delegate() {textBox1.Text = string.Format("sender:{0}\ntext:{1}\ncusername:{2}", from, text, username); });
bot.SendTextMessageAsync(chatid, "سلام بر شما");
//is this correct for send to people?
bot.SendTextMessageAsync("@Hoda.....", "hi");
}
}
大卫我需要你的帮助电报机器人相关,所以我可以aksing? – Edit
你好大卫,我在电报里有一个机器人。并在机器人我想要显示医生名称列表和任何用户去机器人选择任何医生的名称和机器人chating的时间将开始博士,所以它是可能的机器人?使用c#。我更担心这项任务。我尝试很多链接找到但没有成功,所以你可以请帮我 – Edit
你好亲爱的@编辑。它与这个话题完全无关。请考虑提出新的问题,以便我们可以帮助你。谢谢。 – David