Python 正在创建discord聊天机器人并遇到此语法错误

Python 正在创建discord聊天机器人并遇到此语法错误,python,discord,discord.py,python-3.7,Python,Discord,Discord.py,Python 3.7,这是我目前的问题。我通常不会要求自己去解决这个问题,但是我的开发伙伴周末都不在了,我无法解决这个问题 def acceptBattle(ctx,discord.Member,author.selectedPokemon,discord.Member.selectedPokemon): battleacc=input(bot.say(discord.Member +" "+ author +" has challenged you to a battle! Do you acce

这是我目前的问题。我通常不会要求自己去解决这个问题,但是我的开发伙伴周末都不在了,我无法解决这个问题

 def acceptBattle(ctx,discord.Member,author.selectedPokemon,discord.Member.selectedPokemon):
        battleacc=input(bot.say(discord.Member +" "+ author +" has challenged you to a battle! Do you accept?"))
        conn = sqlite3.connect('BOT.db')
        c = conn.cursor()
        part=c.execute("SELECT poke FROM Party WHERE id=="+author)
        pokemonteam1=part
        part2=c.execute("SELECT poke FROM Party WHERE id=="+discord.Member)
        pokemon2team=part2
        if(battleacc=='yes'or'y' or 'yeah'):
问题在第一部分:“acceptBattle(ctx,discord.Member…”

特别是不和谐的时期

有什么想法吗?谢谢你的帮助

def CPokes(ctx,pokemon,message):
        caught=false
        run_away=false
        t=timer(3600,ifcaught)
        while  t>0:
                if run_away==false:
                        run=rand.randint(0,8)
                        if run==0:
                                run_away=true
                                break
                        else:
                                if message.contains('catch'):   
                                        msg=message.split
                                        conn = sqlite3.connect('blazidb.db')
                                        c = conn.cursor()
                                        pokename=c.execute("SELECT Identifier FROM Pokes WHERE numb==pokemon").fetchall()
                                        c.close()
                                        if pokename==msg[2]:
                                                caught=true
                                                randomstatsandNatures(pokemon)
                                                conn = sqlite3.connect('blazidb.db')

                                                break
                                        else:
                                                caught=false
    def Spawn(Pokes):
        spawned=rand.randint(1,807)
        conn = sqlite3.connect('blazidb.db')
        c = conn.cursor()
        spn=c.execute("SELECT `Img AND Identifier FROM poke WHERE numb==spawned").fetchall()

        conn.close()
        bot.say("A Wild Pokemon Appeared!")
        CPokes(ctx,spn[1])
    def ifcaught():
        run_away=true
    def acceptBattle(ctx,discord.Member,author.selectedPokemon,discord.Member.selectedPokemon):
        battleacc=input(bot.say(discord.Member +" "+ author +" has challenged you to a battle! Do you accept?"))
        conn = sqlite3.connect('blazidb.db')
        c = conn.cursor()
        part=c.execute("SELECT poke FROM Party WHERE id=="+author)
        pokemonteam1=part
        part2=c.execute("SELECT poke FROM Party WHERE id=="+discord.Member)
        pokemon2team=part2
        if(battleacc=='yes'or'y' or 'yeah'):
                poke1=author.selectedPokemon
                poke2=discord.Member.selectedPokemon
                BattlePokes(ctx,poke1,poke2,discord.Member,author)
                """BattlePokes(ctx,pokemonteam1,discord.Member,author,pokemonteam2)"""
        else:

您在定义中指定的参数必须是有效的标识符。然后,它们被用作函数中传递值的变量名。您到底想在这里做什么?这里有一个更大的部分……它是一个口袋妖怪机器人。这就是“繁殖”和“战斗”这是新口袋妖怪诞生的一部分,如果你试图抓住一个,就会发生战斗。我的开发伙伴写了代码,但不幸的是,他在飞往印度的飞机上待了24小时,所以我想给他一个惊喜,并从他身上卸下一些错误修复的负担。我只是修复语法和缩进问题……然后遇到了这个问题,这让meAs Patr难堪ick已经提到,参数应该是有效的标识符。
discord.Member
可能不是一个。用类似于
Member
的东西替换它(以及其他出现的情况),然后您可以使用它。(然后您还可以扔掉
discord.Member.selectedPokemon
参数…)您在定义中指定的参数必须是有效的标识符。然后,它们被用作函数中传递值的变量名。您到底想在这里做什么?这里有一个更大的部分……它是一个口袋妖怪机器人。这就是“繁殖”和“战斗”这是新口袋妖怪诞生的一部分,如果你试图抓住一个,就会发生战斗。我的开发伙伴写了代码,但不幸的是,他在飞往印度的飞机上待了24小时,所以我想给他一个惊喜,并从他身上卸下一些错误修复的负担。我只是修复语法和缩进问题……然后遇到了这个问题,这让meAs Patr难堪ick已经提到,参数应该是有效的标识符。
discord.Member
可能不是一个。用类似于
Member
的东西替换它(以及其他出现的情况),然后您可以使用它。(然后您还可以扔掉
discord.Member.selectedPokemon
参数…)