我希望我的机器人能够说出一条消息,提及一个用户,然后用一条随机消息响应,所有这些都在同一行中,而不是在 3 个单独的行中。
这是我以前的方法:
if msg.startswith('respond')
await message.channel.send('alright then,')
await message.channel.send(message.author.mention)
await message.channel.send(random.choice(responses))
Run Code Online (Sandbox Code Playgroud)
但是,这使它们都出现在同一行中,但我不知道如何将它们合并为一条单行。这是我多次失败的尝试之一:
if msg.startswith('respond'):
await message.channel.send ('alright then, <message.author.mention> <random.choice(responses)>')
Run Code Online (Sandbox Code Playgroud)
(请不要取笑我的业余编码技巧lmao)