I tried to make a command that will send the message to the specified channel and get the below error
Command raised an exception: AttributeError: 'NoneType' object has no attribute 'send'
@client.command(name="chmsg")
async def _chmsg(ctx):
def check(msg):
return msg.author == ctx.author and \
msg.channel == ctx.channel
await ctx.send("Message")
mestoc = await client.wait_for("message", check=check)
await ctx.send("Channel id")
chasend = await client.wait_for("message", check=check)
mestoch = str(mestoc.content)
cha = str(chasend.content)
channel = client.get_channel(cha)
await channel.send(f"{mestoch}")