我昨天开始使用Python及其第一次编程。我正在制作一个不和谐的bot,但是它有些问题,当我编辑我的文本(该bot将响应)时,它会记住我以前的文本,并且会同时对这两个文本进行响应。
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 = "!")
@client.event
#this shows if the bot is working#
async def on_ready():
print("Bot is online and ready!")
@client.event
async def on_message(message):
#makes sure it doesnt reply on itself
if message.author == client.user:
return
@client.event
async def on_message(message):
if message.content.upper().startswith('!FIND'):
userID = message.author.id
await client.send_message(message.channel, "<@{}>
Wants to play this deadgame with @stekkers!".format(userID))
client.run("token")