The Bot API is an HTTP-based interface created for developers keen on building bots for Telegram. To learn how to create and set up a bot, please consult our Introduction to Bots and Bot FAQ. Recent changes April 14, 2019 Added support for native polls: added the object Poll, the methods sendPoll and stopPoll and the field poll in the Message...
The Bot API is an HTTP-based interface created for developers keen on building bots for Telegram. To learn how to create and set up a bot, please consult our Introduction to Bots and Bot FAQ. Recent changes April 14, 2019 Added support for native polls: added the object Poll, the methods sendPoll and stopPoll and the field poll in the Message...
Bots are third-party applications that run inside Telegram. Users can interact with bots by sending them messages, commands and inline requests. You control your bots using HTTPS requests to our bot API. 1. What can I do with bots? To name just a few things, you could use bots to: Get customized notifications and news. A bot can act as a smart...
こんにちは。
ボットはチャンネルを通してメッセージを受信できますか?
ボットを管理者として割り当てました。新しいメッセージは受信できますが、テキストは常に空白行です。
ここでは常に空白行です。こんにちは。
ボットはチャンネルを通してメッセージを受信できますか?
ボットを管理者として割り当てました。新しいメッセージが表示されますが、テキストは常に空白行です。
ここでは常に空行です。channel_postフィールドでは、https://core.telegram.org/bots/api#update。
このクラスを改良するのがいいでしょう。CCustomMessageにchannel_post_textフィールドを追加する。そしてそれをGetUpdates()に記入する。
チャンネルからのチャットの場合、なぜかこれらのフィールドはすべてnullになります。
チャネルの場合は、messageフィールドではなく、channel_postフィールドを見るべきです。channel_postもMessageタイプです。
テキストは表示される:
というテキストが表示されますが、他のフィールドは表示されません:
最初の3つのフィールドは値を受け取ります。しかし、最後の3つのフィールド(ChatやFromのようなフィールド)は値を受け取りません。どこを見ればいいのでしょうか?
わかった。
channel_post.chat_idは負の値でも良い。
channel_post.from.first_name-from-オプションフィールド。一般的には、すべてここにあるhttps://core.telegram.org/bots/api#message
OnInit()でこのコードを試して、チャンネルにメッセージを送ろうとしたのですが、うまくいきません。チャンネルやグループチャットにメッセージを送る方法の例を教えてください。
ありがとうございます。
bot.SendMessage("t.me/BotSignals", "Hello",false,false);
アドバイスをお願いします。ターミナル 設定で"https://api.telegram.org " パーミッションを追加しました。ブラウザを通してリクエストは正常に実行されますhttps://api.telegram.org/bot<token>/sendMessage?chat_id=<id>&text=test。
以下のコード行が実行されますが、SendMessageはエラーコード5203(HTTPリクエスト実行の結果としてのエラー)を返します。bot.GetMe()メソッドも同じ5203エラーを返します。
何が問題なのでしょうか?ありがとうございます!