【发布时间】:2021-04-25 02:04:57
【问题描述】:
我正在尝试将不和谐机器人更改为在线状态
我一直在使用 pycharm 和终端。我尝试过以多种不同的方式重新排序代码,但这就是我现在所拥有的
import discord
from discord.ext import commands
client = commands.Bot(command_prefix=".")
@client.event
async def on_ready():
print('Bot is ready.')
await client.run(bot token)
我也试过这些:
import discord
from discord.ext import commands
client = commands.Bot(command_prefix=".")
@client.event
async def on_ready():
print('Bot is ready.')
await client.run(bot token)
on_ready
和
import discord
from discord.ext import commands
client = commands.Bot(command_prefix=".")
@client.event
async def on_ready():
print('Bot is ready.')
await client.run(bot token)
on_ready
我收到了这些错误:
:8: RuntimeWarning: coroutine 'on_ready' 从未等待 RuntimeWarning: Enable tracemalloc 获取对象分配回溯
和
SyntaxError: 'await' 外部函数
请帮我让机器人上线
【问题讨论】:
标签: python terminal pycharm discord bots