import os
import discord
import random
from prettytable import PrettyTable
from PIL import Image
client = discord.client()
@client.event
async def on_ready():
print("We have logged in as {0.user}".format(client))
@client.event
async def on_message(message):
if message.author == client.user:
return
if message.content.startswith("$picture"):
await channel.send(file=discord.File("images.jpg"))
client.run(os.getenv('TOKEN'))
Hello this is my first time using stack overflow I apologize ahead of time if my post has some mistakes,
so I was trying to have my discord upload a picture when entering a "$picture" in the chat box, but I get an red underline at the line that says await channel.send(file=discord.File("images.jpg"))
Saying "undefined named 'channel'" I tried looking into it but couldnt find much. Any ideas? thank you.