mrphlip / lrrbot

LoadingReadyRun Twitch chatbot
https://lrrbot.com/
Apache License 2.0
30 stars 20 forks source link

Now Kiss chat game decision #346

Closed paul-lrr closed 6 years ago

paul-lrr commented 7 years ago

Hey folks, Kathleen would like to end her new Now Kiss show on a "swipe left or swipe right" Tinder joke, where the chat decides whether Kathleen continues with the game next week or finds something new. We were thinking it could be done by having people type right or left In the chat. Basically it would like the old !game bad/good thing except that we would actually use this😜.The two extra things would be that it should only be active at the end on the stream (probably when a mod turns it on with a command in chat) and I would need some sort of endpoint that returns the votes for each option that I can hook into to make an onscreen graphic.

Do you think that is something that would be possible?

mrphlip commented 7 years ago

I've thought about adding polling functionality to lrrbot before, and we could do it... but I've wanted to avoid making anything that does polls in-chat, as it tends to make actual chatting basically impossible. Like, you've played Choice Chamber, you've seen how it gets. And sure, this wouldn't be as bad as that, but still.

So I figured if I wanted to implement polls in lrrbot I'd want to do it on the website. And then I figured I wasn't going to be able to build a website that did it better than strawpoll already does, so may as wel just use that instead...

Now, we could just make a shortcut for !poll 300 Now kiss?: Swipe left, Swipe right or whatever that Kathleen can use to make the strawpoll. But the functionality is already in there.

Unless you had a preference for this being done in-chat rather than with strawpoll?

mrphlip commented 7 years ago

Though, a thought that we could have an api endoint to get the active strawpoll ids, or maybe a new event in the SSE channel when a poll is added, something that the overlay can watch to see when a poll is created, so all the host would need to do is run the chat command, and hit a button in the overlay, and not have to manually copy the strawpoll id from chat into the overlay...

RebelliousUno commented 7 years ago

Is there something that could be done with the twitch extension API for interactive overlays?

On Mon, 18 Sep 2017, 13:32 Phillip notifications@github.com wrote:

Though, a thought that we could have an api endoint to get the active strawpoll ids, or maybe a new event in the SSE channel when a poll is added, something that the overlay can watch to see when a poll is created, so all the host would need to do is run the chat command, and hit a button in the overlay, and not have to manually copy the strawpoll id from chat into the overlay...

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/mrphlip/lrrbot/issues/346#issuecomment-330205231, or mute the thread https://github.com/notifications/unsubscribe-auth/AA_7ETNI2n0yRKGz6rwpJNQ9sbFZZGAPks5sjmK-gaJpZM4PadQD .

cecilemuller commented 7 years ago

How about also displaying the realtime results of the strawpoll in a stream overlay (to encourage people to vote), with the color/branding of the show ? (or is the poll meant to run only after the show has ended ?)

For example, something like this: yay nay

paul-lrr commented 7 years ago

Displaying the strawpoll results on the stream with a custom graphic was my thought as well. Graham was thinking of chat voting to make it as simple as possible for viewers to participate (with the idea that the chat spamming would only happen at the end of the show). I think the strawpoll is probably the way to go, at least to start with. The idea of having the strawpoll id available as an api endpoint or a SSE would definitely make things easier for the streamer.

Another factor is that if people are watching but not in chat, they might be more inclined to vote in a strawpoll rather then boot up the chat and login to twitch. I'm pretty sure we have done polls where there are more votes then active chat users.

paul-lrr commented 7 years ago

@RebelliousUno The idea of using the extension API to display the results is interesting (I think there may already be a poll overlay) but I feel like it is probably best to go with real on-screen graphics for now. For one thing, I'm pretty sure extension don't work for mobile/console viewers.

mrphlip commented 7 years ago

@paul-lrr OK, so I've added a few things.

First of all, I've added the command !nowkiss which is essentially just a shortcut for !poll 300 Now Kiss?: Swipe Right (yes); Swipe Left (no), ie creating that poll on Strawpoll and adding it to the bot so it'll report the result in chat in 5 minutes. We can easily change the exact wording or the timing if you (or Kathleen) would prefer. [edit] I looked at the poll from this morning and see it was (a) more verbose, and (b) included the date, both of which we could certainly do. Could also include the game name, since the bot has that available. [/edit]

Next, I've added events to the SSE channel - strawpoll-add, strawpoll-complete and strawpoll-clear. The body for strawpoll-add and strawpoll-complete is essentially just the data we get back from the Strawpoll API... however, if the poll was created with !nowkiss I've added a tag field which says so (if the poll was added normally, this field won't be present), so that the overlay can use that for distinguishing !nowkiss polls from other polls. So the body looks like this:

{
    "captcha": false,
    "dupcheck": "normal",
    "id": 13990933,
    "multi": false,
    "options": [
        "Swipe Right (yes)",
        "Swipe Left (no)"
    ],
    "title": "Now Kiss?",
    "votes": [
        1,
        0
    ],
    "tag": "nowkiss"
}

strawpoll-clear has an empty body, and is sent if a mod uses the !pollsclear command, which removes all the polls from lrrbot (so if you get this, you shouldn't expect to get any strawpoll-complete messages for outstanding polls).

On the other hand, if you want a pull, rather than a push, I've added /api/polls which gives a summary of all the currently-active polls. It has less info since it's not going to get the full data from Strawpoll, just report what lrrbot already knows on its end, but it should be enough to work with. Response looks like:

[
  {
    "id": 13990933, 
    "tag": "nowkiss", 
    "title": "Now Kiss?"
  }
]
paul-lrr commented 7 years ago

Spiffy! Something matching the poll from the last stream in terms of options would be ideal. Since the polls will be almost the same each week, I put the date in the title so that people know they are voting in the right one. Having the Game in there as well would also help. As you might guess, all I really need is the poll id (since my script grabs the rest of the data through the strawpoll api), but the tag field will be handy to separate things.

I don't think there are current plans, but if we want to have polls associated with other shows, I guess we could just have the tag field always be the show id of the current show.

mrphlip commented 7 years ago

OK, I changed the wording so now it looks like this with the game title in the question (assuming it exists in Twitch or someone sets the game override in lrrbot... if it's just set to "Games + Demos" then it'll leave the game title out).

I figured all you'd probably need is the poll id, but I figured, we already have all this other info handy anyway, no harm in throwing it in too.

The idea with the tag field is that it lets the overlay easily know whether the poll was created by the !nowkiss command or the normal way... so you could, for example, make it automatically show the poll overlay for !nowkiss polls without automatically showing an overlay for other polls. The overlay can also assume there's two poll options, and which order they're in, etc.

mrphlip commented 6 years ago

Seems to have been working!