title: Discord.py 'NoneType' object has no attribute 'send'
body: <p>When I try to run the command I always get this error message: Discord.py 'NoneType' object has no attribute 'send'</p>
  <pre><code>import os
  import json
  import discord
  from discord.ext import commands
  
  def get_channel(client, message):
      with open('./data/welcome.json', 'r') as f:
          tchann = json.load(f)
      return tchann[str(message.guild.id)]
  
  class welcome(commands.Cog):
  
      def __init__(self, client):
          self.client = client
  
      # Events
      @commands.Cog.listener()
      async def on_ready(self):
          print('Welcome script loading.')
  
      @commands.Cog.listener()
      async def on_member_join(self, member):
          embed=discord.Embed(title=&quot;Yoshino&quot;,
              url=&quot;http://animeex.nhely.hu/&quot;,
              description=f&quot;asd1.&quot;,
              color=0x29FF94)
  
          channel = self.client.get_channel(id=get_channel)
  
          await channel.send(embed=embed)
  
      @commands.command()
      async def welcome(self, ctx, channel):
          with open('./data/welcome.json', 'r') as f:
              tchann = json.load(f)
  
          tchann[str(ctx.guild.id)] = channel
  
          with open('./data/welcome.json', 'w') as f:
              json.dump(tchann, f, indent=4)
  
          await ctx.send(f'Channel set: {channel}')
  
  def setup(client):
      client.add_cog(welcome(client))
  </code></pre>
  <p><strong>Error code:</strong></p>
  <blockquote>
  <p>File
  &quot;C:\Users\NexaHn\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\client.py&quot;,
  line 343, in _run_event
  await coro(*args, **kwargs) File &quot;K:\Discord BOT\PythonX\cogs\welcome.py&quot;, line 30, in on_member_join
  await channel.send(embed=embed) AttributeError: 'NoneType' object has no attribute 'send'</p>
  </blockquote>