Skip to content

Commit

Permalink
adminchannel: allow non-op .topic in -t channels
Browse files Browse the repository at this point in the history
Depends on sopel-irc#1980. Fixes sopel-irc#1842.
  • Loading branch information
half-duplex committed Nov 1, 2020
1 parent 827661b commit 06ee592
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions sopel/modules/adminchannel.py
Original file line number Diff line number Diff line change
Expand Up @@ -308,16 +308,19 @@ def kickban(bot, trigger):


@plugin.require_chanmsg
@plugin.require_privilege(plugin.OP, ERROR_MESSAGE_NO_PRIV)
@plugin.command('topic')
def topic(bot, trigger):
"""Change the channel topic
The bot must be a channel operator for this command to work.
The bot must be a channel operator for this command to work in +t channels.
"""
if bot.channels[trigger.sender].privileges[bot.nick] < plugin.HALFOP:
mode_t = bot.channels[trigger.sender].modes.get("t", False)
if mode_t and bot.channels[trigger.sender].privileges[bot.nick] < plugin.HALFOP:
bot.reply(ERROR_MESSAGE_NOT_OP)
return
if mode_t and bot.channels[trigger.sender].privileges[trigger.nick] < plugin.HALFOP:
bot.reply(ERROR_MESSAGE_NO_PRIV)
return
if not trigger.group(2):
return
channel = trigger.sender.lower()
Expand Down

0 comments on commit 06ee592

Please sign in to comment.