mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-26 20:59:27 +01:00
Add refresh command
This commit is contained in:
parent
13c2bd3fcc
commit
d35e67046b
@ -522,6 +522,23 @@ class Topic(callbacks.Plugin):
|
||||
self._sendTopics(irc, channel, topics)
|
||||
restore = wrap(restore, ['canChangeTopic'])
|
||||
|
||||
@internationalizeDocstring
|
||||
def refresh(self, irc, msg, args, channel):
|
||||
"""[<channel>]
|
||||
Refreshes current topic set by anyone. Restores topic if empty.
|
||||
<channel> is only necessary if the message isn't sent in the channel
|
||||
itself.
|
||||
"""
|
||||
if not self._checkManageCapabilities(irc, msg, channel):
|
||||
capabilities = self.registryValue('requireManageCapability')
|
||||
irc.errorNoCapability(capabilities, raise=True)
|
||||
topic = irc.state.channels[channel].topic
|
||||
if topic:
|
||||
self._sendTopics(irc, channel, topic)
|
||||
else:
|
||||
self.restore(self, irc, msg, args, channel)
|
||||
set = wrap(refresh, ['canChangeTopic'])
|
||||
|
||||
@internationalizeDocstring
|
||||
def undo(self, irc, msg, args, channel):
|
||||
"""[<channel>]
|
||||
|
Loading…
Reference in New Issue
Block a user