I want to write a Google Home action that tells the latest value of a field in a DB table. (Another service will keep updating the DB.)
How do I make Google Home speak the update automatically every 10 seconds without further user utterance after the Action is launched?
Interaction would be like this:
User: "OK Google, start Progress Updater"
Google Home: (Every X seconds) "10 percent."
Google Home: "19 percent"
...
Google Home: "100 percent."
Google Home: *"Task is complete!"
End of interaction
I know how to do it if a user has to say every time "Google Home, get me update".
Is there a way to do it in an automatic loop?
Tried following code based on response from #Prisoner
conv.ask(new MediaObject({
name: 'Jazz in Paris',
url: 'https://storage.googleapis.com/automotive-media/Jazz_In_Paris.mp3',
description: 'A funky Jazz tune',
icon: new Image({
url: 'https://storage.googleapis.com/automotive-media/album_art.jpg',
alt: 'Media icon',
}),
}));
});
The best tool that we have to do this is the Media prompt.
Under this scheme, when you return any progress except for "complete", you'll include a Media object with a 10 second audio. When the audio finishes playing, you'll get a MEDIA_STATUS result, indicating the audio has finished. You can then check the status and reply accordingly, possibly including another Media in your prompt.
Related
So, I have created two applications, user and admin, using flutter. And both of them are in a single firebase project.
The Applications are investment-related. What I want to do is, Suppose a user sends an investment request from the user app. Another user in the admin app should be able to approve or disapprove the request and then the request status should be visible in the user app. Is there any way to do it?
What I tried: I created a new field in Firebase Realtime Database named Request Status. Then I passed a String Approved into it through the Admin app but it didn't work.
...
final investmentRequestsRef = database.child("Investment Requests");
...
void addData(String requestStatus) {
investmentRequestRef.set({
"Request Status": requestStatus,
});
}
...
Code of button that updates the status:
ElevatedButton(
...
onPressed: () {
addData("Approved");
},
...
)
What happens in realtime database when I do the method
You should try something like this...
DatabaseReference ref = FirebaseDatabase.instance.ref("Investment Requests/${requestID}");
await ref.update({
"Request Status": requestStatus,
});
This should work... I haven't seen your full code so I can't add anything else without more details about your code.
Use this official link of FlutterFire for reference.
OK so...through a custom form, I am successfully registering attendees to Go To Webinar but am blocked if there are multiple sessions of the same webinar. Currently, I am returning scheduled sessions to populate our dropdown menu (response shown below) but am challenged with passing back sessionKey with the registration payload. Has anyone successfully done this? Help! I've also put in an inquiry with GTW so will let folks know what I hear if others are struggling with this also. Thanks!
[{
webinarKey: xxxxxxxxxxxxxxxxx,
registrantsAttended: 0,
webinarID: "xxxxxxx",
sessionKey: 666666,
startTime: "2020-05-06T19:27:54Z",
endTime: "2020-05-06T20:01:13Z"
},
{
webinarKey: xxxxxxxxxxxxxxxxx,
registrantsAttended: 0,
webinarID: "xxxxxxx",
sessionKey: 777777,
startTime: "2020-05-07T19:26:08Z",
endTime: "2020-05-07T19:26:43Z"
}]
Populate a list for the webpage visitor using Scheduled
webinars
An interested individual selects a webinar from the list
and you submit their details using Create registrant
For step 2 you should also know the following:
To use the second version of the api you must pass the header value
'Accept: application/vnd.citrix.g2wapi-v1.1+json'
instead of 'Accept: application/json'.
Leaving this header out results in the first version of the API call.
Currently trying to use setPresence for my bot, and I can get the name but no extra details for the 2nd line and no images.
bot.user.setPresence({
game: {
name: "Ready to brawl!",
application_id: 'the id',
details: "These sharks are ready for a fight.",
type: 0
},
assets: {
large_image: "large",
large_text: "Do not jump into that tank...",
small_image: "small",
small_text: "c!help"
},
status: "dnd"
});
So what shows up is:
My bot is on DND, shows "Playing Ready to brawl!", but nothing else. The details part doesn't show up and there's no large or small image.
I've used a custom presence application before so I assumed you needed your own discord application on the developers site, so I made one. I have the name of it the exact same as the "name: '.' " part and I have the id in the application id part. (I'm not sure if it's bad to share the ID so I excluded it.)
Before I tried using large_image and small_image as pure inputs and gave them links, but neither that nor this application one worked.
So if I'm seriously fucking something up here, help would be appreciated
It's normal, you can't use Rich Presence with a bot actually. Maybe someday Discord will allowed this.
In Details:
Example:
user:- asks About Cricket News.
Alexa:- Reads about the new.
If users says come again or replay
user: Come again.
Alexa: Must read it again what it spoke earlier.
How to handle this situation using webhooks.
Thanks in advance.
You can make use of sessionAttributes to keep track of the last response that Alexa spoke. Whenever you return a response just store the speech and re-prompt in sessionAttributes and whenever a ComeAgainIntent is triggered, take the value from the sessionAttributes and respond accordingly.
Ex:
...
"sessionAttributes": {
"lastResponse": {
"speech": "This was my last speech",
"reprompt": "This was my lst reprompt"
}
}
...
Every time before building the response store the response as lastSpeech in session attributes and write a comeAgainIntent or use amazon.REPEAT intent to repeat the response by getting lastSpeech from session attributes.
I'm working on a web application which is mostly based of Facebook
Graph API. I hold some user's data - actually , the possible
public data available - such as profile picture, name and id. I
wondered how I'll be able to get a direct link to a user cover picture
of a user only by using his id? and I already got the User ID.
This is the code that I used to get the profile picture & it worked-
<img src="https://graph.facebook.com/{{user.id}}/picture?type=large" style="float:left;"/>
Now I want to get cover picture.
Thanks in advance.
To get the cover picture of a user, make this call-
\GET http://graph.facebook.com/{user-id}?fields=cover
You'll get the image url in source key of the JSON response:
{
cover: {
id: "111222333",
offset_y: 55,
source: "https://scontent-a.xx.fbcdn.net/.....jpg" // that's the cover photo url
},
id: "111222"
}