{ "info": { "author": "James Ives", "author_email": "iam@jamesiv.es", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Environment :: Other Environment", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.6" ], "description": "# Discord Webhooks for Python \ud83d\udd17 \ud83d\udc0d\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 \ud83d\udcbd\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&v=4')\n\n# Attaches a thumbnail\nwebhook.set_thumbnail(url='https://avatars1.githubusercontent.com/u/10888441?s=460&v=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&v=4')\n\n# Attaches a footer\nwebhook.set_footer(text='Footer', icon_url='https://avatars1.githubusercontent.com/u/10888441?s=460&v=4')\n\n# Appends a field\nwebhook.add_field(name='Field', value='Value!')\n\nwebhook.send()\n```\n\n## Methods \ud83d\udce1\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\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/JamesIves/discord-webhooks", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "Discord-Webhooks", "package_url": "https://pypi.org/project/Discord-Webhooks/", "platform": "", "project_url": "https://pypi.org/project/Discord-Webhooks/", "project_urls": { "Homepage": "https://github.com/JamesIves/discord-webhooks" }, "release_url": "https://pypi.org/project/Discord-Webhooks/1.0.4/", "requires_dist": [ "requests (==2.21.0)" ], "requires_python": "", "summary": "Easy to use module for Python which allows for sending of webhooks to a Discord server.", "version": "1.0.4" }, "last_serial": 4666034, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "1db8ab42b3a952b28163e309a6eac4dc", "sha256": "27599759b984b77983b13c2b21b4bf4a91e7cb341eb3d6b183cc1245a2012260" }, "downloads": -1, "filename": "Discord_Webhooks-1.0.0-py2-none-any.whl", "has_sig": false, "md5_digest": "1db8ab42b3a952b28163e309a6eac4dc", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 2629, "upload_time": "2018-11-09T13:26:48", "url": "https://files.pythonhosted.org/packages/e7/1d/9ffd4a9b7c8f231e9d241773bf228ebee1e3d4695bf105421ea1eac739f8/Discord_Webhooks-1.0.0-py2-none-any.whl" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "41050ae56e39300bb46fe56a78e714a4", "sha256": "69e4c7cf7945335b0d2231bc9310fa5ab1b508d3ea7ec5bdf48f929c60c192d5" }, "downloads": -1, "filename": "Discord_Webhooks-1.0.1-py2-none-any.whl", "has_sig": false, "md5_digest": "41050ae56e39300bb46fe56a78e714a4", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 2642, "upload_time": "2018-11-09T14:59:48", "url": "https://files.pythonhosted.org/packages/d5/77/e0f1989bc9ca3ca8576ca5f26cb712ca8d5533a49ebd1bca805b2c8fab08/Discord_Webhooks-1.0.1-py2-none-any.whl" } ], "1.0.2": [ { "comment_text": "", "digests": { "md5": "a702f136db329710a0877f1f46c2e597", "sha256": "aa20981ab07161f2b2e77e4abeb30bbbbc109d4f8a456d6f1b26805c629e04b5" }, "downloads": -1, "filename": "Discord_Webhooks-1.0.2-py2-none-any.whl", "has_sig": false, "md5_digest": "a702f136db329710a0877f1f46c2e597", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 2748, "upload_time": "2018-11-09T15:27:32", "url": "https://files.pythonhosted.org/packages/17/5b/05950ecac89567a688849f05979ae13fc330176ab1f51a9a48175ffe6203/Discord_Webhooks-1.0.2-py2-none-any.whl" } ], "1.0.3": [ { "comment_text": "", "digests": { "md5": "13d73d5c508bd67dfeea7b4585666fc8", "sha256": "aebf097234f17c992d061c52f970c6b4faabfd06c10422eeda536bc02fce5428" }, "downloads": -1, "filename": "Discord_Webhooks-1.0.3-py2-none-any.whl", "has_sig": false, "md5_digest": "13d73d5c508bd67dfeea7b4585666fc8", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 4057, "upload_time": "2018-11-09T15:31:51", "url": "https://files.pythonhosted.org/packages/7c/08/e366ba25f98257b612e7c1567692afac859f104416bf459334ffb67b1c5b/Discord_Webhooks-1.0.3-py2-none-any.whl" } ], "1.0.4": [ { "comment_text": "", "digests": { "md5": "e4f3cc64820437c2a023844dae08a738", "sha256": "b8db5fbf80edd0324df095419eac62826b2f5b93680684d3e941f6376d9cf567" }, "downloads": -1, "filename": "Discord_Webhooks-1.0.4-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "e4f3cc64820437c2a023844dae08a738", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 4943, "upload_time": "2019-01-06T16:39:49", "url": "https://files.pythonhosted.org/packages/33/1a/20ecb0605187e01c82af44f563ae6ade81ef39fb9908fad9e2b6b680aea8/Discord_Webhooks-1.0.4-py2.py3-none-any.whl" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "e4f3cc64820437c2a023844dae08a738", "sha256": "b8db5fbf80edd0324df095419eac62826b2f5b93680684d3e941f6376d9cf567" }, "downloads": -1, "filename": "Discord_Webhooks-1.0.4-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "e4f3cc64820437c2a023844dae08a738", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 4943, "upload_time": "2019-01-06T16:39:49", "url": "https://files.pythonhosted.org/packages/33/1a/20ecb0605187e01c82af44f563ae6ade81ef39fb9908fad9e2b6b680aea8/Discord_Webhooks-1.0.4-py2.py3-none-any.whl" } ] }