Forgot to add Spotify credential arguments in create_node
This commit is contained in:
parent
53a4576025
commit
1319af5b5b
|
|
@ -4,6 +4,7 @@ import random
|
|||
|
||||
from . import exceptions
|
||||
from .node import Node
|
||||
from typing import Optional
|
||||
|
||||
from discord.ext import commands
|
||||
|
||||
|
|
@ -35,12 +36,12 @@ class NodePool:
|
|||
return available_nodes.get(identifier, None)
|
||||
|
||||
@classmethod
|
||||
async def create_node(self, bot: typing.Union[commands.Bot, discord.Client, commands.AutoShardedBot, discord.AutoShardedClient], host: str, port: str, password: str, identifier: str) -> Node:
|
||||
async def create_node(self, bot: typing.Union[commands.Bot, discord.Client, commands.AutoShardedBot, discord.AutoShardedClient], host: str, port: str, password: str, identifier: str, spotify_client_id: Optional[str], spotify_client_secret: Optional[str]) -> Node:
|
||||
"""Creates a Node object to be then added into the node pool. If you like to have Spotify searching capabilites, pass in valid Spotify API credentials."""
|
||||
if identifier in self._nodes.keys():
|
||||
raise exceptions.NodeCreationError(f"A node with identifier '{identifier}' already exists.")
|
||||
|
||||
node = Node(pool=self, bot=bot, host=host, port=port, password=password, identifier=identifier)
|
||||
node = Node(pool=self, bot=bot, host=host, port=port, password=password, identifier=identifier, spotify_client_id=spotify_client_id, spotify_client_secret=spotify_client_secret)
|
||||
await node.connect()
|
||||
self._nodes[node._identifier] = node
|
||||
return node
|
||||
|
|
|
|||
Loading…
Reference in New Issue