@@ -8,19 +8,19 @@ class PsywerxGroups(PsywerxPlugin):
8
8
def __init__ (self , bot = None ):
9
9
super (PsywerxGroups , self ).__init__ (bot = bot )
10
10
self .actions = {
11
- '@mygroup' : self ._basicAction ('irc/mygroups' ),
12
- '@group' : self ._basicAction ('irc/groups' ),
13
- '@leaveall' : self ._basicAction ('irc/leaveAll' ),
14
- '@leave' : self ._leaveAction ,
15
- '@join' : self ._joinAction ,
11
+ '@mygroup' : self ._basic_action ('irc/mygroups' ),
12
+ '@group' : self ._basic_action ('irc/groups' ),
13
+ '@leaveall' : self ._basic_action ('irc/leaveAll' ),
14
+ '@leave' : self ._leave_action ,
15
+ '@join' : self ._join_action ,
16
16
}
17
17
18
- def _basicAction (self , url ):
18
+ def _basic_action (self , url ):
19
19
def _req (channel , params , msg_lower ):
20
20
return self .request (channel , url , params )
21
21
return _req
22
22
23
- def _joinAction (self , channel , params , msg_lower ):
23
+ def _join_action (self , channel , params , msg_lower ):
24
24
def parse_join (splt ):
25
25
if len (splt ) == 2 :
26
26
return splt [1 ].replace ('@' , '' ), False
@@ -36,14 +36,14 @@ def parse_join(splt):
36
36
params ['offline' ] = g [1 ]
37
37
return self .request (channel , 'irc/join' , params )
38
38
39
- def _leaveAction (self , channel , params , msg_lower ):
39
+ def _leave_action (self , channel , params , msg_lower ):
40
40
splited = msg_lower .split (' ' )
41
41
if len (splited ) == 2 :
42
42
group = splited [1 ].replace ('@' , '' )
43
43
params ['group' ] = group
44
44
return self .request (channel , 'irc/leave' , params )
45
45
46
- def _handleActions (self , channel , nick , msg , line = None ):
46
+ def _handle_actions (self , channel , nick , msg , line = None ):
47
47
msg_lower = msg .lower ()
48
48
for a in self .actions .keys ():
49
49
if msg_lower .startswith (a ):
@@ -54,7 +54,7 @@ def _handleActions(self, channel, nick, msg, line=None):
54
54
return True
55
55
return False
56
56
57
- def _handleMentions (self , channel , nick , msg , line = None ):
57
+ def _handle_mentions (self , channel , nick , msg , line = None ):
58
58
msg_lower = msg .lower ()
59
59
mentions = set ()
60
60
offline_mentions = set ()
@@ -88,5 +88,5 @@ def _handleMentions(self, channel, nick, msg, line=None):
88
88
+ " " + msg , channel )
89
89
90
90
def handle_message (self , channel , nick , msg , line = None ):
91
- if not self ._handleActions (channel , nick , msg , line ):
92
- self ._handleMentions (channel , nick , msg , line )
91
+ if not self ._handle_actions (channel , nick , msg , line ):
92
+ self ._handle_mentions (channel , nick , msg , line )
0 commit comments