Fixed bugs
This commit is contained in:
5
main.py
5
main.py
@@ -197,13 +197,12 @@ if (LOG_FILE := LOG_SETTINGS.get("file", {})).get("enable", True):
|
||||
file_handler = TimedRotatingFileHandler(filename=f'{log_path}/vocard.log', encoding="utf-8", backupCount=LOG_SETTINGS.get("max-history", 30), when="d")
|
||||
file_handler.namer = lambda name: name.replace(".log", "") + ".log"
|
||||
file_handler.setFormatter(logging.Formatter('{asctime} [{levelname:<8}] {name}: {message}', '%Y-%m-%d %H:%M:%S', style='{'))
|
||||
logging.getLogger().addHandler(file_handler)
|
||||
|
||||
for log_name, log_level in LOG_SETTINGS.get("level", {}).items():
|
||||
_logger = logging.getLogger(log_name)
|
||||
_logger.setLevel(log_level)
|
||||
|
||||
logging.getLogger().addHandler(file_handler)
|
||||
|
||||
|
||||
# Setup the bot object
|
||||
intents = discord.Intents.default()
|
||||
intents.message_content = False if func.settings.bot_prefix is None else True
|
||||
|
||||
@@ -38,7 +38,8 @@ from discord import (
|
||||
Message,
|
||||
PartialMessage,
|
||||
Interaction,
|
||||
errors
|
||||
errors,
|
||||
ChannelType
|
||||
)
|
||||
|
||||
from discord.ext import commands
|
||||
@@ -851,7 +852,8 @@ class Player(VoiceProtocol):
|
||||
rv = {key: func() if callable(func) else func for key, func in self._ph.variables.items()}
|
||||
status = None if remove_status else self._ph.replace(text=template, variables=rv)
|
||||
# if self.channel.status != status:
|
||||
await self.channel.edit(status=status)
|
||||
if self.channel.type == ChannelType.voice:
|
||||
await self.channel.edit(status=status)
|
||||
|
||||
except Exception as e:
|
||||
self._logger.error(
|
||||
|
||||
Reference in New Issue
Block a user