【发布时间】:2020-07-08 19:08:54
【问题描述】:
一开始它有效,但不知何故它开始一次给出 4-5 次答案,知道为什么吗?
import discord
from discord.ext import commands
client = commands.Bot(command_prefix = '.')
@client.event
async def once_ready():
print('Bot is ready.')
@client.event
async def on_member_join(member):
print(f'{member} has joined the server.')
@client.event
async def on_member_remove(member):
print(f'{member} has left the server.')
@client.command()
async def ping(ctx):
await ctx.send('Pong!')
client.run('my token here')
【问题讨论】:
-
我也尝试在我的服务器上重置机器人,但没有帮助。
-
这能回答你的问题吗? stackoverflow.com/questions/60750793/…
-
您好,感谢您的帮助。我确实有完全相同的问题,但我用 Atom 编写它,我看不到任何关闭已经运行的实例
-
遗憾的是,我对 Atom 的了解还不够,无法帮助您解决这个问题。您最好的选择可能是在“原子”标签中询问。
-
是的,我也尝试过 Reddit,但可能我只是要转移到另一个编译器,因为我和其他人不知道如何“修复”这个问题。 :C 谢谢你的帮助 :)
标签: python discord discord.py