Skip to content

Commit 16f6c95

Browse files
committed
fix hex to int color conversion
1 parent 08c4e62 commit 16f6c95

3 files changed

Lines changed: 7 additions & 6 deletions

File tree

CHANGES.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# python-discord-webhook Changes
22

3+
## 2022-05-12 0.16.1
4+
5+
### Fixes
6+
- fix hex to int color conversion
7+
38
## 2022-05-06 0.16.0
49

510
### Features

discord_webhook/webhook.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ class DiscordEmbed:
2121
url: Optional[str]
2222
timestamp: Optional[str]
2323
color: Optional[int]
24-
hex_color: Optional[str]
2524
footer: Optional[Dict[str, Optional[str]]]
2625
image: Optional[Dict[str, Optional[Union[str, int]]]]
2726
thumbnail: Optional[Union[str, Dict[str, Optional[Union[str, int]]]]]
@@ -34,7 +33,6 @@ def __init__(
3433
self,
3534
title: Optional[str] = None,
3635
description: Optional[str] = None,
37-
hex_color: str = "33ccff",
3836
**kwargs: Any,
3937
) -> None:
4038
"""
@@ -45,7 +43,6 @@ def __init__(
4543
:keyword ``url:`` add an url to make your embeded title a clickable link\n
4644
:keyword ``timestamp:`` timestamp of embed content\n
4745
:keyword ``color:`` color code of the embed as int\n
48-
:keyword ``hex_color:`` color code of the embed as a hex string\n
4946
:keyword ``footer:`` footer texts\n
5047
:keyword ``image:`` your image url here\n
5148
:keyword ``thumbnail:`` your thumbnail url here\n
@@ -58,15 +55,14 @@ def __init__(
5855
self.description = description
5956
self.url = cast(str, kwargs.get("url"))
6057
self.timestamp = cast(str, kwargs.get("timestamp"))
61-
self.hex_color = hex_color
6258
self.footer = kwargs.get("footer")
6359
self.image = kwargs.get("image")
6460
self.thumbnail = kwargs.get("thumbnail")
6561
self.video = kwargs.get("video")
6662
self.provider = kwargs.get("provider")
6763
self.author = kwargs.get("author")
6864
self.fields = kwargs.get("fields", [])
69-
self.color = cast(Optional[int], kwargs.get("color"))
65+
self.set_color(kwargs.get("color"))
7066

7167
def set_title(self, title: str) -> None:
7268
"""

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
setup(
1212
name="discord-webhook",
13-
version="0.16.0",
13+
version="0.16.1",
1414
packages=find_packages(),
1515
include_package_data=True,
1616
license="MIT License",

0 commit comments

Comments
 (0)