rexor12 / holobot

A simple - but hopefully easily extensible - bot with Discord integration.
MIT License
4 stars 3 forks source link

Replace direct datetime.now() usages with a date-time service #199

Open rexor12 opened 2 years ago

rexor12 commented 2 years ago

To reduce the probability of miusing datetime.utcnow() versus datetime.now(timezone.utc) as well as improve testability, a service should be implemented that can be used to query the current date and time.

class IDateTimeProvider(Protocol):
    def utcnow(self) -> datetime: ...
tooruu commented 2 years ago

cringe