diff --git a/bot.py b/bot.py index b222e06..dceff19 100644 --- a/bot.py +++ b/bot.py @@ -129,15 +129,12 @@ class TuneBot(commands.Bot): self.lavalink = self.create_lavalink(self.user.id) def create_lavalink(self, user_id: int) -> "lavalink.Client": - cfg = self.config["lavalink"] + nodes = self.config["nodes"] + client: lavalink.Client = lavalink.Client(user_id, player=CustomPlayer) - client.add_node( - cfg["host"], - cfg["port"], - cfg["password"], - cfg["region"], - cfg["name"], - ) + # get the lavalink nodes from the config + for node in nodes: + client.add_node(nodes[node]["host"], nodes[node]["port"], nodes[node]["password"], nodes[node]["region"], nodes[node]["name"]) return client async def get_context(self, message: Message, *, cls=CustomContext): diff --git a/cogs/settings/interactions.py b/cogs/settings/interactions.py index b0ebbe6..f6937d4 100644 --- a/cogs/settings/interactions.py +++ b/cogs/settings/interactions.py @@ -105,7 +105,6 @@ class SourceCommands(app_commands.Group): await ctx.response.send_message(embed=embed) - class SettingCommands(app_commands.Group): def __init__(self, bot: "TuneBot"): super().__init__(name="settings", description="Tweak and customize") diff --git a/config.json.sample b/config.json.sample index f5f2bbc..2a0633d 100644 --- a/config.json.sample +++ b/config.json.sample @@ -8,12 +8,14 @@ "prefix": "ck!", "redis_url": "", "redis_prefix": "", - "lavalink": { - "host": "", - "port": 2333, - "password": "", - "region": "", - "name": "" + "nodes": { + "example": { + "host": "", + "port": 2333, + "password": "", + "region": "", + "name": "" + } }, "colors": { "embed": "7289da"