def send_whisper_result(data): nick, msg = sent_whispers.popleft() if data.code == 0: m = "[-> {}] {}".format(nick, pp(msg)) debuglog.info(m) else: debuglog.warning("[error] {} is offline.".format(nick))
def send_whisper_result(data): now = time.time() while True: try: nick, msg, ts = sent_whispers.popleft() except IndexError: return if now - ts < 1.0: break if data.code == 0: m = "[-> {}] {}".format(nick, pp(msg, pp_actions)) debuglog.info(m) else: debuglog.warning("[error] {} is offline.".format(nick))
def got_whisper(data): nick, message = data.nick, data.message message = pp(message, pp_actions) m = "[{} ->] {}".format(nick, message) debuglog.info(m) if badge.is_afk: if nick in chat_bots: return if message.startswith('!'): return now = time.time() global afk_ts if now > afk_ts + 20: afk_ts = now send_whisper(nick, afk_message) badge.is_afk = True
def party_chat(data): nick = mapserv.party_members.get(data.id, str(data.id)) message = pp(data.message) m = "[Party] {} : {}".format(nick, message) debuglog.info(m)
def got_whisper(data): nick, message = data.nick, data.message message = pp(message) m = "[{} ->] {}".format(nick, message) debuglog.info(m)
def player_chat(data): message = pp(data.message) debuglog.info(message)
def being_chat(data): message = pp(data.message) debuglog.info(message)
def player_chat(data): message = pp(data.message, pp_actions) debuglog.info(message)
def being_chat(data): message = pp(data.message, pp_actions) debuglog.info(message)