I'm making an AI thing that uses voice to text and text to speech to communicate, and I thought it would be nice to give it access to Discord, just for fun, but I'm only finding how to send messages when a message is sent in Discord, or some other Discord event is set off. I need to be able to trigger a function in the AI's script that sends the AI's response to the Discord bot's script to send the message to Discord. I'll add more features to the Discord stuff later, but right now I just need to get it to send its response. import discord import secretss intents = discord.Intents.default() intents.message_content = True client = discord.Client(intents = intents) @client.event async def on_ready(): print(f'{client.user} has connected to Discord!') @client.event async def on_message(message): if message.author == client.user: return await message.channel.send('hello') client.run(secretss.discordkey) I have tried different methods of threading, async, and tried different functions. All of the experimenting was just Google results because I'm pretty new to the discord.py library, and async. So I haven't done much to figure it out yet. Continue reading...