-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added better auth support, removed multi-channel support because it w…
…as irritating me.
- Loading branch information
AClockWorkLemon
committed
Aug 11, 2012
1 parent
578552c
commit 8965eef
Showing
4 changed files
with
73 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
|
||
class Plugin: | ||
def __init__(self, controller): | ||
self.c = controller | ||
|
||
self.op_chars = '@' | ||
self.voice_chars = '+' | ||
|
||
def on_incoming(self, msg): | ||
if msg.command == '353': | ||
nicks = msg.body.split() | ||
for nick in nicks: | ||
if nick[0] in self.op_chars: | ||
self.c.ops.append(nick[1:]) | ||
elif nick[0] in self.voice_chars: | ||
self.c.voiced.append(nick[1:]) | ||
|
||
elif msg.command == msg.MODE: | ||
if msg.body[1] in 'vo': | ||
mode, nick = msg.body.split() | ||
l = self.c.ops if mode[1] == 'o' else self.c.voiced | ||
if mode[0] == '-': | ||
l.remove(nick) | ||
elif mode[0] == '+': | ||
l.append(nick) | ||
|
||
elif msg.command == msg.NOTICE and msg.nick == "NickServ": | ||
args = msg.body.split() | ||
if args[2] in self.c.sl.config['config']['admins'] and args[4] == '3': | ||
self.c.admins.append(args[0]) | ||
self.c.notice(args[0], "You have been added as an admin.") | ||
else: | ||
self.c.notice(args[0], "You are not an admin.") | ||
|
||
elif msg.command == msg.NICK: | ||
if msg.nick in self.c.admins: | ||
self.c.admins.remove(msg.nick) | ||
self.c.notice(msg.body, "Nickname change detected. Please reauth.") | ||
elif msg.body in self.c.admins: | ||
self.c.admins.remove(msg.body) | ||
self.c.notice(msg.body, "Nickname change detected. Please reauth.") | ||
print self.c.admins | ||
|
||
|
||
|
||
def trigger_auth(self, msg): | ||
"Checks with NickServ, then adds you to admins list." | ||
if msg.nick in self.c.admins: | ||
self.c.notice(msg.nick, "You are already an admin.") | ||
return | ||
self.c.privmsg("NickServ", "ACC %s *"%msg.nick) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters