I am trying to write a bot for Discord but I keep getting an error message:
File "bot.py", line 33 await member.create_dm() ^ SyntaxError: 'await' outside async function
I am trying to get the bot to send a DM to a person who has just joined the server.
@client.event
@asyncio.coroutine
def on_member_join(member):
await member.create_dm()
member.dm_channel.send("Hi and welcome!")
I would very much appreciate your help.
async def...