大家好,我在pycharm上用discord.py重写做了一个机器人,但有一次我的一个齿轮出现了错误,但控制台没有显示任何错误,也没有发送任何消息,所以我不得不搜索很多关于这个错误的信息。我想知道为什么会这样。
我的机器人的主要代码是:
import discord
from discord.ext import commands
client = commands.Bot(command_prefix="your prefix")
client.load_extension("extension name")
@client.event
async def on_ready():
print("bot is ready")
client.run('your token发布于 2020-08-05 01:33:31
我不知道为什么它没有,但谷歌肯定会有帮助!
您忘记了在client.run结束字符串,所以下面是正确的代码。
import discord
from discord.ext import commands
client = commands.Bot(command_prefix="your prefix")
client.load_extension("extension name")
@client.event
async def on_ready():
print("bot is ready")
client.run('your token')https://stackoverflow.com/questions/63239421
复制相似问题