UseCase - Quiz skill: Alexa ask a question with 30 sec (Countdown).
For Countdown, I followed How to make Alexa countdown in seconds
Problem: While Countdown going one if the user responded with an answer. Alexa instead of accepting the response it continues with count down. Alexa accepting response only after countdown.
My speech out/speak from Alexa looks like this: Sam Your Question Nobody enjoys this feat? Your time start now 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1
Any suggestions
Unfortunately, you can't. The countdown code you are using outputs speech for the duration of the countdown. You can't "open the microphone" during the speech output (no blue ring). The microphone will open for the user's response for eight seconds only after the speech output is complete, and you have prompted the user for input.
Your best bet is to either do your count-down speech or play a short "thinking" MP3 clip (think something Jeopardy-like) for a fixed amount of time and then prompt the user for the answer. Something like "10, 9, 8, 7, 6, 5, 4, 3, 2, 1. Time's up! What's your answer?"
While countdown going if you want Alexa to accept your answer then you will have to speak out the wake word "Alexa". The wake word is the only way to open the mic whenever you want and stop the countdown. So say "Alexa", and then give your response. This will work
Related
Im trying to make a /giveaway command for my discord bot, but when the user clicks the "join giveaway" button after 15 mins (after the giveaway was created)it says "Application Didn't Respond"
Is there any way to bypass/solve this?
A button has a default timeout of 200 seconds, and you can bypass that with timeout=none. (Discord.py latest version)
Button(label='No timeout', timeout=None)
I have a decentralised application deployed on RSK, and has been working for several months. Everything works correctly using the public node,
however infrequently, we start getting a totally random error:
Unknown Error: {
"jsonrpc": "2.0",
"id": 2978041344968143,
"error": {
"code": -32010,
"message": "transaction nonce too high"
}
}
There is no information about “too high” nonces but many threads about “too slow”. I’m using web3.Contract.method.send().
In Metamask, ensure you are on your dev/test account then:
1 click on the avatar circle top right
2 In the menu, choose Settings
3 Click Advanced
4 Scroll down a bit, make sure again you are on your testnet account, click Reset Account
There is a limit on the number transactions the same address can have on the transaction pool.
This limit is 4 for RSK,
and is defined within TxValidatorNonceRangeValidator
within the rskj code base:
BigInteger maxNumberOfTxsPerAddress = BigInteger.valueOf(4);
Note that Ethereum has a similar limit,
but the limit that is configured in geth is 10.
So if we have already sent 4 transactions, that have not been mined yet, and send a 5th transaction before the next block is mined, it will get an error that the nonce is too high. If a block was mined and it had let's say all 4 of the transactions, then we would be able to add up to 4 transactions for the next block.
Workarounds
(1) Send no more than 4 transactions from an address, until there is a new block.
(2) Aggregate all of the calls and then use a contract that executes them in a single go.
An example of this is seen in
RNS Batch Client ExecuteRegistrations.
For me it happened when i restarted the node, following instruction fixed it:
Open up your MetaMask window and click on the icon in the top right to
display accounts. Go to Settings, then Advanced and hit Reset Account.
How to add wait of 30 sec. in between 2 loop controller?
Each loop controller has loop count 10.
Scenario:
1.No. of threads=5
2.For each user, No. of loop controllers=5
Loop_controller_1(count=10, i.e. 10 HTTP request)
Wait for 10 sec
Loop_controller_2(count=10 i.e. 10 HTTP request)
wait for 10 sec
Loop_controller_3(count=10 i.e. 10 HTTP request)
wait for 10 sec
Loop_controller_4(count=10 i.e. 10 HTTP request)
wait for 10 sec
Loop_controller_5(count=10 i.e. 10 HTTP request)
wait for 10 sec
Please check there is no wait between 10 HTTP request, it must wait after 10 are completed. How to use Jmeter components?
Add Flow Control Action between Controllers and choose Pause with 10000 miliseconds
allows pauses to be included without needing to generate a sample
Depending on what you're trying to achieve:
You can add a 30 seconds wait for each thread (virtual user) individually you can add a Constant Timer as a child of the first request in the Loop Controller 2, timers are executed before requests so each thread will wait for the defined amount of time prior to starting the new Loop Controller
You can configure JMeter to "gather" all threads and tell them to wait for the specified amount of time together by adding a Flow Control Action sampler and a Synchronizing Timer with number of users to group by equal to the number of threads in your thread group
I have a client app which listens for added and removed messages from some mailboxes and folders and I'm using Javamail 1.5.6.
I have a really strange issue and very difficoult to debug.
For only one mail account, which receives about 1000 messages every day, in two different days I got a body belonging to a different message from the expected one.
I asked for log files to mail server customer service and there I can see a wrong messageNumber in my FETCH BODY request, for example:
20191024 15:49:24 00991EA7 IMAP4 FETCH BODY msg=255264 length=3268
20191024 15:49:24 00991EA7 IMAP4 FETCH RESPONSE user 'XXX#userid.local' command 'A245 FETCH 19 (BODY.PEEK[])' Time=0
I was able to reconstruct the event and I'm sure that the message, before the time of body request, had messageNumber 18 and not 19.
Moreover, messages in previous positions (17, 16, 15 etc..) have been rightly retrieved, the mail server log too shows right FETCH BODY.
From the time of last IMAPFolder.open(), only one expunge has happened on a message located in a in a position prior to 19, so all messages following that position have been shifted to left of one position.
Here follows a summary of main events:
IMAPFolder opening
A new message is added in mail-box, messageNumber: 19 (it will be this one which presents a different body)
Other three new messages are added, so 20, 21 and 22
The message having messageNumber 5 is explicitely expunged, so following messages are shifted to left
The messages in 22, 21 and 20 are explicitely expunged
Finally the message, now in 18 due to last expunge, is requested to get its body and attachments, but the mail-server logged "FETCH 19" and returned different body.
Unfortunately I haven't javamail debug logs, because they are too verbose and big to retain them for too many days
Thanks
//function fires after special command every 100 milliseconds
function searchSpeaking(roleSpeak){
//checks every channel; giving you member-channel and its chanId-id
bot.channels.forEach((channel, chanId) => {
//filters out text channels
if (channel.type == 'voice'){
//checks every member in voice channel; giving you guildMember-user and his/her id
channel.members.forEach((guildMember, memberId) => {
//debug
console.log(guildMember.nickname, guildMember.speaking)
console.log("-----------------------------------")
//activates when user speaks DOESN'T WORK
if (guildMember.speaking){
//adds 'score' it means how mayn milli seconds user talks
scoreboard[memberId] += 100
console.log("user is speaking!")
//if user talks for over 30s = 30 000 milliseconds and has option to talk
if ((scoreboard[memberId] > 30 * 1000) && guildMember.roles.has(roleSpeak.id)){
//reset his score and remove his option to speak
scoreboard[memberId] = 0
guildMember.removeRole(roleSpeak)
}
}
//if user isnt talking because his option/role to talk was removed
else if (!(guildMember.roles.has(roleSpeak.id))){
//we messure how much time he/she has been muted/without talking option
scoreboard[memberId] += 100
//if he/she was muted for a minute he/she will get his option/role to talk back
if (scoreboard[id] > 60 * 1000){
//reset score and give back role
scoreboard[memberId] = 0
guildMember.addRole(roleSpeak)
}
}
})
}
})
}
So in the line under a comment ( // ) stating that this doesn't work is an if statement that never passes even tho users are speaking in channels. It is console.loging as false as well (obvious). So i can't figure out why as i understand the docs it should turn to true every time member speaks. I will just say this again (as it says in first code comment) this function fires every 100ms = 0.1s and gets a role it is supposed to change based on score further explained in code comments.
Thanks for any help working with .speaking!
With the current API, there is no way to know if a user is talking in a voice channel without joining the voice channel.
You would need to join a voice channel, get a list of the users that are talking, and then switch to another channel (if there are any members in that channel).
You would probably get rate limited very quickly using this method.
Only way without joining the channels, would be getting the list of members in voice channels, and filter those with microphone muted. You still wouldn't know if they are really talking.
If you would want to join the channel and "listen" to the speaking, you could use the event guildMemberSpeaking. This would activate whenever a user starts/stops talking in the voice channel you are.