User1342 commited on
Commit
b15d357
1 Parent(s): ddd3e07

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -3
app.py CHANGED
@@ -158,7 +158,7 @@ def block_user(user_id, user, reason):
158
  print("Could not block, so muted")
159
  except tweepy.errors.TooManyRequests as e:
160
  if attempts == 0:
161
- time.sleep(900)
162
  attempts = attempts + 1
163
  else:
164
  finished = True
@@ -180,8 +180,11 @@ def block_user(user_id, user, reason):
180
  continue
181
  #time.sleep(1)
182
  finished = True
183
- me = client.get_me()
184
- print("{} blocked {}, for {}".format(me.data["username"], user, reason))
 
 
 
185
  return blocked
186
 
187
  def block_users(client, threshold, dataset):
 
158
  print("Could not block, so muted")
159
  except tweepy.errors.TooManyRequests as e:
160
  if attempts == 0:
161
+ time.sleep(60)
162
  attempts = attempts + 1
163
  else:
164
  finished = True
 
180
  continue
181
  #time.sleep(1)
182
  finished = True
183
+ try:
184
+ me = client.get_me()
185
+ print("{} blocked {}, for {}".format(me.data["username"], user, reason))
186
+ except tweepy.errors.BadRequest as e:
187
+ print("Blocked {}, for {}".format(user, reason))
188
  return blocked
189
 
190
  def block_users(client, threshold, dataset):