Add #quiet and #dequiet

This commit is contained in:
Juhani Krekelä 2019-03-28 08:13:29 +02:00
parent 2893f261a0
commit 625b6dcd61
1 changed files with 11 additions and 1 deletions

View File

@ -456,6 +456,12 @@ def parse((line, irc)):
elif matchcmd(cmdline, '#voice'): elif matchcmd(cmdline, '#voice'):
args = parsecmd(cmdline, '{args}') args = parsecmd(cmdline, '{args}')
chmode(irc, chan, nick, '+v', args.split(' ')) chmode(irc, chan, nick, '+v', args.split(' '))
elif matchcmd(cmdline, '#quiet'):
arg = parsecmd(cmdline, 'nick')
chmode(irc, chan, nick, '+q', [arg + '!*@*'])
elif matchcmd(cmdline, '#dequiet'):
arg = parsecmd(cmdline, 'nick')
chmode(irc, chan, nick, '-q', [arg + '!*@*'])
elif matchcmd(cmdline, '#devoice'): elif matchcmd(cmdline, '#devoice'):
args = parsecmd(cmdline, '{args}') args = parsecmd(cmdline, '{args}')
chmode(irc, chan, nick, '-v', args.split(' ')) chmode(irc, chan, nick, '-v', args.split(' '))
@ -653,6 +659,8 @@ def usage(cmd, message = True):
'#deop': '[nick]', '#deop': '[nick]',
'#voice': '[nick]', '#voice': '[nick]',
'#devoice': '[nick]', '#devoice': '[nick]',
'#quiet': 'nick',
'#dequiet': 'nick',
'#kick': 'nick [reason]', '#kick': 'nick [reason]',
'#src': '', '#src': '',
'#msg': 'nick message', '#msg': 'nick message',
@ -677,6 +685,8 @@ def help(cmd):
'#deop': 'remove your/nick\'s op rights', '#deop': 'remove your/nick\'s op rights',
'#voice': 'give nick or yourself voice in case you are trusted by oonbotti2 and identified with NickServ', '#voice': 'give nick or yourself voice in case you are trusted by oonbotti2 and identified with NickServ',
'#devoice': 'remove your or nick\'s voice in case you are trusted by oonbotti2 and identified with NickServ', '#devoice': 'remove your or nick\'s voice in case you are trusted by oonbotti2 and identified with NickServ',
'#quiet': 'give +q to nick!*@*',
'#dequiet': 'remove +q from nick!*@*',
'#kick': 'kicks nick with specified reason', '#kick': 'kicks nick with specified reason',
'#src': 'paste a link to oonbotti2\'s git repo', '#src': 'paste a link to oonbotti2\'s git repo',
'#msg': 'send a message to nick', '#msg': 'send a message to nick',
@ -688,7 +698,7 @@ def help(cmd):
'#help': 'give short info of command or list commands'} '#help': 'give short info of command or list commands'}
if cmd=='': if cmd=='':
return '#echo #op #deop #voice #devoice #kick #src #msg #trusted? #trust #untrust #ls-trusted #chan #help' return '#echo #op #deop #voice #devoice #quiet #dequiet #kick #src #msg #trusted? #trust #untrust #ls-trusted #chan #help'
elif cmd=='me': elif cmd=='me':
return 'I shall.' return 'I shall.'
elif cmd in helptext: elif cmd in helptext: