我試圖發送消息到人民的用戶名,例如朋友的用戶名是@ ... 但沒有事情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