diff --git a/lib/twitcher_extended/twitcher_extended.gd b/lib/twitcher_extended/twitcher_extended.gd index 30427abf..7921d427 100644 --- a/lib/twitcher_extended/twitcher_extended.gd +++ b/lib/twitcher_extended/twitcher_extended.gd @@ -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")