cleartonic / twitchtriviabot

Twitch Trivia Bot
MIT License
23 stars 13 forks source link

TypeError: sequence item 1: expected str instance, NoneType found #20

Closed digital420 closed 1 year ago

digital420 commented 1 year ago

Bot crashes after loading a question.

Steps to reproduce 1) execute command from cli python twitchtriviabot.py 2) Once GUI opens click connect 3) After connection is completed click start trivia 4) Wait for bot to ask question and crash

Terminal output QSettings::value: Empty key passed QSettings::value: Empty key passed Break by placed_num >= question_count Traceback (most recent call last): File ".../twitchtriviabot/main.py", line 350, in toggle_connect self.connect() File ".../twitchtriviabot/main.py", line 393, in connect self.update_gui() ^^^^^^^^^^^^^^^^^ File ".../twitchtriviabot/main.py", line 303, in update_gui self.answer_variable_text.setText(', '.join(self.tb.active_session.active_question.answers)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: sequence item 1: expected str instance, NoneType found Aborted (core dumped)

Configuration files. Trivia_Config: file_name: triviaset.csv question_count: 3 hint_time1: 30 hint_time2: 60 skip_time: 90 question_delay: 10 question_bonusvalue: 3 mode: single music_mode: false order: random category_distribution: distributed length: finite admins: output: true csv_encoding: utf-8

triviaset.csv category,question,answer,answer2,creator Lame,On which side does a chicken have the most feathers?,The outside,42, Lame,How do you know when there is an elephant under your bed?,Your nose touches the ceiling,42, Lame,Why did the snowman call his dog Frost?,Because Frost bites,42,

Running command line in Linux python --version Python 3.11.5

cat output_log.log 09/11/2023 12:44:55 AM Connect False 09/11/2023 12:44:55 AM Begin setting up Trivia Bot... 09/11/2023 12:44:55 AM Passed trivia_config validation. 09/11/2023 12:44:55 AM Passed auth_config validation. 09/11/2023 12:44:55 AM Setting up Chat Bot... 09/11/2023 12:44:56 AM Finished setting up Chat Bot. 09/11/2023 12:44:56 AM Finished setting up Trivia Bot. 09/11/2023 12:44:56 AM Starting connect loop 09/11/2023 12:44:59 AM Starting session... 09/11/2023 12:44:59 AM Beging setting up Session... 09/11/2023 12:44:59 AM Setting up session constants... 09/11/2023 12:44:59 AM Loading config... 09/11/2023 12:44:59 AM file_name triviaset.csv question_count 3 hint_time1 30 hint_time2 60 skip_time 90 question_delay 10 question_bonusvalue 3 mode single music_mode False order random category_distribution distributed length finite admins
output True csv_encoding utf-8

09/11/2023 12:44:59 AM Loading trivia data... 09/11/2023 12:44:59 AM Data line was ignored for csv header 09/11/2023 12:44:59 AM Creating session set data. Population 3, session 3 09/11/2023 12:44:59 AM Category counts breakdown: 09/11/2023 12:44:59 AM Lame: 3 09/11/2023 12:44:59 AM Finished setting up Session. 09/11/2023 12:44:59 AM Active 09/11/2023 12:45:09 AM Category: Lame Question: How do you know when there is an elephant under your bed? Answers: ['Your nose touches the ceiling', '42', None, None, None]

cleartonic commented 1 year ago

This error was from a problem with the latest version. Download and use v2.2.0, the only difference is that that 2.2.0 only allows 2 answers, which is what you have in your set anyways.

digital420 commented 1 year ago

Thanks, Is there a version that only requires 1 answer. the 42 at the end was added for testing purposes. I did manage to download a zip file for 2.2.0 but now it just tells me over and over No questions were loaded. Check log for issue reporting and restart the trivia bot. and the log just indicates to check the file name