i m using python 3.7 and i can´t importestoy intentando hacer un bot de discord in this projecty me falla el import de la primera línea no sé por qué.
import discord
from discord.ext import commands
from discord.ext.commands import Bot
Cliente = discord.Client()
cliente = commands.Bot("!")
#Ping al bot
@discord.client.event
async def on_message(message):
if message.content.startswith('!Hi'):
await discord.client.send_message(message)
pass
cliente.run('NTA3Njc5Nzc2OTc1MzU1OTI3.Dr2rZA.Kt5qjj7kBKundrrjDy8pGP_Tsmg')
Then i got the followingY me da este error:
/usr/bin/python3 /home/mario/PycharmProjects/Bot/Main.py
Traceback (most recent call last):
File "/home/mario/PycharmProjects/Bot/Main.py", line 1, in <module>
import discord
File "/usr/lib/python3.7/site-packages/discord/__init__.py", line 20, in <module>
from .client import Client, AppInfo, ChannelPermissions
File "/usr/lib/python3.7/site-packages/discord/client.py", line 38, in <module>
from .state import ConnectionState
File "/usr/lib/python3.7/site-packages/discord/state.py", line 36, in <module>
from . import utils, compat
File "/usr/lib/python3.7/site-packages/discord/compat.py", line 32
create_task = asyncio.async
^
SyntaxError: invalid syntax
Thanks for the help :DHe leido que a veces pasando a la version anterior de python se solucionaba, lo he hecho y no me ha funcionado. Gracias por la ayuda