I currently have code for a command that takes in a channel ID followed by some text message as input. The code then finds the channel and sends the message on it. However, Discord has just released a new thread feature, and currently, no update has been made to the official Discord API docs regarding how bots can interact with threads. So, how can a bot send messages to threads? Please leave down answers as new information is released by Discord. Here's the code I was talking about before:
@bot.command()
async def text(ctx, channel_id, *, msg):
channel = bot.get_channel(int(channel_id))
try:
await channel.send(ctx.message.attachments[0].url)
except IndexError:
pass
await channel.trigger_typing()
await channel.send(msg)