Skip to content

Commit

Permalink
Update tldr_bot.py
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastiaanspeck authored Sep 30, 2024
1 parent db6e329 commit b5d4c69
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tldr_bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def check_already_commented(issue_id):
return True

comments = resp.json()
return any(c['user']['login'] == 'tldr-bot' for c in comments)
return any(c['user']['login'] == BOT_USERNAME for c in comments)


@app.route('/', methods=['POST']) # old route, to be removed
Expand Down Expand Up @@ -110,8 +110,9 @@ def status():

GITHUB_API_URL = 'https://api.github.com'
BOT_TOKEN = os.getenv('BOT_TOKEN')
BOT_USERNAME = os.getenv('BOT_USERNAME')
REPO_SLUG = os.getenv('REPO_SLUG')

if BOT_TOKEN is None or REPO_SLUG is None:
if BOT_TOKEN is None or BOT_USERNAME is None or REPO_SLUG is None:
print('Needed environment variables are not set.')
sys.exit(1)

0 comments on commit b5d4c69

Please sign in to comment.