cleartonic / twitchtriviabot

Twitch Trivia Bot
MIT License
23 stars 13 forks source link

Getting "No questions were loaded" message #24

Open profsoru opened 9 months ago

profsoru commented 9 months ago

I had the bot working for a short while and while adding more questions, it then gave me the error log of "Error on reading csv file. Check encoding format set in trivia_config is the same as csv file". I hadn't changed the name of the file or the locations, I've confirmed that my csv file is encoded the same way I've set the config files to read. I have the latest version and I've tried redownloading the csv file from here several times and loading it with the same amount of questions where it worked the first time but still nothing.

I'm new to this Python thing since I really only got it for this bot, so any help would be amazing.

Here is the log when it was working then stopped:

11/27/2023 11:40:41 PM profsoru 11/27/2023 11:40:41 PM Profesor_Bot 11/27/2023 11:40:41 PM Message received: !triviastart

11/27/2023 11:40:41 PM Starting session... 11/27/2023 11:40:41 PM Beging setting up Session... 11/27/2023 11:40:41 PM Setting up session constants... 11/27/2023 11:40:41 PM Loading config... 11/27/2023 11:40:41 PM file_name triviaset.csv question_count 3 hint_time1 30 hint_time2 50 skip_time 60 question_delay 10 question_bonusvalue 3 mode single music_mode False order random category_distribution random length finite admins profsoru,allexiar output True csv_encoding utf-8

11/27/2023 11:40:41 PM Loading trivia data... 11/27/2023 11:40:41 PM Data line was ignored for csv header 11/27/2023 11:40:41 PM Creating session set data. Population 9, session 3 11/27/2023 11:40:41 PM Finished setting up Session. 11/27/2023 11:40:41 PM Active 11/27/2023 11:40:51 PM Category: Music Question: How many awards did\ufffd Take On Me by A-Ha win at the 1986 MTV video music awards Answers: ['6', None, None, None] 11/27/2023 11:40:51 PM Error on write question to file 11/27/2023 11:40:59 PM profsoru 11/27/2023 11:40:59 PM Profesor_Bot 11/27/2023 11:40:59 PM Message received: 6

11/27/2023 11:40:59 PM Session vars trivia_active: True questionasked: True 11/27/2023 11:40:59 PM Creating new user profsoru 11/27/2023 11:40:59 PM Answer recognized: 6 11/27/2023 11:41:09 PM Category: Games Question: In what year was Sony Playstation 2 released? Answers: ['2000', None, None, None] 11/27/2023 11:41:15 PM profsoru 11/27/2023 11:41:15 PM Profesor_Bot 11/27/2023 11:41:15 PM Message received: 2000

11/27/2023 11:41:15 PM Session vars trivia_active: True questionasked: True 11/27/2023 11:41:15 PM Returning found user profsoru 11/27/2023 11:41:15 PM Answer recognized: 2000 11/27/2023 11:41:25 PM Category: Music Question: Yazz And The Plastic Population sang \ufffdthe only way is ___\ufffd Answers: ['Up', None, None, None] 11/27/2023 11:41:25 PM Error on write question to file 11/27/2023 11:42:00 PM profsoru 11/27/2023 11:42:00 PM Profesor_Bot 11/27/2023 11:42:00 PM Message received: up

11/27/2023 11:42:00 PM Session vars trivia_active: True questionasked: True 11/27/2023 11:42:00 PM Returning found user profsoru 11/27/2023 11:42:00 PM Answer recognized: Up 11/27/2023 11:42:10 PM Error on write question to file 11/27/2023 11:42:10 PM Ending trivia... 11/27/2023 11:42:11 PM Setting trivia to inactive based on active_session... 11/27/2023 11:43:55 PM Pong sent 11/27/2023 11:48:15 PM Pong sent 11/27/2023 11:50:09 PM profsoru 11/27/2023 11:50:09 PM Profesor_Bot 11/27/2023 11:50:09 PM Message received: !triviastart

11/27/2023 11:50:09 PM Starting session... 11/27/2023 11:50:09 PM Beging setting up Session... 11/27/2023 11:50:09 PM Setting up session constants... 11/27/2023 11:50:09 PM Loading config... 11/27/2023 11:50:09 PM file_name triviaset.csv question_count 3 hint_time1 30 hint_time2 50 skip_time 60 question_delay 10 question_bonusvalue 3 mode single music_mode False order random category_distribution random length finite admins profsoru,allexiar output True csv_encoding utf-8

11/27/2023 11:50:09 PM Loading trivia data... 11/27/2023 11:50:09 PM Error on reading csv file. Check encoding format set in trivia_config is the same as csv file 11/27/2023 11:50:09 PM Error on data load. Check trivia set and make sure file_name matches in config, and that file matches columns/headers correctly Error code:

cannot access local variable 'data' where it is not associated with a value 11/27/2023 11:50:09 PM Active

And here is the most recent log with a new csv file reflected in the config file:

image image

12/11/2023 07:38:50 PM Connect False 12/11/2023 07:38:50 PM Begin setting up Trivia Bot... 12/11/2023 07:38:50 PM Passed trivia_config validation. 12/11/2023 07:38:50 PM Passed auth_config validation. 12/11/2023 07:38:50 PM Setting up Chat Bot... 12/11/2023 07:38:51 PM Finished setting up Chat Bot. 12/11/2023 07:38:51 PM Finished setting up Trivia Bot. 12/11/2023 07:38:51 PM Starting connect loop 12/11/2023 07:39:46 PM profsoru 12/11/2023 07:39:46 PM Profesor_Bot 12/11/2023 07:39:46 PM Message received: !triviastart

12/11/2023 07:39:46 PM Starting session... 12/11/2023 07:39:46 PM Beging setting up Session... 12/11/2023 07:39:46 PM Setting up session constants... 12/11/2023 07:39:46 PM Loading config... 12/11/2023 07:39:46 PM file_name questions.csv question_count 3 hint_time1 30 hint_time2 50 skip_time 60 question_delay 10 question_bonusvalue 3 mode single music_mode False order random category_distribution random length finite admins profsoru,allexiar output True csv_encoding utf-8

12/11/2023 07:39:46 PM Loading trivia data... 12/11/2023 07:39:46 PM Error on reading csv file. Check encoding format set in trivia_config is the same as csv file 12/11/2023 07:39:46 PM Error on data load. Check trivia set and make sure file_name matches in config, and that file matches columns/headers correctly Error code:

cannot access local variable 'data' where it is not associated with a value 12/11/2023 07:39:46 PM Active 12/11/2023 07:39:54 PM Connect True 12/11/2023 07:39:54 PM Ending connection.