def dj(phenny, input): """ Ändert das Topic vom NSW Main Channel """ # Check Access if input.sender not in phenny.config.staff_channel: return arg = input.group(2) info = read_nswinfo(phenny.config) msg = "" if not arg: msg = phenny.config.topic_noarg else: msg = phenny.config.topic_warg info["arg"] = arg info["nick"] = input.nick msg %= info # Run for chan in phenny.config.main_channel: phenny.write(['CHANSERV'], "TOPIC %s %s" % (chan, msg)) return
def monitor(phenny, config): time.sleep(25) while True: nsw_info = read_nswinfo(config) if nsw_info["sendung_mod_name"] != phenny.last_modname \ or nsw_info["stream_info"] != phenny.last_streaminfo \ or ((nsw_info["next_sendung_title"] != phenny.last_nextname or nsw_info["next_sendung_when"] != phenny.last_nextwhen) and nsw_info["sendung_mod_name"] in config.myself): phenny.last_modname = nsw_info["sendung_mod_name"] phenny.last_streaminfo = nsw_info["stream_info"] phenny.last_nextwhen = nsw_info["next_sendung_when"] phenny.last_nextname = nsw_info["next_sendung_title"] topic = "" if nsw_info["sendung_mod_name"] in config.myself: topic = config.topic_next else: topic = config.topic_noarg topic %= nsw_info for chan in phenny.config.main_channel: phenny.write(['CHANSERV'], "TOPIC %s %s" % (chan, topic)) time.sleep(20)