Skip to content

Commit

Permalink
Add uptime command (#2407)
Browse files Browse the repository at this point in the history
Co-authored-by: Snow <135516526+BabyBoySnow@users.noreply.github.com>
  • Loading branch information
itsTheFae and BabyBoySnow committed May 17, 2024
1 parent c256eb9 commit a76f648
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions musicbot/bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ def __init__(

self.use_certifi: bool = use_certifi
self.exit_signal: ExitSignals = None
self._init_time: float = time.time()
self._os_signal: Optional[signal.Signals] = None
self._ping_peer_addr: str = ""
self._ping_use_http: bool = False
Expand Down Expand Up @@ -6925,6 +6926,18 @@ async def cmd_checkupdates(self, channel: MessageableChannel) -> CommandResponse
delete_after=60,
)

async def cmd_uptime(self) -> CommandResponse:
"""
Usage:
{command_prefix}uptime
Displays the MusicBot uptime, since last start/restart.
"""
uptime = time.time() - self._init_time
delta = format_song_duration(uptime)
return Response(
f"MusicBot has been up for `{delta}`",

@owner_only
async def cmd_botlatency(self) -> CommandResponse:
"""
Expand Down

0 comments on commit a76f648

Please sign in to comment.