import host
Noms = "Name"
def init():
host.registerHandler('ChatReceivedExtended', onTalk) # extended to distinguish between local chat and whispers
def deinit():
host.unregisterHandler('ChatReceivedExtended', onTalk)
def onTalk(bnet, user, message, isWhisper, payload):
if isWhisper and user.getName() == Noms:
bnet.queueChatCommand("/me " + message)
bnet.queueChatCommand("/f m " + message)
当我尝试运行它给我的脚本时"TypeError: OneTalk() takes exactly 5 arguments (4 given)"
。但是当我将用户名添加到第 11 行时,它给了我"TypeError: OneTalk() takes exactly 5 arguments (6 given)'
.
def onTalk(bnet, user, message, isWhisper, payload):
def onTalk(bnet, user, message, isWhisper, payload, username):