{"id":44060113,"url":"https://github.com/typical-developers/discord-webhooks-go","last_synced_at":"2026-02-08T01:30:32.167Z","repository":{"id":283879061,"uuid":"953170139","full_name":"typical-developers/discord-webhooks-go","owner":"typical-developers","description":"A lightweight library for sending and managing webhooks on Discord.","archived":false,"fork":false,"pushed_at":"2025-12-20T05:33:34.000Z","size":42,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-12-22T00:33:19.380Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/typical-developers.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-03-22T18:19:36.000Z","updated_at":"2025-12-20T05:33:33.000Z","dependencies_parsed_at":null,"dependency_job_id":"15a2b4f5-9a8c-4e4e-bb91-503c7ec35d1b","html_url":"https://github.com/typical-developers/discord-webhooks-go","commit_stats":null,"previous_names":["typical-developers/discord-webhooks-go"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/typical-developers/discord-webhooks-go","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/typical-developers%2Fdiscord-webhooks-go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/typical-developers%2Fdiscord-webhooks-go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/typical-developers%2Fdiscord-webhooks-go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/typical-developers%2Fdiscord-webhooks-go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/typical-developers","download_url":"https://codeload.github.com/typical-developers/discord-webhooks-go/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/typical-developers%2Fdiscord-webhooks-go/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29216084,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-08T00:10:47.190Z","status":"ssl_error","status_checked_at":"2026-02-08T00:10:43.589Z","response_time":63,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-02-08T01:30:31.470Z","updated_at":"2026-02-08T01:30:32.161Z","avatar_url":"https://github.com/typical-developers.png","language":"Go","readme":"# Discord Webhooks\nSend messages to webhooks on Discord. If you do not want to use discordgo specifically for webhooks, this is a lightweight library that will allow you to send them.\n\n## Initalizing a Webhook Client\nThe library has two ways of initializing a webhook client. Unlike discordgo, you can also initalize a webhook client from its URL and not just from its ID and Secret.\n\n### ID + Secret\n```go\npackage main\n\nimport (\n    webhooks \"github.com/typical-developers/discord-webhooks-go\"\n)\n\nfunc main() {\n    id := \"0\"\n    secret := \"0\"\n    client := webhooks.NewWebhookClient(id, secret)\n}\n```\n\n### URL\n```go\npackage main\n\nimport (\n    webhooks \"github.com/typical-developers/discord-webhooks-go\"\n)\n\nfunc main() {\n    url := \"https://discord.com/api/webhooks/0/0\"\n    client := webhooks.NewWebhookClientFromURL(url)\n}\n```\n\n## Executing Webhooks\nMessages can be sent through webhooks using the `Execute` method on the client.\n\n### Sending Messages\n```go\npackage main\n\nimport (\n    \"context\"\n\n    webhooks \"github.com/typical-developers/discord-webhooks-go\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    url := \"https://discord.com/api/webhooks/0/0\"\n    client := webhooks.NewWebhookClientFromURL(url)\n\n    _, _, err := client.Execute(ctx,\n        webhooks.MessagePayload{\n            Content: \"Hello World!\",\n        },\n        nil,\n    )\n    if err != nil {\n        panic(err)\n    }\n}\n```\n\n### Sending Messages with Files\n```go\npackage main\n\nimport (\n    \"context\"\n\n    webhooks \"github.com/typical-developers/discord-webhooks-go\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    url := \"https://discord.com/api/webhooks/0/0\"\n    client := webhooks.NewWebhookClientFromURL(url)\n\n\tfile, err := os.Open(\"file.png\")\n    if err != nil {\n        panic(err)\n    }\n    defer file.Close()\n\n    _, _, err := client.Execute(ctx,\n        webhooks.MessagePayload{\n            Content: \"Hello World!\",\n            Files: []webhooks.WebhookFile{\n                webhooks.WebhookFile{\n                    FileName: file.Name(),\n                    Reader:   file,\n                },\n            },\n        },\n        nil,\n    )\n    if err != nil {\n        panic(err)\n    }\n}\n```\n\n## Waiting for Response\nAdding a `wait=true` query parameter will allow you to wait for the webhook to send and the server to acknowledge it. This will return a `WebhookMessage`, which adds methods that allow you manage the message. You must ensure that the returned message is not nil before attempting to call any of the methods associated with it. `204 No Content` can result in a nil message.\n\n```go\npackage main\n\nimport (\n    \"context\"\n\t\"net/url\"\n\n    webhooks \"github.com/typical-developers/discord-webhooks-go\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    u := \"https://discord.com/api/webhooks/0/0\"\n    client := webhooks.NewWebhookClientFromURL(u)\n\n    query := url.Values{}\n    query.Set(\"wait\", \"true\")\n\n    message, _, err := client.Execute(ctx,\n        webhooks.MessagePayload{\n            Content: \"Hello World!\",\n        },\n        \u0026query,\n    )\n    if err != nil {\n        panic(err)\n    }\n\n    if message != nil {\n        _, _, err := message.Edit(ctx,\n            webhooks.EditMessagePayload{\n                Content: \"Hello World, but edited!!\",\n            },\n            nil,\n        )\n    }\n}\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftypical-developers%2Fdiscord-webhooks-go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftypical-developers%2Fdiscord-webhooks-go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftypical-developers%2Fdiscord-webhooks-go/lists"}