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

时间:2021-02-09 07:26:16

标签: python random discord percentage mention

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

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

1 个答案:

答案 0 :(得分:1)

试试这个:

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