我试图根据此处提供的源代码(https://github.com/bobby-b-bot)设置Reddit机器人,但是,我一直收到此错误。
ERROR - Could not get environment variables: {}
Traceback (most recent call last):
File "...\reddit\reddit_bot.py", line 56, in <module>
logger.info("Got subreddit names: bot running on {} subreddits".format(subreddits.count('+') + 1)) # count '+' sign plus one.
AttributeError: 'NoneType' object has no attribute 'count'
ERROR - Keyboard termination received. Bye!
有问题的代码如下:
logger.info("Got subreddit names: bot running on {} subreddits".format(subreddits.count('+') + 1)) # count '+' sign plus one.
有人知道我做错了吗?