Google api @导致命令不响应的bot.event

Google api @导致命令不响应的bot.event,google-api,discord,discord.py,google-api-python-client,Google Api,Discord,Discord.py,Google Api Python Client,我最近添加了一个来自google api serve=ive的代码,这导致我的整个脚本除了事件之外没有重新发送: @bot.event async def on_message(msg): analyze_request = {'comment': { 'text': msg.content }, 'requestedAttributes': {'TOXICITY': {}}} response = service.comments().analyze(body=

我最近添加了一个来自google api serve=ive的代码,这导致我的整个脚本除了事件之外没有重新发送:

@bot.event
async def on_message(msg):
        analyze_request = {'comment': { 'text': msg.content }, 'requestedAttributes': {'TOXICITY': {}}}
        response = service.comments().analyze(body=analyze_request).execute()
        spanScore = response['attributeScores']['TOXICITY']['spanScores']
        value = spanScore[0]['score']['value']
        print(value * 100)
        toxicity = value * 100
        if toxicity > 95:
            await msg.author.kick(reason = "Toxic messages")
            await msg.author.send('You were kicked because you sent toxic message(s)')
            await msg.send(f"{msg.author}, has been kicked for being toxic !")
        elif toxicity > 70 and toxicity < 94:
            await msg.channel.send(f"{msg.author.mention}, please watch your language")
@bot.event
异步def on_消息(消息):
analyze_request={'comment':{'text':msg.content},'requestedAttributes':{'viousity':{}
response=service.comments().analyze(body=analyze\u请求).execute()
spanScore=反应['attributeScores']['毒性]['spanScores']
value=spanScore[0]['score']['value']
打印(值*100)
毒性=值*100
如果毒性>95:
等待消息.author.kick(reason=“有毒消息”)
wait msg.author.send('您被踢了,因为您发送了有毒消息')
wait msg.send(f“{msg.author},因有毒而被踢了一脚!”)
elif毒性>70和毒性<94:
等待msg.channel.send(f“{msg.author.ention},请注意您的语言”)

感谢您提供更多信息

如果您需要处理这些命令,请在您的
on_消息
事件末尾添加以下内容:

await bot.process_commands(message)

有关此主题的更多信息,请参见

您需要处理这些命令,请在您的
on_消息
事件末尾添加以下内容:

await bot.process_commands(message)
有关此主题的更多信息,请访问