I have defined a function which is set to send a message to a Discord channel every hour. This would be run alongside your typical on_message()
commands, so I thought of putting the reccuring function inside a thread using threading.
I tried to async/await the thread as you do, but it didn't work. How do I make it possible so I could have a message repeat every hour along with typical commands?
My code is as follows
async def reccur_func():
while 1:
await reccurship()
time.sleep(30)
client = discord.Client()
threading.Thread(target = reccur_func).start() #I tried putting await and async at the beginning of this line
@client.event
async def on_message(ctx):
......
client.run('....')
Thank you all