forked from theiostream/pybot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
safety.py
34 lines (22 loc) · 752 Bytes
/
safety.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# safety.py -- by theiostream
# -- checks if an action from action.py can be executed, as there might be limitations for bot usage on yourbot.py
# Part of PyBot, (C) 2011 Matoe Productions LLC
import arr
def checkIfCanExecuteAggressive():
import pybot
if pybot.notAllowHarmful==0:
return True
if arr.checkIfReal(pybot.allowedHarmfulFor):
for x in pybot.allowedHarmfulFor:
if pybot.data[1:pybot.data.index('!')]==x:
return True
if pybot.data[1:pybot.data.index('!')]==pybot.owner:
return True
return False
def checkIfPersonIsIgnoredByBot():
import pybot
if arr.checkIfReal(pybot.ignoredByBot):
for x in pybot.ignoredByBot:
if pybot.data[1:pybot.data.index('!')]==x:
return True
return False