mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-06-07 12:18:59 +00:00
Fix Poll.duration rounding error
This commit is contained in:
parent
da89fbc8b5
commit
38bbfed717
@ -384,9 +384,9 @@ class Poll:
|
||||
question_data = data.get('question')
|
||||
question = question_data.get('text')
|
||||
expiry = utils.parse_time(data['expiry']) # If obtained via API, then expiry is set.
|
||||
duration = expiry - message.created_at
|
||||
# expiry - message.created_at may be a few nanos away from the actual duration
|
||||
duration = datetime.timedelta(hours=round((expiry - message.created_at).total_seconds() / 3600))
|
||||
# self.created_at = message.created_at
|
||||
# duration = self.created_at - expiry
|
||||
|
||||
self = cls(
|
||||
duration=duration,
|
||||
|
Loading…
x
Reference in New Issue
Block a user