我希望我的机器人在 on_ready 事件中上线时发送一条消息。该行在 (on_message) 中工作,但我无法使其在 (on_ready) 中发送某些内容
@client.event
async def on_ready():
print('We have logged in as {0.user}'.format(client))
await message.channel.send('The bot is online ')
Run Code Online (Sandbox Code Playgroud)