mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-07 19:49:23 +01:00
Changed topicUnformatter regexp slightly and fixed shuffletopic so it wouldn't send a repeat topic.
This commit is contained in:
parent
e1e2605c45
commit
2e4c9439b9
@ -67,7 +67,7 @@ example = utils.wrapLines("""
|
|||||||
class Topic(callbacks.Privmsg):
|
class Topic(callbacks.Privmsg):
|
||||||
topicSeparator = ' || '
|
topicSeparator = ' || '
|
||||||
topicFormatter = '%s (%s)'
|
topicFormatter = '%s (%s)'
|
||||||
topicUnformatter = re.compile('(.*) \((.*)\)')
|
topicUnformatter = re.compile('(.*) \((\S+)\)')
|
||||||
def addtopic(self, irc, msg, args):
|
def addtopic(self, irc, msg, args):
|
||||||
"""[<channel>] <topic>
|
"""[<channel>] <topic>
|
||||||
|
|
||||||
@ -106,6 +106,8 @@ class Topic(callbacks.Privmsg):
|
|||||||
channel = privmsgs.getChannel(msg, args)
|
channel = privmsgs.getChannel(msg, args)
|
||||||
capability = ircdb.makeChannelCapability(channel, 'topic')
|
capability = ircdb.makeChannelCapability(channel, 'topic')
|
||||||
if ircdb.checkCapability(msg.prefix, capability):
|
if ircdb.checkCapability(msg.prefix, capability):
|
||||||
|
newtopic = irc.state.getTopic(channel)
|
||||||
|
while newtopic = irc.state.getTopic(channel):
|
||||||
topics = irc.state.getTopic(channel).split(self.topicSeparator)
|
topics = irc.state.getTopic(channel).split(self.topicSeparator)
|
||||||
random.shuffle(topics)
|
random.shuffle(topics)
|
||||||
newtopic = self.topicSeparator.join(topics)
|
newtopic = self.topicSeparator.join(topics)
|
||||||
|
Loading…
Reference in New Issue
Block a user