我想在我写在《理性》上的数字上打5%


@client.command()
async def credit(ctx, member: discord.Member, Reason):
await ctx.send(f'**{ctx.message.author.name},, Transfer Fees: $`{Reason}`, Amount : $`{Reason}` type these numbers to confirm :**')
await ctx.send('https://cdn.discordapp.com/attachments/783308936622112789/820678247984398386/unknown.png')
def check(m):
return m.content == '81592'
msg = await client.wait_for('message', check=check)
await member.send(f':atm:  |  Transfer Receiptn```You have received ${Reason} from user {ctx.message.author.name}, (ID: {ctx.message.author.id})nReason: No reason provided```')
await ctx.channel.purge(limit=3)
await ctx.send(f':moneybag: **| {ctx.message.author.name}, has transferred `${Reason}` to** {member.mention} ')

我想要在{原因}中我写#信用@测试10在费用中:{原因*5%}但不起作用我该怎么办?

我不确定,但我认为这应该有效:

Reason_percentage = ""
try:

Reason_percentage += str(int(Reason) *5 / 100)
except TypeError:

await ctx.send("Error: Please type a number")

您必须使用int(WHAT_YOU_WANT_TO_CONVERT)将从消息中取出的字符串转换为整数,并且您可以使用5 / 100将其转换为multiplicate,因为%(可能(是另一个计算选项

最新更新