【发布时间】:2018-05-06 23:48:15
【问题描述】:
我想制作一个机器人,它可以说出您输入的内容,如下所示:
@client.event
async def on_ready():
print("Ready when you are")
while True:
bop = input("")
await client.say(bop)
我已经尝试过很多方法,但我无法让它工作,我在网上找不到任何东西。非常感谢您的帮助!
【问题讨论】:
-
您将注册一个
on_message协程,每当机器人观察到消息时就会调用该协程。 See this example bot from thediscord.pygithub 一旦你对这个库更熟悉了,你可能需要考虑使用命令扩展,这取决于你想让你的机器人做什么。
标签: python-3.x discord.py