discord.py-Cannot send a message copy from one server to another specific server

Whenever I try to run my code I get the following error. I have rechecked my channel ID several times and also enabled Privileged Gateway Intents from discord developer panels. Bot has administrator power so that shouldn’t be an issue. Bot is logged in as i see it online in the group…i am using only discord.client so subvariant should not be an issue…bot is added on the specific server as well. I am using replit as my IDE. Please help. ```
Ignoring exception in on_message
Traceback (most recent call last):
File “/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/client.py”, line 343, in _run_event
await coro(*args, **kwargs)
File “main.py”, line 28, in on_message
await general.send (**message.content + ’ . ’ +message.author.name)
AttributeError: ‘NoneType’ object has no attribute ‘send’

My code is:- ```   import os
import discord
intents = discord.Intents.default()
intents.members= True
intents.guilds = True
client= discord.Client( intents=intents)

@client.event
async def on_ready():
  print('i am ready ')

my_secret = os.environ['TOKEN']


@client.event
async def on_message(message):
  
  if message.author== client.user:
    return
  if message.content.startswith('$work'):
    general = client.get_channel(849317968193912842)
    await general.send (message.content + ' . ' +message.author.name)

  if message.content.startswith('tesla'):
    await message.channel.send('elon musk' )


client.run(my_secret) ```

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.