I am new to Discord API.
I am trying to send messages to my discord channel using a bot. I would like to run the function "scheduled_run" so that it sends messages to the channel.
Below code should send "Remainder" to channel but I am receiving error "can't send non-None value to a just-started coroutine"
async def get_channel(id):
return
async def scheduled_run():
channel = get_channel(83863944137526xxxx)
await channel.send("Remainder")
if __name__ == "__main__":
loop = get_event_loop()
loop.run_until_complete(scheduled_run())
Error: Traceback (most recent call last): File "main.py", line 83, in loop.run_until_complete(scheduled_run()) File "/usr/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete return future.result() File "main.py", line 78, in scheduled_run await channel.send(msg) TypeError: can't send non-None value to a just-started coroutine
Is it possible to send bot message without user reply? Please correct my code
awaitin front of the call toget_channel. Since the coroutine object created by a call to anasync defhappens to have a method namedsend(completely unrelated to discord), the error is somewhat cryptic. - user4815162342