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.
6faadd6669
...
3200c83fd0
@ -84,10 +84,7 @@ port = 64738
|
|||||||
#pip3_path = venv/bin/pip
|
#pip3_path = venv/bin/pip
|
||||||
|
|
||||||
# 'logfile': write logs into this file.
|
# '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 =
|
#logfile =
|
||||||
#redirect_strerr = False
|
|
||||||
|
|
||||||
#announce_current_music = True
|
#announce_current_music = True
|
||||||
#allow_other_channel_message = False
|
#allow_other_channel_message = False
|
||||||
|
10
mumbleBot.py
10
mumbleBot.py
@ -246,11 +246,6 @@ class MumbleBot:
|
|||||||
def message_received(self, text):
|
def message_received(self, text):
|
||||||
raw_message = text.message.strip()
|
raw_message = text.message.strip()
|
||||||
message = re.sub(r'<.*?>', '', raw_message)
|
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']
|
user = self.mumble.users[text.actor]['name']
|
||||||
|
|
||||||
if var.config.getboolean('commands', 'split_username_at_space'):
|
if var.config.getboolean('commands', 'split_username_at_space'):
|
||||||
@ -802,9 +797,8 @@ if __name__ == '__main__':
|
|||||||
if logfile:
|
if logfile:
|
||||||
print(f"Redirecting stdout and stderr to log file: {logfile}")
|
print(f"Redirecting stdout and stderr to log file: {logfile}")
|
||||||
handler = logging.handlers.RotatingFileHandler(logfile, mode='a', maxBytes=10240) # Rotate after 10KB
|
handler = logging.handlers.RotatingFileHandler(logfile, mode='a', maxBytes=10240) # Rotate after 10KB
|
||||||
if var.config.getboolean("bot", "redirect_stderr", fallback=False):
|
sys.stdout = util.LoggerIOWrapper(bot_logger, logging.INFO, fallback_io_buffer=sys.stdout.buffer)
|
||||||
sys.stderr = util.LoggerIOWrapper(bot_logger, logging.INFO,
|
sys.stderr = util.LoggerIOWrapper(bot_logger, logging.INFO, fallback_io_buffer=sys.stderr.buffer)
|
||||||
fallback_io_buffer=sys.stderr.buffer)
|
|
||||||
else:
|
else:
|
||||||
handler = logging.StreamHandler()
|
handler = logging.StreamHandler()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user