В настоящее время я пытаюсь создать бот-диск, чтобы помочь с мелочами для группы друзей. Я использую python, и когда я пытаюсь отладить операторы print, я замечаю, что функция не go вводит или пропускает операторы if в приведенном ниже коде:
Проблема в checkPointAvailable. Я не очень знаком с python (взял только один 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')