HackerSpace-PESU / pesu-academy-bot

PESU Academy Discord Bot built for PESsants and PESts of PES University
http://bit.ly/pesu-academy-bot
21 stars 9 forks source link

Combine bot-aws.py and bot-heroku.py into a single bot.py #8

Closed aditeyabaral closed 3 years ago

aditeyabaral commented 3 years ago

There are 2 scripts to run the bot, one for AWS and Heroku respectively. The reason for this is that both of them have different paths for chromedriver. It would be better if there was a way to combine them into a single bot.py that could use the correct path based on the service being hosted on.

On Heroku, the chromedriver and chrome paths need to be set to the following

CHROMEDRIVER_PATH="/app/.chromedriver/bin/chromedriver"
GOOGLE_CHROME_BIN="/app/.apt/usr/bin/google-chrome"

Additionally, the webdriver needs to have an additional argument executable_path and an additional chrome option set

chrome_options.binary_location = GOOGLE_CHROME_BIN
driver = webdriver.Chrome(executable_path=CHROMEDRIVER_PATH, options=chrome_options)

On AWS, none of these are required since chromedriver (and chrome, I think) are on path.

aditeyabaral commented 3 years ago

AWS deployment is currently not possible hence closing the issue temporarily.