-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathMODE.py
41 lines (28 loc) · 1.24 KB
/
MODE.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
35
36
37
38
39
40
41
ID = "MODE"
def execute(self, sendMsg, prefix, command, params):
print prefix, params
splitted = params.split(" ")
print splitted
if len(splitted) == 3:
chan = self.retrieveTrueCase(splitted[0])
modes = splitted[1]
name = splitted[2]
add = modes[0] == "+"
perm = ""
if self.Bot_Auth.doesExist(name) and not self.Bot_Auth.isRegistered(name) and not self.Bot_Auth.isQueued(name):
self.whoisUser(name)
for char in modes[1:]:
if char == "v" and perm == "": perm = "+"
if char == "o": perm = "@"
for i in range(len(self.channelData[chan]["Userlist"])):
user, pref = self.channelData[chan]["Userlist"][i]
if user == name:
if add == True:
if pref != "@":
self.channelData[chan]["Userlist"][i] = (user, perm)
else:
self.channelData[chan]["Userlist"][i] = (user, "")
break
#if modes[0] == "+" and "v" in modes:
# pass
#[email protected] #SinZationalMinecraft +v Yoshi2