From a629ca3cd6462a3690aae7ca124ac5561d15b824 Mon Sep 17 00:00:00 2001 From: Juhani Haverinen Date: Sat, 24 Aug 2013 23:37:45 +0300 Subject: [PATCH] Added command for testing if you can execute admin commands --- .gitignore | 1 + botcmd.py | 7 ++++++- ircbot.py | 0 3 files changed, 7 insertions(+), 1 deletion(-) mode change 100644 => 100755 ircbot.py diff --git a/.gitignore b/.gitignore index af481ac..31b7cb3 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ msgs.txt trusted.txt startcmd.txt *.pyc +ircbot.sh diff --git a/botcmd.py b/botcmd.py index bab91bc..218bbb7 100644 --- a/botcmd.py +++ b/botcmd.py @@ -94,6 +94,9 @@ def parse((line,irc)): else: irc.send('PRIVMSG %s :You have no unread messages'%chan) msglock.release() + elif line[3]==':#trusted?': + addauthcmd(nick,'PRIVMSG %s :%s: You are trusted'%(chan,nick)) + irc.send('PRIVMSG NickServ :ACC '+nick) elif line[3]==':#help': irc.send('PRIVMSG %s :%s'%(chan,help(' '.join(line[4:])))) elif line[3]==':#esoteric' and chan=='#esoteric': @@ -147,7 +150,7 @@ def execcmd(cmdline): def help(cmd): if cmd=='': - return '#echo #op #deop #voice #devoice #kick #src #msg #readmsg #help' + return '#echo #op #deop #voice #devoice #kick #src #msg #readmsg #trusted? #help' elif cmd=='#echo': return '#echo text echo text back' elif cmd=='#op': @@ -166,6 +169,8 @@ def help(cmd): return '#msg nick message send a message to nick. messages can be read with #readmsg' elif cmd=='#readmsg': return '#readmsg read messages you have received' + elif cmd=='#trusted?': + return '#trusted? tell you if you are trusted by oonbotti' elif cmd=='#help': return '#help [command] give short info of command or list commands' else: diff --git a/ircbot.py b/ircbot.py old mode 100644 new mode 100755