mirror of
https://github.com/Matthww/TuneBot.git
synced 2026-09-21 22:57:48 +00:00
decoupled lavalink creation from cogs.music
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import asyncio
|
||||
from typing import Dict
|
||||
|
||||
from discord.ext.commands import Cog
|
||||
@@ -13,3 +14,9 @@ class BaseCog(Cog):
|
||||
for command in self.walk_commands():
|
||||
if brief := slash_descriptions.get(command.qualified_name):
|
||||
command.brief = brief
|
||||
|
||||
def is_lavalink_ready(self) -> bool:
|
||||
return (
|
||||
hasattr(self.bot, "lavalink")
|
||||
and len(self.bot.lavalink.node_manager.available_nodes) > 0
|
||||
)
|
||||
|
||||
+2
-2
@@ -12,7 +12,7 @@ class AutoJoin:
|
||||
async def get_channels(redis: Redis) -> Dict[str, str]:
|
||||
# return all channels
|
||||
channels = await redis.hgetall(f"{redis_prefix}:autojoin")
|
||||
return {key: value.split("-") for key, value in channels.items()}
|
||||
return {key: value.split(":") for key, value in channels.items()}
|
||||
|
||||
@staticmethod
|
||||
async def update_channel(
|
||||
@@ -21,7 +21,7 @@ class AutoJoin:
|
||||
await redis.hset(
|
||||
f"{redis_prefix}:autojoin",
|
||||
guild_id,
|
||||
f"{voice_channel_id}-{text_channel_id}",
|
||||
f"{voice_channel_id}:{text_channel_id}",
|
||||
)
|
||||
|
||||
@staticmethod
|
||||
|
||||
Reference in New Issue
Block a user