Closed cohlexyz closed 1 year ago
Is your flyout message robust enough that I could stick paid-for chats under it?
It would need some changes. If the html looked like this:
<main></main>
<div id="flyout">
<div id="poll-ui">
</div>
<div id="superchat-ui">
<div class="superchat">
<strong>Chuck</strong> ($5.00)
<p>Message text</p>
</div>
</div>
</div>
you could insert the messages into superchat-ui
and they'd be below the poll, but it's not a completely smooth transition when showing and hiding the poll:
https://github.com/jaw-sh/stream-nexus/assets/142505474/e9e87c44-ec30-4311-a9df-34a4831e42f5
I'm not sure how far you are along with implementing premium chats, so that last commit can be removed if you have your own implementation. I tested this today and it seems like premium chats from rumble are not coming in so I just send my own "donations" to the websocket server for testing. With the last commit it now looks like this:
https://github.com/jaw-sh/stream-nexus/assets/142505474/964fd002-8ee2-4574-928d-0e1f9ec44f0f
The chats time out after 30 seconds, which should probably be configurable. The oldest ones will also be removed if there's more than five on screen. Also the message is cut off after 80 characters to make sure each donation doesn't take up more than two lines.
Adds a simple poll command. I initially thought about handling commands on the server side, but two things kept me from doing so:
Basic functionality is:
!poll [question]; [option 1]; [option 2]; ...; [option n]
!vote [n]
i.e.!vote 1
from any one of the supported platforms!endpoll
is used!multipoll
instead of!poll
can be used to create a poll that allows users to vote for multiple options with!vote 1 4 2 ...
Not the most elegant solution, but it works. Currently the user who can start and stop polls is hardcoded here which should probably be configurable.
Screenshots: