示例#1
0
文件: echo_bot.py 项目: aosdict/knob2
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)
示例#2
0
def say(to, s):
    if s:
        if s.startswith('!'): # 다른 봇과 충돌하지 않도록
            s = u'!' + s[1:]
        bot.say(to, s.encode('utf-8'))
示例#3
0
文件: botimpl.py 项目: calvin/mcbot
def say(s):
    if s: bot.say(bot.CHANNEL, s.encode('utf-8'))
示例#4
0
def say(s):
    if s: bot.say(bot.CHANNEL, s if isinstance(s, str) else str(s))
示例#5
0
文件: botimpl.py 项目: namongk/mcbot
def say(s):
    if s: bot.say(bot.CHANNEL, s if isinstance(s, str) else str(s))