File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change 11import asyncio
22import time
3+ from datetime import datetime
34from collections import defaultdict
45from typing import TYPE_CHECKING , Optional
56
@@ -68,6 +69,16 @@ def latencies(self) -> dict[int, float]:
6869 """
6970 return {state .shard_id : state .latency for state in self ._connection_states }
7071
72+ @property
73+ def start_time (self ) -> datetime :
74+ """The start time of the first shard of the bot."""
75+ return next ((state .start_time for state in self ._connection_states ), MISSING ) # type: ignore
76+
77+ @property
78+ def start_times (self ) -> dict [int , datetime ]:
79+ """The start times of all shards of the bot, keyed by each shard ID."""
80+ return {state .shard_id : state .start_time for state in self ._connection_states } # type: ignore
81+
7182 async def stop (self ) -> None :
7283 """Shutdown the bot."""
7384 self .logger .debug ("Stopping the bot." )
You can’t perform that action at this time.
0 commit comments