GCCempt / GCC_OpenSong_bot

We were lazy and didn't want to do things by hand so instead we spent hundreds of manhours automating it. classic.
http://gccpraise.com/
2 stars 0 forks source link

Improves song parsing, error handling and logging for worship schedul… #141

Closed AllDayJon closed 3 years ago

AllDayJon commented 3 years ago

Resolves #104

This error is caused when using discord formatting in the post message for example:

**Songs** * Is He Worthy? - V1 V2 C1 V3 C2 E * Turn Your Eyes - V1 V2 C V3 C V4 C C E * Who You Say I Am - V1 C1 V2 C2 B B T C2 E

shows as:

Songs * Is He Worthy? - V1 V2 C1 V3 C2 E * Turn Your Eyes - V1 V2 C V3 C V4 C C E * Who You Say I Am - V1 C1 V2 C2 B B T C2 E

When no songs can be found after parsing the worship schedule file, the parse function returns a "No songs found" string as the "song_list" that is passed into our song validator. The song validator iterates through this with each letter being an index in the string array.

I've added additional logging for us to troubleshoot, and changed the way the song parsing is handled. It should now accept discord formatting since it now looks for the word "songs" within the line it's parsing and sets that line as the starting index.

When validating the songs, we now check for the variable "type" and if string is passed, we assume no songs can be found and return an error message.