Edge guards to prevent nesting (example for 565 - 634) - Mia chi~ #24
PrestigiousUnit
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
lowered = text.lower()
tmp = ""
while True: # Just to prevent nesting: it won't loop
if lowered.find("clips.twitch.tv/") != -1 or username.lower().strip() == broadcaster.lower():
break
try: # Ban users including Mods / VIPs
tmp = next((reason for reason in banReasons if reason.lower() in lowered), None)
if tmp:
message("/ban " + username)
print("Banned " + username + " because of " + tmp)
except IndexError as e:
if testing:
raise
print(str(e))
if any(badge == "moderator/1" or badge == "vip/1" for badge in badges):
break
if not ("/" in lowered and "." in lowered):
break
try:
tmp = next((domain for domain in topLevelDomains if domain.lower() in lowered), None)
if tmp:
message("/timeout " + username + " 1")
print("Timed out " + username + " for 1 second because of " + tmp)
except IndexError as e:
print(str(e))
try: # Timeout misbehaving users, not including Mods / VIPs
tmp = next((item for item in timeout1 if item.lower() in lowered), None)
if tmp:
message("/timeout " + username + " 1")
print("Timed out " + username + " for 1 second because of " + tmp)
tmp = next((item for item in disney if item.lower() in lowered), None)
if tmp:
message("/timeout " + username + " 600")
print("Timed out " + username + " for 10 minutes because of " + tmp)
#tmp = next((item for item in timeout10 if item.lower() in lowered), None)
#if tmp:
# message("/timeout " + username + " 600")
# print("Timed out " + username + " for 10 minutes because of " + tmp)
tmp = next((item for item in timeout4Hours if item.lower() in lowered), None)
if tmp:
message("/timeout " + username + " 1440")
print("Timed out " + username + " for 24 hours because of " + tmp)
except IndexError as e:
print(str(e))
if testing:
raise
break # Exit the while loop
Beta Was this translation helpful? Give feedback.
All reactions