Ask coding questions

← Back to all posts
Invalid Syntax
BLA4KM4MBA

Hey there, so i wanna host my discord.py bot on repl but when i run it it give a syntax error i have imported all the packages Error:
Traceback (most recent call last):
File "main.py", line 1, in <module>
import discord
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/init.py", line 25, in <module>
from .client import Client
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/client.py", line 27, in <module>
import asyncio
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/asyncio/init.py", line 21, in <module>
from .base_events import *
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/asyncio/base_events.py", line 296
future = tasks.async(future, loop=self)
^
SyntaxError: invalid syntax
 Can somebody help me with this? TIA!

Voters
BLA4KM4MBA
Comments
hotnewtop
IVIicrosoftEdge

I was getting this problem too, and just figured out it might be the asyncio package. Go to your packages and delete asyncio, but otherwise leave your code alone and it should work.

YuvanVighnesh

Instead of
await client.send_message`` use await client.send`

Axrevyn

Try deleting the packager files and reinstalling?