Print a helpful message when bot.py or bot4.py isn't found.

master
Ethan Dalool 2020-02-08 15:51:45 -08:00
parent 5345e8f4fc
commit dd38e0c8da
1 changed files with 9 additions and 2 deletions

View File

@ -19,8 +19,15 @@ try:
except ImportError:
bot = None
if bot is None or bot.praw != praw:
try:
import bot4
bot = bot4
except ImportError:
message = '\n'.join([
'Could not find your PRAW4 bot file as either `bot.py` or `bot4.py`.',
'Please see the README.md file for instructions on how to prepare it.'
])
raise ImportError(message)
logging.basicConfig()