小编Séb*_*ien的帖子

在 on_ready 中发送消息?Python不和谐机器人

我希望我的机器人在 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)

python bots python-asyncio discord

4
推荐指数
1
解决办法
2万
查看次数

标签 统计

bots ×1

discord ×1

python ×1

python-asyncio ×1