哦,天哪,我来了另一个破坏系统。。。因此,我对discord机器人编码非常陌生,但我有上下的一切,这是一个糟糕的命令。上面说这两条带巨大箭头的线就是罪魁祸首,如果你看到这一点的话,还有阿迪蒂亚·托马尔。是的,我正在做另一个,不,我不知道为什么。。。我输入的命令是?fight,后面跟着15个其他数字
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: TypeError: 'int' object is not callable
是错误的具体原因
###Le epic variables###
WWT = 0
AAS = 0
ASTR = 0
ASPD = 0
DAS = 0
AL = 0
DL = 0
TB = 0
DR = 0
AR = 0
DP = 0
SB = 0
DD = 0
ASK = 0
WC = 0
CC = 0
DoubleAtk = 1
critatk = 1
###Le epic command###
@client.command()
async def fight(ctx, WWT : int, ASTR : int, ASPD : int, DAS : int, AL : int, DL : int, TB : int, DR : int, AR : int, DP : int, SB : int, DD : int, ASK : int, WC : int, CC : int):
global AAS
global critatk
if WWT > ASTR(): <---------------------- this thing
AAS = ASPD - (WWT - ASTR)
else:
AAS = ASPD
global DoubleAtk
if (AAS - DAS) > 4(): <-------------------- and this thing
DoubleAtk = 2
crit_rate = ((WC + ASK) / 2) + SB + CC
def did_crit():
random.randint(1, 100)
DP = TB + DR + SB
Avoid = AAS + (AL / 2) + TB
for i in range(DoubleAtk):
did_crit()
if did_crit == crit_rate():
critatk = 3
damage = (ASTR - DD) * critatk
await ctx.send(damage)
从我所看到的情况来看,我认为在那些if语句中不需要在
ASTR
和4
后面加括号。试试这个:您试图调用一些参数,就好像它们是函数一样,错误基本上是告诉您不能调用参数,例如在
if WWT > ASTR():
或if (AAS - DAS) > 4():
中,您将整数作为函数调用,而函数是不可调用的更正后的代码应如下所示:
注意
did_crit()
实际上需要作为函数调用(因为它是函数),而crit_rate
不需要,因为它是整数相关问题 更多 >
编程相关推荐