Telegram In Dart or http request
How to get group all messages by using dart or http
Note that I have my bot token and I wanna use it in dart ("No another Languages") or http
Currently you can't get old messages from a group with the Bots API.
You can save every message in a database for a later use, but old messages are not accessible. The only way is by using the client API.
Related
I want to create a Discord Bot which listens to an API Call from a different Server.
For Example:
Discord Bot is running in my own Server and listening to ! commands
Another Server (Webserver) is having an event
The other server needs to call my Discord Bot (HTTP Request ?)
The Discord Bot needs to send a Message containing the Data from the previous call to a predefined Channel
I just can't find a way to do this. I tried webhooks, bot commands, discord gateway etc.
But there just seems to be no way that I can be able to send a message to my discord server via bot from a http request.
Anyone having a great idea how to achieve this ?
Thanks in advance!
What I have done so far:
Created a Bot using discord.io
Created Bot commands listening to ! (works)
Created a Websocket (works, but not able to send message)
Created a Webhook via Discord.js (Works but created no URL so I can't send a Message, also too dynamic)
I configured a Telegram bot and group according to the many tutorials one can find in the web.
I know the Telegram API token and the channel ID from ....telegram.../getUpdates. I am able to send messages via browser and via CURL using the URL:
https://api.telegram.org/bot5147154720:<etc, etc>/sendMessage?text=Hello2%20From%20Bot&chat_id=#<my_chat_name>
However, when I use these settings in Grafana (V8.2), I cannot send messages via the Telegram channel. I always get "Failed to send" errors. Are there settings one has to make to the Grafana server configuration or something else?
I tried this:
https://api.telegram.org/botXXtokenxx/sendMessage?chat_id=chat_id&text=text
But this is to send a message from the bot.
But what I need to do to send to the bot? (not from the bot)
You can either use a regular Telegram client (Telegram, Telegram X, Telegram Desktop, etc) to do it manually, or if you need an API (for whatever reason)...
You need the client API.
https://core.telegram.org/#getting-started
Once you have an API key for the client API and all that, you can send messages as explained here.
https://core.telegram.org/method/messages.sendMessage
Note that a human should be triggering this, as Telegram encourages (may be against ToS?) using a bot API for programatic access rather than the client API.
I have problems with telegram's api in c#. I search any solutions how to recevie message from Telegram using API. I found only library for Telegram BOT(send message etc.), but I need only recevie message from one user. There is option "Get.Message" in Telegram Api, but I can't find simply library to use this option.
using the telegram client api you can get updates automatically from telegram when a message is received. You simply need to handle the response once the session is created and a connection is made
Just in case you don't want realtime updates, you can use messages.GetHistory and supply the number of messages you'd like to retrieve. You need to provide the chat ID and access hash which you can get from contactsResolveUsername
enter link description here
I have a problem with telegram bot api.
when i was set webhook,then one of client send a photo to our bot and telegram api send frequently obejct of this photo to our api with the same update_id
this is answer from telegram support:
most probably issue is that you are not answering with a "2XX" to our requests, so we are sending the same updete as we understand that it wasn't received.
whats problem?!
The problem is you are not returning the proper status code (200) to Telegram so it thinks you did not receive the message successfully.