'how can i use discord py in a discord thread (sub-channel, not Threads module)

Im getting some errors mainly 403 missing permissions when trying to send an embed in a Thread-channel

Traceback (most recent call last):
  File "main.py", line 212, in on_message
    status, work_return = await db_handler.work(user, channel, username, user_pfp)
  File "/home/runner/believa/database/__init__.py", line 542, in work
    await channel.send(embed=embed)
  File "/home/runner/believa/venv/lib/python3.8/site-packages/discord/abc.py", line 1065, in send
    data = await state.http.send_message(channel.id, content, tts=tts, embed=embed,
  File "/home/runner/believa/venv/lib/python3.8/site-packages/discord/http.py", line 248, in request
    raise Forbidden(r, data)
discord.errors.Forbidden: 403 Forbidden (error code: 50013): Missing Permissions

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/runner/believa/venv/lib/python3.8/site-packages/discord/client.py", line 343, in _run_event
    await coro(*args, **kwargs)
  File "main.py", line 223, in on_message
    await send_error(channel)
  File "main.py", line 79, in send_error
    await channel.send(embed=embed)
  File "/home/runner/believa/venv/lib/python3.8/site-packages/discord/abc.py", line 1065, in send
    data = await state.http.send_message(channel.id, content, tts=tts, embed=embed,
  File "/home/runner/believa/venv/lib/python3.8/site-packages/discord/http.py", line 248, in request
    raise Forbidden(r, data)
discord.errors.Forbidden: 403 Forbidden (error code: 50013): Missing Permissions

heres the code snippet ::

async def send_error(channel):
    embed = discord.Embed(title="Error.", description="Internal Error, call admin.", color=0xff0000)
    await channel.send(embed=embed)
    return

any ideas on what i should change or improve on? lmk!



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source