I cannot run the program and I just get a syntax error. I am trying to send a message to a specific channel, but the ch variable for some reason lights up red. I am new to this, and I am not very good.
ch = client.get_channel(12345642256905728)
await ch.send('hello')
In order to use "await", you have to use it inside of an asynchronous function. So you could so something like this:
async def sendMessage(message):
ch = client.get_channel(12345642256905728)
await ch.send(str(message))
The "str(message)" is just a safety precaution since you need to send a string when using ch.send().
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments