如何让机器人提及该成员然后给一个带有消息的随机数然后发送消息

问题描述

@client.command()  
async def rategay(ctx):  
    await ctx.send(random.randint(1,100))  

我希望机器人先提到用户名,然后说随机数,然后说同性恋百分比。

解决方法

试试这个:

@client.command()  
async def rategay(ctx):  
    number = random.randint(1,100)
    await ctx.send(f'{ctx.author.mention} {number}% gay')