Open chat and send message with tg:// - telegram

I want open a telegram chat and send a designated message to a designated chat_id
I tried this but it just opens chat without message : tg://openmessage?user_id=1315949751&msg?text=AnyText
Is there a way to do that ?

Related

Send Telegram message as a user

I want to know if it possible to send message to my telegram bot as a user.
Maybe I should send a request with my credentials? Or I am completely missing something?
UPD:
Ok I see it is not clear. I want to send message using program.
Open your Telegram App, search for your bot and open the chat with it. Then type a message and hit send.

telegram bot cannot remove notification when delete message in group

Expected:
Bot sendMessage -> User receive notification
Bot deleteMessage -> Telegram in app message deleted -> User received notification will be disappear
but when i add telegram bot to group
Bot sendMessage -> User receive notification
Bot deleteMessage -> Telegram in app message deleted -> User received notification does not disappear
Cannot be done, since having the Notification is an OS feature, not the app itself. A bot cannot remove already received notifications.

how to send data message to user segment From Rest API

I'm using Advanced REST API to send data message for push notification.
In firebase console i can select user segment
as "Version","language",Country" etc..But how to select user segment for
Data message sent from REST API?
Or is their any other way to use select User segment for data message?
Also i want to send the notification for the user who has not opened app for few days.Is it possible with firebase data message?
When using the FCM rest API to send message, you can't target Analytics user segments. You can only send to devices identified by their unique token, or to topics where the client app is subscribed. The only way to send a message to a user segment is through the Firebase console.

Can Telegram Bot Api used to fetch unread messages from my telegram account?

I have subscribed to a telegram bot (I am not the owner/admin of that bot) which sends messages in a particular format. I need to do is to parse the incoming messages and used the parsed information as parameters to a trading API.
Hence, I need a daemon sort of thing which runs on my laptop and keeps listening for any new messages from that bot, and when it receives one, then parse it.
Can the Telegram Bot API handle this? In other words if I create a bot will it be able to read the messages sent to me by the other bot
Did you try to search on official documentation API or FAQ?
https://core.telegram.org/bots/faq#why-doesn-39t-my-bot-see-messages-from-other-bots
You can do it using python and python-telegram-bot package.
When you create a bot in your python code using the following code:
bot = telegram.Bot("Your bot's token")
you are able to get the new messages sent to your bot using bot.get_updates() and there's a feature to check if the sent message is from a bot or not. You can write a function that returns a boolean telling whether is the message sender bot or not:
def is_bot(update=dict()): #"update" is one of the messages which got returned from get_updates()
message = update["message"].to_dict()
return message["from"]["is_bot"]
for update in bot.get_updates():
print(is_bot(update))

Telegram how to send message user from group through Api?

On some website (http://ad1.ru/) I had seen possible get personal notify eq :(offer, ticket, discound) on telegram. I can to add only mobile phone (+7 906 247 00 01) in my contact list telegram and all.
How they did it?
I read telegram api documention and I found nothing. also I found this question How to obtain Telegram chat_id for a specific user?
wherein said that before send message I can get chat_id and send message boot telegram for get user chat_id from message
After obtaining user's phone number you can send an SMS to that number with a link to a bot like https://telegram.me/YourBot?start={SOME_ID_ASSOICATED_WITH_PHONE_NUMBER}
Once user opens the link and start bot you can send him/here messages through bot until blocked/unsubscribed.
If a user with the same phone number already subscribed to the bot no need to send an SMS.

Resources