update voice channel on state update + dont make logging enabled by default
This commit is contained in:
parent
001b801a15
commit
9b18759864
|
|
@ -20,7 +20,7 @@ if not discord.version_info.major >= 2:
|
|||
"using 'pip install discord.py'",
|
||||
)
|
||||
|
||||
__version__ = "2.7.2"
|
||||
__version__ = "2.7.3a"
|
||||
__title__ = "pomice"
|
||||
__author__ = "cloudwithax"
|
||||
__license__ = "GPL-3.0"
|
||||
|
|
|
|||
|
|
@ -213,7 +213,7 @@ class Player(VoiceProtocol):
|
|||
difference = (time.time() * 1000) - self._last_update
|
||||
position = self._last_position + difference
|
||||
|
||||
return min(position, current.length)
|
||||
return round(min(position, current.length))
|
||||
|
||||
@property
|
||||
def rate(self) -> float:
|
||||
|
|
@ -335,6 +335,10 @@ class Player(VoiceProtocol):
|
|||
return
|
||||
|
||||
channel = self.guild.get_channel(int(channel_id))
|
||||
|
||||
if self.channel != channel:
|
||||
self.channel = channel
|
||||
|
||||
if not channel:
|
||||
await self.disconnect()
|
||||
self._voice_state.clear()
|
||||
|
|
|
|||
|
|
@ -240,16 +240,6 @@ class Node:
|
|||
if self._log_handler:
|
||||
handler = self._log_handler
|
||||
logger.setLevel(handler.level)
|
||||
else:
|
||||
handler = logging.StreamHandler()
|
||||
logger.setLevel(level)
|
||||
dt_fmt = "%Y-%m-%d %H:%M:%S"
|
||||
formatter = logging.Formatter(
|
||||
"[{asctime}] [{levelname:<8}] {name}: {message}",
|
||||
dt_fmt,
|
||||
style="{",
|
||||
)
|
||||
handler.setFormatter(formatter)
|
||||
|
||||
if handler:
|
||||
logger.handlers.clear()
|
||||
|
|
|
|||
Loading…
Reference in New Issue