title: discord.py bot hosted on heroku wont go online
body: <p>I decided to use heroku to run my bot 24/7. I deployed, saw my dyno running, no errors and it was even switched on. I expected the bot to come online because of the deploy but it just stayed offline.</p>
  
  <p>Here is my bot code:</p>
  
  <pre><code>import discord
  import os
  import asyncio
  import random
  from discord.ext import commands, tasks
  from itertools import cycle
  
  TOKEN = 'XXXXX'
  
  client = commands.Bot(command_prefix = '/')
  
  client.remove_command('help')
  
  status = cycle(['Helping my Creator!', 'Moderating this server. smh'])
  
  messages = 0
  
  @client.event
  async def on_ready():
      change_status.start()
      print('Bot has connected.')
  
  @client.event
  async def on_message(message):
      global messages
      messages +-1
  
      bad_words = [(just a list of bad words)]
  
      for word in bad_words:
          if message.content.count(word) &gt; 0:
              print('Someone said a bad word')
              await message.channel.purge(limit = 1)
      await client.process_commands(message)
  
  @tasks.loop(minutes = 5)
  async def change_status():
      await client.change_presence(activity = discord.Game(next(status)))
  
  @client.command()
  async def cheese(ctx):
      responses = ["Here's some Parmesan.:cheese:",
                   "Here's some Pecorino.:cheese:",
                   "Here's some Manchego.:cheese:",
                   "Here's some Grana-Padano.:cheese:",
                   "Here's some Cheddar.:cheese:",
                   "Here's some Gouda.:cheese:",
                   "Here's some Harvati.:cheese:",
                   "Here's some Gruyere.:cheese:",
                   "Here's some Gorgonzola.:cheese:",
                   "Here's some Stilton.:cheese:",
                   "Here's some Roquefort.:cheese:",
                   "Here's some Danish Blue.:cheese:",
                   "Here's some Brie.:cheese:",
                   "Here's some Camembert.:cheese:",
                   "Here's some Double Creme White.:cheese:",
                   "Here's some Cream Cheese.:cheese:",
                   "Here's some Feta.:cheese:",
                   "Here's some Mozzarella.:cheese:",
                   "Here's some Burrata.:cheese:",
                   "Here's some Chevre.:cheese:",
                   "Here's some Goat Brie.:cheese:",
                   "Here's some Blue Goat Cheese.:cheese:"]
      await ctx.send(random.choice(responses))
  
   @client.command()
   async def userinfo(ctx, member: discord.Member = None):
       member = ctx.author if not member else member
  
       embed = discord.Embed(colour = member.color, timestamp = 
       ctx.message.created_at)
  
       embed.set_author(name = f"User info - {member}")
       embed.set_thumbnail(url = member.avatar_url)
       embed.set_footer(text = f"Requested by {ctx.author}", icon_url = 
       ctx.author.avatar_url)
  
       embed.add_field(name = "ID:", value = member.id)
       embed.add_field(name = "Guild name:", value = member.display_name)
  
       embed.add_field(name = "Created at:", value 
       member.created_at.strftime("%a, %d %B %Y, %I:%M %p UTC"))
       embed.add_field(name = "Joined at:", value = 
       member.joined_at.strftime("%a, %d %B %Y, %I:%M %p UTC"))
  
       embed.add_field(name = "Bot?", value = member.bot)
  
       await ctx.send(embed = embed)
  
  client.run(TOKEN)
  </code></pre>
  
  <p>Here is my procfile:</p>
  
  <pre><code>worker: python3 modbotv4.py
  </code></pre>
  
  <p>My requirements.txt file:</p>
  
  <pre><code>git+https://github.com/Rapptz/discord.py
  dnspython==1.16.0
  PyNaCl==1.3.0
  async-timeout==3.0.1
  </code></pre>
  
  <p>And my runtime.txt file:</p>
  
  <pre><code>python-3.8.3
  </code></pre>
  
  <p>If there is anything I should add in any of the files in order to make my bot go online, please tell me.</p>