def privmsg_fn(bot, msg): sender = msg.getName() recipient = msg.params[0] if recipient == bot.nick: bot.say(msg.trail, sender) else: bot.say(msg.trail, recipient)
def say(to, s): if s: if s.startswith('!'): # 다른 봇과 충돌하지 않도록 s = u'!' + s[1:] bot.say(to, s.encode('utf-8'))
def say(s): if s: bot.say(bot.CHANNEL, s.encode('utf-8'))
def say(s): if s: bot.say(bot.CHANNEL, s if isinstance(s, str) else str(s))