Python和qqbot库开发简单的机器人
from qqbot import QQBotSlot as qqbotslot, RunBot @qqbotslot def onQQMessage(bot, contact, member, content): if content == '-hello': bot.SendTo(contact, '你好,我是QQ机器人') elif content == '在': bot.SendTo(contact, '我一直在呢,嘻嘻') elif content == '-stop': bot.SendTo(contact, 'QQ机器人已关闭') bot.Stop() if __name__ == '__main__': RunBot()