User1342 commited on
Commit
9068a73
·
1 Parent(s): b35b784

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -2
app.py CHANGED
@@ -1,6 +1,6 @@
1
  import time
2
 
3
- from mastodon import Mastodon # Mastodon.py
4
 
5
  list_of_servers = ['peoplemaking.games',
6
  'ani.work',
@@ -229,7 +229,13 @@ def block_user(user_id, user, reason):
229
  attempts = 0
230
  while not finished:
231
  attempts = attempts + 1
232
- client.account_block(user_id)
 
 
 
 
 
 
233
 
234
 
235
  print("Blocked {}, for {}".format(user, reason))
 
1
  import time
2
 
3
+ from mastodon import Mastodon, MastodonNotFoundError # Mastodon.py
4
 
5
  list_of_servers = ['peoplemaking.games',
6
  'ani.work',
 
229
  attempts = 0
230
  while not finished:
231
  attempts = attempts + 1
232
+
233
+ try:
234
+ client.account_block(user_id)
235
+ except MastodonNotFoundError as e:
236
+ if "Record not found" in str(e):
237
+ print("Record not found...")
238
+ pass
239
 
240
 
241
  print("Blocked {}, for {}".format(user, reason))