def cmd_cleartopic(serverTab, channelTab, args): """ Clears the topic. Usage: /cleartopic """ if not channelTab or not channelTab.is_channel(): return gui.mgmt.myPrint("No channel is active") sushi.topic(serverTab.name, channelTab.name, "")
def cmd_topic(serverTab, channelTab, args): """ Sets the topic in the current channel. If no argument is given, print the current topic. Usage: /topic [<text>] """ if not channelTab or not channelTab.is_channel(): return gui.mgmt.myPrint("No channel active.") if not args: return gui.mgmt.myPrint( "Topic for channel %(channel)s: '%(topic)s'" % { "channel": channelTab.name, "topic": color.parse_color_codes_to_tags(channelTab.topic) }, html=True) else: topic = " ".join(args) sushi.topic(serverTab.name, channelTab.name, topic)