Kevin-Mok / TrapBot

reddit bot that looks for comments with song names and responds with their respective SoundCloud links. [Django]
GNU Affero General Public License v3.0
0 stars 0 forks source link

Crashes if artist name is 3 chars long #43

Open Kevin-Mok opened 6 years ago

Kevin-Mok commented 6 years ago

e.g. Y2K - 6 Foot 7 Foot (Y2K Remix)

Traceback (most recent call last):
  File "scan_reddit.py", line 107, in <module>
    write_post.write_post_if_appropriate(reddit_service.comment(id='dyo3vcm'))
  File "/home/kevin/coding/TrapBot/write_post.py", line 129, in write_post_if_appropriate
    print_matched_comment(comment_body, url, song_url_pairs, comment.id)
  File "/home/kevin/coding/TrapBot/write_post.py", line 86, in print_matched_comment
    output = add_matches_to_output(output, song_url_pairs)
  File "/home/kevin/coding/TrapBot/write_post.py", line 74, in add_matches_to_output
    match_output = [pair[1].user['username'], pair[1].title]
AttributeError: 'str' object has no attribute 'user'