Updated TwitcherExtended
Fixed typo in channel_points_voting_enabled. Changed poll to _poll to avoid name conflicts with poll() function name.
This commit is contained in:
parent
b47df7ad86
commit
2d25921688
1 changed files with 5 additions and 5 deletions
|
|
@ -454,14 +454,14 @@ func poll(title: String, choices: Array[String], duration: int = 60, channel_poi
|
|||
var poll_body: TwitchCreatePoll.Body = TwitchCreatePoll.Body.create(streamer_user.id, title, body_choices, duration)
|
||||
if channel_points_voting_enabled:
|
||||
poll_body.channel_points_per_vote = channel_points_per_vote
|
||||
poll_body.channel_points_voiting_enabled = channel_points_voting_enabled
|
||||
poll_body.channel_points_voting_enabled = channel_points_voting_enabled
|
||||
var poll_response: TwitchCreatePoll.Response = await api.create_poll(poll_body)
|
||||
if poll_response.response.response_code != 200:
|
||||
var error_message: String = poll_response.response.response_data.get_string_from_utf8()
|
||||
push_error("Can't create poll response cause of ", error_message)
|
||||
return {}
|
||||
var poll: TwitchPoll = poll_response.data[0]
|
||||
var poll_end_time: int = Time.get_ticks_msec() + duration * 100 * POLL_TIMEOUT_MS
|
||||
var _poll: TwitchPoll = poll_response.data[0]
|
||||
var poll_end_time: int = Time.get_ticks_msec() + duration * 1000 * POLL_TIMEOUT_MS
|
||||
var event: TwitchEventsub.Event
|
||||
if eventsub && eventsub.has_subscription(TwitchEventsubDefinition.CHANNEL_POLL_END, {&"broadcaster_user_id": streamer_user.id}):
|
||||
var poll_ended: bool
|
||||
|
|
@ -469,8 +469,8 @@ func poll(title: String, choices: Array[String], duration: int = 60, channel_poi
|
|||
if poll_end_time < Time.get_ticks_msec():
|
||||
return {}
|
||||
event = await eventsub.event_received
|
||||
if event.Type != TwitchEventsubDefinition.CHANNEL_POLL_END: continue
|
||||
if event.data[&"id"] != poll.id: continue
|
||||
if event.type != TwitchEventsubDefinition.CHANNEL_POLL_END: continue
|
||||
if event.data[&"id"] != _poll.id: continue
|
||||
break
|
||||
else:
|
||||
_log.i("Can't wait for poll end. Either eventsub is not set to it not listening to ending polls")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue