python3中不匹配的')'

问题描述 投票:-2回答:1
import discord

client = discord.Client()

@client.event
async def on_ready():
    print('We have logged in as {0.user}').format('client'))


@client.event
async def on_message():
    if message.author == client.user:
        return

    if message.content.startswith('$shakopee pls'):
        await message.channel.send('Heres the weather in shakopee:https://darksky.net/forecast/44.779,-93.4763/us12/en')

client.run("NjM1OTg4NTM5Njk1MzAwNjEx.Xa5LOw.O61ftiaJDlEBgGBuvcoGeekBozk")

token = read_token()

[我一直都无法匹配')'(第7行)pylint(语法错误)[7,61],由于我对python还是很陌生,所以我不确定如何解决它]

import discord client = discord.Client()@ client.event异步定义on_ready():print('我们已经以{0.user}登录').format('client'))@ client.event异步定义on_message():如果message.author ...

python python-3.x syntax syntax-error
1个回答
0
投票

打印语句的括号应包含format方法。在这条线上,您有2个左括号和3个右括号。那应该涵盖确切的错误。当然可以更多。

© www.soinside.com 2019 - 2024. All rights reserved.