Skip to content

Commit 7601746

Browse files
committed
set default timestamp if provided timestamp is None
1 parent d9b5ccc commit 7601746

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

discord_webhook/webhook.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,12 +169,14 @@ def set_url(self, url):
169169
"""
170170
self.url = url
171171

172-
def set_timestamp(self, timestamp=str(datetime.datetime.utcfromtimestamp(time.time()))):
172+
def set_timestamp(self, timestamp=None):
173173
"""
174174
set timestamp of embed content
175175
:param timestamp: (optional) timestamp of embed content
176176
"""
177-
self.timestamp = timestamp
177+
if timestamp is None:
178+
timestamp = time.time()
179+
self.timestamp = str(datetime.datetime.utcfromtimestamp(timestamp))
178180

179181
def set_color(self, color):
180182
"""

0 commit comments

Comments
 (0)