I have a use scenario where I'm testing a bot in google hangout. To facilitate testing of multiple users, I'd like to create a series of other bots that replicate the functions of users. But this is all dependent on the bots in the room listening to one another. It also requires that I get the userid of the bots so they can name each other. In Google Scripts I can find no way to retrieve that (the rest API is not an option).
Any suggestions?
The information is documented, but I understand GCP docs aren't the easiest to navigate. According to the Event Format reference: "Only messages from "real", non-bot users are delivered to bots. A bot will never receive messages posted by itself or by a different bot."
So the answer to the question appears to be no. Bots do not appear to be able to talk to each other. When you put the userid in the text property of the bot it does not replace it to an #botname as it does with human users. If anyone can figure out another way to do it I would appreciate it.
But the second question of where to get the bots userid I can now answer and I leave here in case anyone else is curious. This appears only in a message event, when a bot is mentioned as the property event.message.annotations[0].userMention.user.name
Related
So my problem is that I'm bulding a Dialogflow chatbot with the Google Hangouts API in Google Apps Script.
Everything works, the relation between them and the intents get activated.
But now we want to work with the Mega/ & Sub-agents, and let say we have similar training phrases in multiple SubAgents, but you need to choose a certain department (subagent) to ask question within. Have someone worked with this type of solution?
We want to build like this because we want to let the business create the questions and they don't really see what the other deparments create in their subagents.
And the problem is that the MegaAgent can't have any intents to point to the right directions.
So it would be nice to let the bot start with a question and ask for what area you want to ask your questions in runtime based on threads or something like that.
And the function onMessage(event) is alwaysed triggered when the user answers..
I saw that this one asked for the same problem but couldn't find any solution to this
I am using AppMaker I would like to get the Chat ID of a user so I can open a chat window in a new tab to that user. However, I don't see a way to get it.
To be clear, I want the part at the end of a URL like this:
https://chat.google.com/u/0/dm/pUR6NABBAAE
For some reason this ID is different from the old Hangouts chat ID (which I get from the Person datasource).
Is there a way to do this? I have looked at the docs and searched StackOverflow but do not see anybody trying to do this.
No, there is no way to do what you want as of now.
Google is always receiving Feature Requests for their APIs so you could try submitting it there.
However, since the Hangouts API is directed at Bots and Google has a compromise to not create avenues for spammers, I doubt that will be implemented.
Hi i want to develop the bot , but first i ask users to share the link of my bot to 5 other users then continue and register in my bot , i develop all sections but i cannot handle the first one, how can i detect that the use send share link to other user ?
i user laravel + talageram bot SDK to develop my bot.
i just want to know that user share the link and continue , i search in many docs and site bud i cannot find anythings that useful to me.
please help me to handle this problem in my telegram bot . thanks :)
Basically, you can't find out if your user has sent the link to others. You can only find out when the other user taps on the link and starts your bot. This can be done by Deep Linking. You should create a unique identifier for each user and add it as a query string to the special link made for the user.
Example:
https://telegram.me/my_bot?invitedFrom=user1
You have to check for invitedFrom parameter each time a user starts your bot in order to credit the referrer user.
By using above method, you will only be notified when the other user starts your bot.
However there is a trick you can do in order to see if a special message is forwarded to other users. Here are the steps:
Make a private channel.
Create a message containing your bot link.
Forward the message to your bot user.
Ask your bot user to forward the message to friends.
Check the view count of the message to know if it's seen by others.
By using this trick you can find out how many times the message containing your bot link is seen.
I'm trying to verify the user's ownership of a Google place, restaurant and bars for now.
I checked this similar question, but it's unanswered.
Basically, the app I'm creating needs the place owners to post on behalf of the place. I want to verify the association of the person posting and the place so that regular users can't post junk. Is there a Google way of doing it ? If not, what other methods do you think is possible? Thanks in advance.
I would like to automatically respond to an e-mail with some information. The idea is to provide a self-service way for students to get grades and passwords. I see sample scripts that work on e-mails, but I need to:
look for a keyword in the subject to understand what type of information to provide (i.e., grade, password, etc.)
look at the e-mail of the inbound e-mail to identify the student (optionally locate a password)
look up the information (possibly in a spreadsheet)
create an e-mail and send it to the student
I am more familiar with using scripts with e-mail and spreadsheets, but I would prefer to create this on a Google Sites page or embed it in a wiki.
Thanks in advance for the help,
JDF
I am not sure how much detail you were looking for, or if you where looking for example code, but here are some high level things to think about.
First, if you are going to embed the code into a webpage that you want be able to access all your other Google things easaly. eg if i stored all the student names passwords and student numbers in an spreadsheet or database you have to set up permission to do so. Your website does not count as you "persay" because if you had it shared out then someone could potentally steal all your google stuff.
Take a good look through the Google appi google apps script. You can search your email by thread (subeject) and then go through the emails like that. I think all the function that you want are there.