diff options
author | 2025-04-22 18:49:58 +0100 | |
---|---|---|
committer | 2025-04-26 00:19:32 +0100 | |
commit | 3fbef29303491a39c4b7e6d8a43ef8763ac1edf6 (patch) | |
tree | d02fb20ddd7238733ae3611245056aece3c2a7e7 | |
parent | Bump deps to latest (diff) |
Ensure King Arthur doesn't deminish our 99.999999% uptime
-rw-r--r-- | arthur/exts/fun/numbers.py | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/arthur/exts/fun/numbers.py b/arthur/exts/fun/numbers.py index 906aaf7..5034718 100644 --- a/arthur/exts/fun/numbers.py +++ b/arthur/exts/fun/numbers.py @@ -1,5 +1,5 @@ import discord -from discord.ext import commands +from discord.ext import commands, tasks from arthur.apis.netcup.ssh import rce_as_a_service from arthur.config import CONFIG @@ -27,6 +27,18 @@ class Numbers(commands.GroupCog): if self.devops_vc and (vc := self.devops_vc.guild.voice_client): await vc.disconnect(force=True) + @tasks.loop(hours=1) + async def devops_vc_check(self) -> None: + """Ensure the uptime of the numbers relay.""" + if not self.devops_vc or not (vc := self.devops_vc.guild.voice_client): + return + if not isinstance(vc, discord.VoiceClient): + return + if vc.is_playing(): + return + + vc.play(discord.FFmpegOpusAudio(CONFIG.numbers_url)) + @commands.group(invoke_without_command=True) async def numbers( self, |