Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can I get the thread ID of a newly created thread? #153

Open
kass507 opened this issue Jun 23, 2024 · 0 comments
Open

How can I get the thread ID of a newly created thread? #153

kass507 opened this issue Jun 23, 2024 · 0 comments

Comments

@kass507
Copy link

kass507 commented Jun 23, 2024

I am creating a thread and intend to send several responses to that newly created thread.

But I can't get the thread ID, even though the code successfully creates the thread.

Is there something I'm doing wrong? Or is it an unavailable function?

def discord(media_path, name):
    body = "Puedes apoyarme"
    try:
        webhook = DiscordWebhook(url=config['discord']['webhook_thread'], content=body, thread_name=f"Pestañas de la Tienda del dia: {kasstime}")
        temp_image_path = f"{name}_discord_resized.jpg"
        resize_image_discord(media_path, temp_image_path)

        with open(temp_image_path, "rb") as shopImage:
            webhook.add_file(file=shopImage.read(), filename='tienda.jpg')

        response = webhook.execute()
        print("Enviado con Éxito a Discord")
        print(webhook)
        print(webhook.thread_id)
        return webhook.thread_id
    except Exception as e:
        print(f"Error al enviar la tienda de objetos a Discord, {e}")
        return None
Enviado con Éxito a Discord
<discord_webhook.webhook.DiscordWebhook object at 0x106d9b500>
None
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant