title: How do you get rid of "SyntaxError: 'await' outside function"
body: <p>I am trying to make a discord bot change to online status</p>
  <p>I have been using pycharm and terminal. I have tried reordering the code multiple different ways, but here is what I have right now</p>
  <pre><code>import discord
  from discord.ext import commands
  client = commands.Bot(command_prefix=&quot;.&quot;)
  @client.event
  async def on_ready():
     print('Bot is ready.')
  await client.run(bot token)
  </code></pre>
  <p>I also tried these:</p>
  <pre><code>import discord
  from discord.ext import commands
  client = commands.Bot(command_prefix=&quot;.&quot;)
  @client.event
  async def on_ready():
     print('Bot is ready.')
     await client.run(bot token)
  on_ready
  </code></pre>
  <p>and</p>
  <pre><code>import discord
  from discord.ext import commands
  client = commands.Bot(command_prefix=&quot;.&quot;)
  @client.event
  async def on_ready():
     print('Bot is ready.')
  await client.run(bot token)
  on_ready
  </code></pre>
  <p>I got these errors:</p>
  <p>:8: RuntimeWarning: coroutine 'on_ready' was never awaited
  RuntimeWarning: Enable tracemalloc to get the object allocation traceback</p>
  <p>and</p>
  <p>SyntaxError: 'await' outside function</p>
  <p>Please help me get the bot online</p>