Skip to content

Commit 7da2fba

Browse files
committed
Restrict certain commands to chanop only and allow chanops access to other restricted commands
1 parent 121ff05 commit 7da2fba

3 files changed

Lines changed: 7 additions & 7 deletions

File tree

plugins/duckhunt.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ def incrementMsgCounter(event, conn):
8181
if event.host not in game_status[conn.name][event.chan]['masks']:
8282
game_status[conn.name][event.chan]['masks'].append(event.host)
8383

84-
@hook.command("starthunt", autohelp=False)
84+
@hook.command("starthunt", autohelp=False, permissions=["chanop"])
8585
def start_hunt(bot, chan, message, conn):
8686
"""This command starts a duckhunt in your channel, to stop the hunt use .stophunt"""
8787
global game_status
@@ -107,7 +107,7 @@ def set_ducktime(chan, conn):
107107
game_status[conn.name][chan]['masks'] = []
108108
return
109109

110-
@hook.command("stophunt", autohelp=False)
110+
@hook.command("stophunt", autohelp=False, permissions=["chanop"])
111111
def stop_hunt(chan, conn):
112112
"""This command stops the duck hunt in your channel. Scores will be preserved"""
113113
global game_status
@@ -119,7 +119,7 @@ def stop_hunt(chan, conn):
119119
else:
120120
return "There is no game running in {}.".format(chan)
121121

122-
@hook.command("duckkick")
122+
@hook.command("duckkick", permissions=["chanop"])
123123
def no_duck_kick(text, chan, conn, notice):
124124
"""If the bot has OP or half-op in the channel you can specify .duckkick enable|disable so that people are kicked for shooting or befriending a non-existent goose. Default is off."""
125125
global game_status

plugins/factoids.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ def del_factoid(db, chan, word):
7474
load_cache(db)
7575

7676

77-
@hook.command("r","remember", permissions=["op"])
77+
@hook.command("r","remember", permissions=["op", "chanop"])
7878
def remember(text, nick, db, chan, notice):
7979
"""<word> [+]<data> - remembers <data> with <word> - add + to <data> to append. If the input starts with <act> the message will be sent as an action. If <user> in in the message it will be replaced by input arguments when command is called."""
8080
global factoid_cache
@@ -107,7 +107,7 @@ def remember(text, nick, db, chan, notice):
107107
add_factoid(db, word, chan, data, nick)
108108

109109

110-
@hook.command("f","forget", permissions=["op"])
110+
@hook.command("f","forget", permissions=["op", "chanop"])
111111
def forget(text, chan, db, notice):
112112
"""<word> - forgets previously remembered <word>"""
113113
global factoid_cache

plugins/ignore.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ def ignore_sieve(bot, event, _hook):
9292
return event
9393

9494

95-
@hook.command(permissions=["ignore"])
95+
@hook.command(permissions=["ignore", "chanop"])
9696
def ignore(text, db, chan, conn, notice, message, nick):
9797
"""<nick|mask> -- ignores all input from <nick|mask> in this channel."""
9898
target = text.lower()
@@ -108,7 +108,7 @@ def ignore(text, db, chan, conn, notice, message, nick):
108108
add_ignore(db, conn.name, chan, target)
109109

110110

111-
@hook.command(permissions=["ignore"])
111+
@hook.command(permissions=["ignore", "chanop"])
112112
def unignore(text, db, chan, conn, notice, nick, message):
113113
"""<nick|mask> -- un-ignores all input from <nick|mask> in this channel."""
114114
target = text.lower()

0 commit comments

Comments
 (0)