Added show function to topic module
This commit is contained in:
parent
b5ade70817
commit
0904e7fec4
1 changed files with 5 additions and 1 deletions
|
@ -8,10 +8,14 @@ class Module(ModuleBase):
|
||||||
ModuleBase.__init__(self, manager)
|
ModuleBase.__init__(self, manager)
|
||||||
|
|
||||||
def commands(self):
|
def commands(self):
|
||||||
return [('!topic <Topic>', 'Fügt einen Text zum Thema des Chatraums hinzu')]
|
return [('!topic [<Topic>]', 'Fügt einen Text zum Thema des Chatraums hinzu oder zeigt das aktuelle Topic an')]
|
||||||
|
|
||||||
def groupchat(self, room, nick, text, handler):
|
def groupchat(self, room, nick, text, handler):
|
||||||
|
if not re.match(r'!topic(?:\W|\Z)', text):
|
||||||
|
return
|
||||||
|
|
||||||
if not re.match(r'!topic\W', text):
|
if not re.match(r'!topic\W', text):
|
||||||
|
handler.reply(handler.get_topic())
|
||||||
return
|
return
|
||||||
|
|
||||||
topic = re.sub(r'!topic\W+', '', text)
|
topic = re.sub(r'!topic\W+', '', text)
|
||||||
|
|
Reference in a new issue