discordwebhook-1.0.3
توضیحات
discordwebhlok is a python library for discord webhook with discord rest api on Python 3.6 and above.
| ویژگی | مقدار |
|---|---|
| سیستم عامل | - |
| نام فایل | discordwebhook-1.0.3 |
| نام | discordwebhook |
| نسخه کتابخانه | 1.0.3 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | 10mohi6 |
| ایمیل نویسنده | 10.mohi.6.y@gmail.com |
| آدرس صفحه اصلی | https://github.com/10mohi6/discord-webhook-python |
| آدرس اینترنتی | https://pypi.org/project/discordwebhook/ |
| مجوز | MIT |
# discordwebhook
[](https://pypi.org/project/discordwebhook/)
[](https://opensource.org/licenses/MIT)
[](https://codecov.io/gh/10mohi6/discord-webhook-python)
[](https://travis-ci.com/10mohi6/discord-webhook-python)
[](https://pypi.org/project/discordwebhook/)
[](https://pepy.tech/project/discordwebhook)
discordwebhook is a python library for discord webhook with discord rest api on Python 3.6 and above.
## Installation
$ pip install discordwebhook
## Usage
### basic
```python
from discordwebhook import Discord
discord = Discord(url="<your webhook url>")
discord.post(content="Hello, world.")
```

### basic, username and avatar_url
```python
from discordwebhook import Discord
discord = Discord(url="<your webhook url>")
discord.post(
content="Hello, world.",
username="10mohi6",
avatar_url="https://avatars2.githubusercontent.com/u/38859131?s=460&v=4"
)
```

### basic embed
```python
from discordwebhook import Discord
discord = Discord(url="<your webhook url>")
discord.post(
embeds=[{"title": "Embed Title", "description": "Embed description"}],
)
```

### advanced embed
```python
from discordwebhook import Discord
discord = Discord(url="<your webhook url>")
discord.post(
embeds=[
{
"author": {
"name": "Embed Name",
"url": "https://github.com/10mohi6/discord-webhook-python",
"icon_url": "https://picsum.photos/24/24",
},
"title": "Embed Title",
"description": "Embed description",
"fields": [
{"name": "Field Name 1", "value": "Value 1", "inline": True},
{"name": "Field Name 2", "value": "Value 2", "inline": True},
{"name": "Field Name 3", "value": "Field Value 3"},
],
"thumbnail": {"url": "https://picsum.photos/80/60"},
"image": {"url": "https://picsum.photos/400/300"},
"footer": {
"text": "Embed Footer",
"icon_url": "https://picsum.photos/20/20",
},
}
],
)
```

### send file
```python
from discordwebhook import Discord
discord = Discord(url="<your webhook url>")
discord.post(
file={
"file1": open("tests/file1.jpg", "rb"),
"file2": open("tests/file2.jpg", "rb"),
},
)
```

## Getting started
For help getting started with discord webhook, view our online [documentation](https://discordapp.com/developers/docs/resources/webhook).
## Contributing
1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request
نیازمندی
| مقدار | نام |
|---|---|
| - | requests |
زبان مورد نیاز
| مقدار | نام |
|---|---|
| >=3.6.0 | Python |
نحوه نصب
نصب پکیج whl discordwebhook-1.0.3:
pip install discordwebhook-1.0.3.whl
نصب پکیج tar.gz discordwebhook-1.0.3:
pip install discordwebhook-1.0.3.tar.gz