title: Discord.py text channel check
body: <pre><code>@client.command(aliases=[&quot;logchannel, setlog&quot;])
  @commands.has_permissions(manage_messages=True)
  async def log(ctx, *args: discord.TextChannel):
      with open(&quot;configs/channels.json&quot;, &quot;r&quot;) as f:
          channels = json.load(f)
      channel = channels.get(str(ctx.guild.id), ctx.channel.id)
      if len(args) == 0:
          await ctx.send(&quot;Which channel should I set the logs? :thinking:&quot;)
      elif args[0] != discord.TextChannel:
          await ctx.send(&quot;That is not a valid channel!&quot;)
      elif args[0] == discord.TextChannel:
          with open(&quot;configs/channels.json&quot;, &quot;w&quot;) as f:
              json.dump(channels, f, indent=4)
          embed = discord.Embed(title=&quot;Log channel set! :white_check_mark:&quot;,
                                description=f&quot;**{channel}** has been set as logs channel!&quot;,
                                color=0x2f3136)
          await ctx.send(embed=embed)
  </code></pre>
  <p>So this part of my code is made for setting a log channel using JSON. The json part works fine as i have used it in several more commands. But it doesnt see if there was a valid channel given or not. As i know it should be <code>discord.TextChannel</code> but it's not. The <code>if len(args) == 0</code> part works but others don't. How can i make this work? What should i put instead of <code>discord.TextChannel</code>?</p>