Hi David, Loved the episode. Really nice job covering the topic in 20 odd minutes.
One minor observation in Game::Turn#call, the fallback 'else' will never be reached, since we apply `to_i` on the `guess`. We will be sending a misleading reply back in case a non-numeric input is passed.
☒ Yea, it really depends on how you want to handle this kind of situation. Since you are in the middle of the session, would you want to block non commands from being entered and stay within the session. The proper logic will greatly vary depending on the business need.
Thank you for the video. What should I change in the code if I want to send a text message including the keyword for specific model. For instance I want people to write menu and then write their message. They can for instance write: "Thank you for the menu". It would get keyword 'menu' and direct the programme to the next steps meaning model 'menu'?
On your ingress of receiving messages, you'd need to have something that parses their text and call on a different function. Having some sort of AI here could help improve the results, but that's definitely a beyond the scope of this content.
In this particular case, you could change
case body.upcase.strip
to something like
case
when body.upcase.strip.include?('MENU')
so, each switch in the case statement would need to have the conditional check.
One minor observation in Game::Turn#call, the fallback 'else' will never be reached, since we apply `to_i` on the `guess`. We will be sending a misleading reply back in case a non-numeric input is passed.
Thank you for the video. What should I change in the code if I want to send a text message including the keyword for specific model. For instance I want people to write menu and then write their message. They can for instance write: "Thank you for the menu". It would get keyword 'menu' and direct the programme to the next steps meaning model 'menu'?
Thank you.
In this particular case, you could change
to something like
so, each switch in the case statement would need to have the conditional check.
I though about include, but did not know I had to use this way. Now it works.
Thank you.