Merge branch 'main' of https://github.com/chrmatic/pomice
This commit is contained in:
commit
27d447c12d
|
|
@ -21,7 +21,7 @@ if not discord.version_info.major >= 2:
|
|||
"using 'pip install discord.py'",
|
||||
)
|
||||
|
||||
__version__ = "2.10.0"
|
||||
__version__ = "2.11.0"
|
||||
__title__ = "pomice"
|
||||
__author__ = "cloudwithax"
|
||||
__license__ = "GPL-3.0"
|
||||
|
|
|
|||
|
|
@ -313,6 +313,9 @@ class Player(VoiceProtocol):
|
|||
"sessionId": state["sessionId"],
|
||||
}
|
||||
|
||||
if self._node._version >= LavalinkVersion(4, 2, 0) and self.channel:
|
||||
data["channelId"] = str(self.channel.id)
|
||||
|
||||
await self._node.send(
|
||||
method="PATCH",
|
||||
path=self._player_endpoint_uri,
|
||||
|
|
|
|||
|
|
@ -18,7 +18,8 @@ from urllib.parse import quote
|
|||
|
||||
import aiohttp
|
||||
import orjson as json
|
||||
from discord import Client, VoiceChannel
|
||||
from discord import Client
|
||||
from discord import VoiceChannel
|
||||
from discord.ext import commands
|
||||
|
||||
try:
|
||||
|
|
@ -979,7 +980,7 @@ class NodePool:
|
|||
|
||||
@classmethod
|
||||
def get_best_node(
|
||||
cls, *, algorithm: NodeAlgorithm, channel: Optional[VoiceChannel] = None
|
||||
cls, *, algorithm: NodeAlgorithm, channel: Optional[VoiceChannel] = None,
|
||||
) -> Node:
|
||||
"""Fetches the best node based on an NodeAlgorithm.
|
||||
This option is preferred if you want to choose the best node
|
||||
|
|
@ -1016,7 +1017,7 @@ class NodePool:
|
|||
return cls.get_best_node(algorithm=NodeAlgorithm.by_ping)
|
||||
|
||||
if node := next(
|
||||
(node for node in available_nodes if node.location == chosen_region), None
|
||||
(node for node in available_nodes if node.location == chosen_region), None,
|
||||
):
|
||||
return node
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue