不和谐的功能,如果不和谐的机器人声明

时间:2020-05-04 04:35:16

标签: python api discord discord.py

我目前正在尝试创建一个不和谐的机器人来为一群朋友提供琐事帮助。我使用的是python,当我尝试使用打印语句进行调试时,我注意到该函数不会进入或超出下面代码中的if语句:

问题在checkPointAvailable之内。我对python不太熟悉(只修过1个1学分的课程),并且对discord.py和API非常不熟悉,很想知道我的问题可能是什么。谢谢!

@bot.command(name='answer')
async def answer(ctx, points:int, *args):
    if(globalSubmission == 0):
        await ctx.send(f'Submissions are not currently open!')
        return
    error = checkPointAvailable(ctx, points)
    answer = " ".join(args[:])
    name = findPlayer(ctx.author.id)
    correct = checkAnswer(globalCorrectAnswer, answer)
    addAnswer(globalDate, globalRound, globalQuestionNO, name, answer, points, correct)
    await ctx.send(f'Submitted "{answer}" for {points} points for Round {globalRound}, Question {globalQuestionNO}')


def checkPointAvailable(ctx, points):
    name = findPlayer(ctx.author.id)
    print(globalRound)
    if((globalRound < 4) and (globalRound > 0)):
        print('In first if')
        if(points != 2 or points != 4 or points != 6):
            print('In second if')
            #ctx.send(f'Inelligible point value, please use 2, 4, or 6 points.')
            return 0
    print('post if statements')

0 个答案:

没有答案