首页 > 解决方案 > 为什么 repl.it 说“unindent 不匹配任何其他缩进级别”?我正在尝试制作一个不和谐的机器人

问题描述

if x == 10: 
    if message.content.startswith('$train'):
      await message.channel.send('You pack your opponent a menacing punch and he falls to the ground! come back later for round 2!')
      @commands.cooldown(1, 5000, commands.BucketType.user)

标签: python

解决方案


因为我们没有关于您的项目的足够信息。所以我只能修复你的代码的缩进。第二个if语句之后的行仅缩进两个空格,而不是 4 个空格。

if x == 10: 
    if message.content.startswith('$train'):
        await message.channel.send('You pack your opponent a menacing punch and he falls to the ground! come back later for round 2!')
        @commands.cooldown(1, 5000, commands.BucketType.user)

推荐阅读