Feature/multi node support and tos privacy command (#52)

* add support for multiple nodes

* add a tos and privacy command
This commit is contained in:
2023-04-11 23:07:39 +02:00
committed by GitHub
parent e25e7e78f8
commit 41a098d577
3 changed files with 13 additions and 15 deletions
+5 -8
View File
@@ -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):