Is there a way to send a private message to one of the participants in a group/room in a Google Meet so that it's only that person that gets to see it and not the other participants in the meeting?
Related
There is a public telegram chat. I want to make it so that when a user joins a chat group, the bot will send that user a private message.
I checked the technical capabilities and realized that this cannot be done, but I could be wrong. To implement this feature, the user must run this bot, then such an opportunity will appear.
Question. How to make it so that before joining a chat group, a person has to launch a bot?
First, you can get an array new_chat_members of new users in the chat from Message. Then you can send a Message with button (InlineKeyboardButton). This button has a switch_inline_query_current_chat field. That's what you need.
I have created an outgoing webhook for MS Teams. I pointed this to an Azure Function App which checks the authentication token and then forwards the payload through another webhook to a Flow (Power Automate) which replies to the original message in Teams.
This post addresses only one of the many problems this roadmap has, namely that the payload contains (amongst much else) the Teams Message ID, the Teams Channel ID and the Teams Team ID, as follows:
messageid=1578517604597 CORRECT. This is great
teamsChannelId=19:99c0a47caa884ffeabefc59305523414#thread.skype. This may look wierd but it's correct
teamsTeamId=19:c374b6b6d8cf4f17a9c77cd45399e90c#thread.skype Well this appears to just be wrong.
If I ask Flow to post a reply to the message on teams it will complain that the group ID is incorrect. It is referring to the Team ID.
If I open the original teams message in a browser and look at the URL I find the message ID and the channel ID as above. But the groupID is as follows:
groupId=006ff9ad-fdcc-4705-b651-93eef04361dc
Putting this in Flow works!
But if I search for this value in the JSON payload it is nowhere to be found!
Can it somehow be derived from the TeamID?
Any help is appreciated.
Thanks
We are building an internal bot to monitor / control our software. It is NOT exposed to the public and will be used by other team members, either directly (as a direct chat) or through a few channels depending which side of the software is on topic.
The bot should do two things:
reply to commands; the reply should go to the user that originated it.
send notices to all users / channels it is involved in.
When a message arrives, I can get the channel id and the user id; while the user id is kind of guaranteed to exist for while, what is the situation with the channel?
Can I store the channel id and broadcast messages to all channels the bot is involved in? what happens if a channel is closed? do channel ids have lifetimes?
I can't really find anything online about the best practice regarding this scenario.
I have doubt Understand what you want but it seems better know these things :
ID's are unique in Telegram and even in all others applications so
they are lifetime
Channel ID , Groups ID , User ID have same behavior but their difference is on their integer. (User ID's are Positive but channels and groups are Negative. check example here)
Users can just send message in channels that they have admin permission in it right? Bots are same. so if your bot isn't admin anymore , the Telegram gives you error in response and you can check it and after facing that error delete that channel ID in your channels list.
I hope this information help you but if you have any other question feel free to leave a comment and I'll update the post and answer you immediately.
Resource URL https://chatapi.viber.com/pa/send_message
General send message parameters
I am trying to send message to viber from Postman. I don't know how to find Unique Viber user id, that parameter is required.
I am getting this error:
{"status":999,"status_message":"Bad receiver ID","message_token":5126721184521938239}
Danny Dainton mentioned the docs on how you can get data including unique ID about your own account not about somebody else!
You'll receive callbacks containing user unique ID to your webhook if a user subscribes to your public account, and ONLY THEN you'll be able to send message to that user.
As per viber docs:
The send_message API allows accounts to send messages to Viber users who subscribe to the account. Sending a message to a user will be possible only after the user has subscribed to the Public Account by pressing the subscribe button or by sending a message, or by sending a message to a bot (see subscribed callback for additional information).
and VERY IMPORTANT
Before an account can send messages to a user, the user will need to
subscribe to the account. Subscribing can take place in one of two
ways:
User sends message to the account (both Public Accounts and bots)
when a user sends its first message to a account the user will be
automatically subscribed to the account. Sending the first message
will not trigger a subscribe callback, only a message callback (see
receive message from user section). Subscribed event is sent to the
Public Account (Public Accounts only)
user clicks a subscribe button
which triggers the subscribe callback as described below.
Simple, just call the Get Account Info API, whose resource URL is https://chatapi.viber.com/pa/get_account_info
You will find the a list of all subscribers in the response along with their user IDs. Please note that these user IDs are unique per user per public account.
Correction: It seems like the Get Account Info API does not return all subscribers, it just returned for me my user ID (the admin of the public account). Based on this, there is no way to get the user IDs of your subscribers other than from the callbacks for new subscribers, messages, ...etc.
Normally you should collect Viber IDs from all callbacks and store in DB for future use. But if you missed that step you can collect Viber IDs of online subscribed users by periodic call to get_online endpoint and then use get_user_details endpoint to get more info about unknown ones.
the main question is how do I get the chat ids for all the conversations ever held with the bot?
Imagine that during the execution of the bot there is a conversation with the user A.
Now I stop the bot process and start it again.
How do I get the chat id of that past chat with the user A?
I understand you get the chat id when the user sends you a message, and you use that id to reply, but what if user A no longer sends messages to the bot during the current execution? how to get the past conversation id?
Is the only one option to store the ids and retrieve them when the second execution starts?
UPDATE:
Looks like the current solution is to store the chat id somewhere safe, as answered by #Tick Tock.
Your question is unclear to me but as I understand from your question I wrote something to you hope be helpful. You can retrieve chat_ids and use it to send something to that chat. I would give a sample code but before let me explain something.
In Telegram Bot API there is two definitions: chat_id and from_id.
1-When we are in private chat with some one chat_id and from_id are equal.
2-When our bot is a group member, then chat_id is id of that group and is different from that person id(from_id) may be send something to group(and maybe our bot receive it too-when privacy_mode is off)
I assume your bot is in private chat:
when user sends anything to your bot, then Telegram gives that message to your BOT( calls your script), this sample code sends "Hello chat_id" to that user.(in PHP)
define('BOT_TOKEN','12345:abcde');//replace with your bot token
$command_prefix_url='https://api.telegram.org/bot' . BOT_TOKEN ;
$update = json_decode(file_get_contents('php://input')); //retrieves data sent by telegram
$chat_id=$update->message->chat->id; //retrives `chat_id`
$rep = json_decode(file_get_contents($command_prefix_url . '/SendMessage?chat_id=' .
$chat_id . '&text=' . urldecode('Hello '.(string)$chat_id))); //send something to that `chat_id` (sender)
UPDATED: (due to edition in question)
First, chat_id is unique and always permanent for that user(in private chats)
even if your bot's user leaves your bot and rejoin again.
I don't hear or read anything up to now that Telegram have been provided a method to tell your bot WHOLE its users chat_id , so the best way to know about your users is to save their chat_id and other info (that you gather along the time from user from messages reciceve from) in a database.
If you save at least their chat_id in a simple database then you have a list of your bot's subscribed users. And since chat_id is permanent you can send anything you want to your users.
AND, as I understand from your question, IF you do not have a database but user A is your bot's subscribed user, AS I KNOW, you should wait until she/he send a single message to you, then you grab her/him chat_id and add it to your database. NOW you can send her/him every time anything.