{"id":15009721,"url":"https://github.com/jamesives/discord-webhooks","last_synced_at":"2025-10-03T18:30:51.169Z","repository":{"id":45833770,"uuid":"156721224","full_name":"JamesIves/discord-webhooks","owner":"JamesIves","description":"🔗 🐍Python module which allows for easy sending of webhooks to a Discord server. ","archived":true,"fork":false,"pushed_at":"2020-10-02T13:08:35.000Z","size":32,"stargazers_count":21,"open_issues_count":0,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-20T22:13:57.133Z","etag":null,"topics":["attachment","discord","discord-py","discord-webhooks","embed","module","package","pip","py","python","webhook","webhooks"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JamesIves.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}},"created_at":"2018-11-08T14:43:57.000Z","updated_at":"2023-08-14T13:29:30.000Z","dependencies_parsed_at":"2022-08-19T07:51:42.915Z","dependency_job_id":null,"html_url":"https://github.com/JamesIves/discord-webhooks","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JamesIves%2Fdiscord-webhooks","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JamesIves%2Fdiscord-webhooks/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JamesIves%2Fdiscord-webhooks/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JamesIves%2Fdiscord-webhooks/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JamesIves","download_url":"https://codeload.github.com/JamesIves/discord-webhooks/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235173164,"owners_count":18947450,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["attachment","discord","discord-py","discord-webhooks","embed","module","package","pip","py","python","webhook","webhooks"],"created_at":"2024-09-24T19:27:58.831Z","updated_at":"2025-10-03T18:30:50.771Z","avatar_url":"https://github.com/JamesIves.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Discord Webhooks for Python 🔗 🐍\n\n[![Build Status](https://travis-ci.org/JamesIves/discord-webhooks.svg?branch=master)](https://travis-ci.org/JamesIves/discord-webhooks) [![Issues](https://img.shields.io/github/issues/JamesIves/discord-webhooks.svg)](https://github.com/JamesIves/discord-webhooks/issues)\n\nSimple module for Python which allows for sending of webhooks to a [Discord server](https://discordapp.com/).\n\n## Installation Steps 💽\nThe `Discord-Webhooks` module can be installed into your project via Pip.\n\n```\n$ pip install Discord-Webhooks\n```\n\n## Getting Started :airplane:\n\nImport the package into your project and initialize it to get started. You must pass the [webhook URL you obtained from your Discord channel in as the argument](https://support.discordapp.com/hc/en-us/articles/228383668-Intro-to-Webhooks). \n\n```python\nfrom discord_webhooks import DiscordWebhooks\n\n# Webhook URL for your Discord channel.\nWEBHOOK_URL = 'http://discord.gg/...'\n\n# Initialize the webhook class and attaches data.\nwebhook = DiscordWebhooks(WEBHOOK_URL)\n\n# Sets some content for a basic message.\nwebhook.set_content(content='Montezuma!')\n\n# Triggers the payload to be sent to Discord.\nwebhook.send()\n\n```\n\nIf you'd like to send a message attachment you can do so.\n\n\n```python\nfrom discord_webhooks import DiscordWebhooks\n\n# Webhook URL for your Discord channel.\nWEBHOOK_URL = 'http://discord.gg/...'\n\nwebhook = DiscordWebhooks(WEBHOOK_URL)\n\nwebhook.set_content(content='The best cat ever is...', title='Montezuma!', description='Seriously!', \\\n  url='http://github.com/JamesIves', color=0xF58CBA, timestamp='2018-11-09T04:10:42.039Z')\n\n# Attaches an image\nwebhook.set_image(url='https://avatars1.githubusercontent.com/u/10888441?s=460\u0026v=4')\n\n# Attaches a thumbnail\nwebhook.set_thumbnail(url='https://avatars1.githubusercontent.com/u/10888441?s=460\u0026v=4')\n\n# Attaches an author\nwebhook.set_author(name='James Ives', url='https://jamesiv.es', icon_url='https://avatars1.githubusercontent.com/u/10888441?s=460\u0026v=4')\n\n# Attaches a footer\nwebhook.set_footer(text='Footer', icon_url='https://avatars1.githubusercontent.com/u/10888441?s=460\u0026v=4')\n\n# Appends a field\nwebhook.add_field(name='Field', value='Value!')\n\nwebhook.send()\n```\n\n## Methods 📡\nYou can find an explanation of all available methods below. \n\n---\n\n#### `set_content`\nThe `set_content` method can be used to send basic messages to Discord.\n\n| Argument  | Description | Type |\n| ------------- | ------------- | ------------- |\n| `content`  | Content represents a standard message on Discord. | `String` |\n| `title`  | Displays a title on an message attachment. | `String` |\n| `description`  | Displays a description on an message attachment. | `String` |\n| `url`  | Creates a link on the title. | `String` |\n| `color`  | Displays a colored strip on the left side of an message attachment. This should be a hexademical value, for example `0xF58CBA`. | `Integer` |\n| `timestamp`  | Displays a timestamp beneath the message attachment. Must be a valid timestamp, consider using Python's `datetime` to achieve localtime.  | `String` |\n\n---\n\n#### `set_author`\nUsing `set_author` you're able to attach an author to an message attachment.\n\n| Argument  | Description | Type |\n| ------------- | ------------- | ------------- |\n| `name`  | The name of the author. | `String` |\n| `url`  | Creates a link on the author name. | `String` |\n| `icon_url`  | Displays an author icon, must resolve to a valid image path. | `String` |\n\n---\n\n#### `set_footer`\nUsing `set_footer` you're able to attach a footer to an message attachment.\n\n| Argument  | Description | Type |\n| ------------- | ------------- | ------------- |\n| `text`  | The text that should display in the footer. | `String` |\n| `icon_url`  | Displays a footer icon, must resolve to a valid image path. | `String` |\n\n\n---\n\n#### `set_thumbnail`\nUsing `set_thumbnail` you're able to attach a thumbnail to a message attachment.\n\n| Argument  | Description | Type |\n| ------------- | ------------- | ------------- |\n| `url`  | Displays a thumbnail image in the message attachment | `String` |\n\n---\n\n#### `set_image`\nUsing `set_image` you're able to attach an image to a message attachment.\n\n| Argument  | Description | Type |\n| ------------- | ------------- | ------------- |\n| `url`  | Displays an image in the message attachment | `String` |\n\n---\n\n#### `add_field`\nUsing `add_field` you're able to attach a field to a message attachment. You can add as many fields as you want.\n\n| Argument  | Description | Type |\n| ------------- | ------------- | ------------- |\n| `name`  | The name of the field. | `String` |\n| `value`  | The value of the field. | `String` |\n| `inline`  | Determines if the field should display inline or not, this is primarily used for formatting when you have multiple fields. | `Boolean` |\n\n---\n\n#### `send`\nWhen you're done formatting your message attachment you can use the `send` method to dispatch it to Discord.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjamesives%2Fdiscord-webhooks","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjamesives%2Fdiscord-webhooks","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjamesives%2Fdiscord-webhooks/lists"}