aboutsummaryrefslogtreecommitdiff
path: root/Utils.py
diff options
context:
space:
mode:
authorGravatar jesopo2017-12-26 11:50:18 +0000
committerGravatar jesopo2017-12-26 11:50:18 +0000
commit14ffa6716df69ccccb60c97710b6a31d07a07df4 (patch)
tree0df1e2218e98b5b70a33f38bc4318736ec94aaa3 /Utils.py
parentAdded a "replay" system to EventManager hooks, to replay missed .calls (diff)
signature
Added highlight spam detection/prevention logic to channel_op
Diffstat (limited to 'Utils.py')
-rw-r--r--Utils.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/Utils.py b/Utils.py
index 03b7bd31..1e0e90b3 100644
--- a/Utils.py
+++ b/Utils.py
@@ -183,6 +183,10 @@ def bool_or_none(s):
return True
elif s in IS_FALSE:
return False
+def int_or_none(s):
+ stripped_s = s.lstrip("0")
+ if stripped_s.isdigit():
+ return int(stripped_s)
def get_closest_setting(event, setting, default=None):
server = event["server"]