我正在尝试创建一个 hownoob 命令,我想知道如何让它根据数字的范围说出不同的内容?@client.command()async def hownoob(ctx, member: discord.Member): number = random.randint(1,100) member = member.mention yo = [f'lol yeah, {member} biggest noob here 100% :ok_hand:', f'noobness for {member} off the charts man!!!', f'{member} is a big noob, but their style is a cool noob :wink:'] if number == 1-15: await ctx.send(f'noobness for {member} is {number}% which is not very noob') elif number == 16-49: await ctx.send(f'noobness for {member} is {number}% lol') elif number == 50-77: await ctx.send(f'noobness for {member} is {number}% your half noob lol XD') elif number == 78-89: await ctx.send(f'{member} is {number}%-very much noob :eyes:') elif number == 90-99: await ctx.send(f'noobness for {member} is {number}% very noob!!!!') elif number == 100: await ctx.send(f'noobness for {member} is at max!!!')谢谢!
1 回答
慕盖茨4494581
TA贡献1850条经验 获得超11个赞
尝试这个:
if number in range(16):
await ctx.send(f'noobness for {member} is {number}% which is not very noob')
elif number in range(16,50):
await ctx.send(f'noobness for {member} is {number}% lol')
elif number in range(50,78):
await ctx.send(f'noobness for {member} is {number}% your half noob lol XD')
elif number in range(78,90):
await ctx.send(f'{member} is {number}%-very much noob :eyes:')
elif number in range(90,100):
await ctx.send(f'noobness for {member} is {number}% very noob!!!!')
elif number == 100:
await ctx.send(f'noobness for {member} is at max!!!')
添加回答
举报
0/150
提交
取消