I want to make my bot automatically send an image to a channel every ten minutes. Here's my code:
def job():
channel = client.get_channel(803842308139253760)
channel.send(file=discord.File(random.choice('image1', 'image2', 'image3))
schedule.every(10).minutes.do(job)
while True:
schedule.run_pending()
time.sleep(1)
I know that the schedule works. But for some reason, it can't send the message. I get this error: AttributeError: 'NoneType' object has no attribute 'send'
. I'm new to programming, so any insight would be greatly appreciated!