我正在从头开始构建一个不和谐的机器人,并且我只在我的计算机上托管这个机器人。不是在Heroku或任何其他服务上。当我在我的不一致测试通道中输入;help时,机器人将对一个实例重复响应大约6-8次。它会一次转储4个,然后再转储3个,然后在大约4秒的间隔内再转储一个。
import json
import discord
from discord.ext import commands
TOKEN = # My token
client = commands.Bot(command_prefix = ";")
@client.command(pass_context=True)
async def readycheck(ctx):
await ctx.send("Bot is ready cap'n!")
@client.command(pass_context=True)
async def groot(ctx):
await ctx.send("I am GAY!")
@client.command(pass_context=True)
async def ping(ctx):
await ctx.send("Pong!")
@client.command(pass_context=True)
async def info(ctx):
await ctx.send("Welcome to the Testbot0124 designed by loving people")
client.run(TOKEN)发布于 2020-12-15 04:52:55
我想添加一个解决方案,以防其他人遇到同样的问题。我没有使用文本编辑器运行我的脚本,而是开始使用terminal by cd /进入路径目录,并使用python3 main.py运行我的文件。我不再有多个机器人实例同时运行。
https://stackoverflow.com/questions/63607309
复制相似问题