I have a chatbot and I am trying to make the bot mention a user in a space. For example, we have:
@googlechatBot Hello
User said "@googlechatBot Hello"
But I would like you to mention the user in the answer. Something like that
@googlechatBot Hello
@User said "@googlechatBot Hello"
The code I use is from the template found in the documentation.
function onMessage(event) {
var name = "";
if (event.space.type == "DM") {
name = "You";
} else {
name = event.user.displayName;
}
var message = name + " said \"" + event.message.text + "\"";
return { "text": message };
}
Did you tried this approach?
As described here https://developers.google.com/chat/api/guides/message-formats/basic?hl=en#messages_that_mention_specific_users