1
0
mirror of https://github.com/azlux/botamusique synced 2024-11-23 22:06:09 +00:00

Compare commits

..

No commits in common. "6faadd6669aa27f1c65bf7327f2b2eccf6b15255" and "3200c83fd0e9415c3aa4c7cd1d7cd5036f6ca2bd" have entirely different histories.

2 changed files with 2 additions and 11 deletions

View File

@ -84,10 +84,7 @@ port = 64738
#pip3_path = venv/bin/pip
# 'logfile': write logs into this file.
# 'redirect_strerr': capture outputs from stderr and write into the `logfile`,
# useful for capture the exception message when the bot crash.
#logfile =
#redirect_strerr = False
#announce_current_music = True
#allow_other_channel_message = False

View File

@ -246,11 +246,6 @@ class MumbleBot:
def message_received(self, text):
raw_message = text.message.strip()
message = re.sub(r'<.*?>', '', raw_message)
if text.actor == 0:
# Some server will send a welcome message to the bot once connected.
# It doesn't have a valid "actor". Simply ignore it here.
return
user = self.mumble.users[text.actor]['name']
if var.config.getboolean('commands', 'split_username_at_space'):
@ -802,9 +797,8 @@ if __name__ == '__main__':
if logfile:
print(f"Redirecting stdout and stderr to log file: {logfile}")
handler = logging.handlers.RotatingFileHandler(logfile, mode='a', maxBytes=10240) # Rotate after 10KB
if var.config.getboolean("bot", "redirect_stderr", fallback=False):
sys.stderr = util.LoggerIOWrapper(bot_logger, logging.INFO,
fallback_io_buffer=sys.stderr.buffer)
sys.stdout = util.LoggerIOWrapper(bot_logger, logging.INFO, fallback_io_buffer=sys.stdout.buffer)
sys.stderr = util.LoggerIOWrapper(bot_logger, logging.INFO, fallback_io_buffer=sys.stderr.buffer)
else:
handler = logging.StreamHandler()