-
I'm currently migrating a simple webhook bot from Disord.py to Pycord 2.0.0b. This bot simply posts a message to a specific channel every X minutes: async with aiohttp.ClientSession() as session:
...
webhook = discord.Webhook.from_url(wh_url, session=session)
await webhook.send(embed=embed) Since Pycord is adding support for threads I want to send messages to different (existing) threads in this channel. This works fine, but I'm a bit confused about the right way to pass a thread ID since the class Identifiable(discord.abc.Snowflake):
def __init__(self, id_: int) -> None:
super().__init__()
self.id = id_
...
await webhook.send(embed=embed, thread=Identifiable(thread_id)) Is this an oversight in the code or am I doing it wrong? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
There is |
Beta Was this translation helpful? Give feedback.
-
You should be able to convert from int to discord.abc.Snowflake easily since internally a Snowflake is just an int |
Beta Was this translation helpful? Give feedback.
There is
discord.Object
that is designed to be used when a Snowflake object is required but you only really need the ID.