【发布时间】:2018-10-08 21:17:49
【问题描述】:
我之前曾在同一个机器人上发过帖子,感谢回复的人,它可以正常工作。但是,当它终于活过来并打开时,它开始无缘无故地发送垃圾邮件。我查看了代码中的拼写错误,但找不到任何错误。 代码如下:
import discord
from discord.ext.commands import bot
from discord.ext import commands
import asyncio
import time
Client = discord.Client()
client = commands.Bot (command_prefix = discord)
@client.event
async def on_ready() :
print("Bepis machine fixed")
@client.event
async def on_message(message) :
if message.content == "bepis" :
await client.send_message (message.channel, "bepis")
client.run("Censored Bot Token")
@client.event 之后是我需要帮助的地方。如果这次还好,也是底线!原来我在括号之前按了空格键,但它不喜欢那样。非常感谢您的帮助,因此我可以继续添加到这个很棒的机器人。
【问题讨论】:
-
我猜你发送的消息会触发另一个事件,然后导致再次发送消息。
标签: python bots discord spam-prevention