Skip to content

Commit

Permalink
Dont commit for reaching daily limits
Browse files Browse the repository at this point in the history
  • Loading branch information
hiveuprss committed Aug 14, 2021
1 parent 195e2fe commit 858b0ba
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions pizza-bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,13 +312,15 @@ def hive_posts_stream():

invoker_level = get_invoker_level(author_account)

# Check if the invoker meets requirements to use the bot
if not can_gift(author_account):

print('Invoker doesnt meet minimum requirements')

min_balance = float(config['AccessLevel1']['MIN_TOKEN_BALANCE'])
min_staked = float(config['AccessLevel1']['MIN_TOKEN_STAKED'])

# Check if invoker has reached daily limits
if invoker_level > 0 and daily_limit_reached(author_account):
max_daily_gifts = config['AccessLevel%s' % invoker_level]['MAX_DAILY_GIFTS']

Expand All @@ -331,6 +333,10 @@ def hive_posts_stream():
target_account=author_account,
max_daily_gifts=max_daily_gifts)
message_body = '%s tried to send PIZZA but reached the daily limit.' % (author_account)

print(message_body)
post_discord_message(ACCOUNT_NAME, message_body)
# Tell the invoker how to gain access to the bot
else:
if use_spanish_templates:
comment_body = esp_comment_fail_template.render(token_name=TOKEN_NAME,
Expand All @@ -344,9 +350,9 @@ def hive_posts_stream():
min_staked=min_staked)
message_body = '%s tried to send PIZZA but didnt meet requirements.' % (author_account)

post_comment(post, ACCOUNT_NAME, comment_body)
print(message_body)
post_discord_message(ACCOUNT_NAME, message_body)
post_comment(post, ACCOUNT_NAME, comment_body)
print(message_body)
post_discord_message(ACCOUNT_NAME, message_body)

continue

Expand Down

0 comments on commit 858b0ba

Please sign in to comment.