I have an example code block below that I am trying to run to send a message to a specific channel. When I run it I get this error: AttributeError: 'NoneType' object has no attribute 'send'. I know the channel id is good. This is pretty straightforward but I am knew to discord.py so I may be overlooking something
import discord
from dotenv import load_dotenv
load_dotenv()
TOKEN = os.getenv('DISCORD_TOKEN')
GUILD = os.getenv('DISCORD_GUILD')
intents = discord.Intents(guild_messages=True)
client = discord.Client(intents=intents)
@client.event
async def on_ready():
await client.get_channel(811074101505425418).send("bot is online")
client.run(TOKEN)
client.channel.send("bot is online")- Goionprint(client.user.name)print anything? - Goion