1
0
mirror of https://github.com/azlux/botamusique synced 2024-11-23 13:56:17 +00:00

Compare commits

..

No commits in common. "508811cd2a62f60ccfe867f019ff7923af4fe2cf" and "6e3b1cb6739ec2df9341ea5975c3e1224675918c" have entirely different histories.

3 changed files with 2 additions and 15 deletions

View File

@ -29,7 +29,6 @@ certificate =
[bot]
username = botamusique
comment = "Hi, I'm here to play radio, local music or youtube/soundcloud music. Have fun!"
avatar =
# default volume from 0 to 1.
volume = 0.1
stereo = True

View File

@ -21,10 +21,8 @@ port = 64738
[bot]
# 'username' is the user name of the bot.
# 'comment' is the comment displayed by the bot.
# 'avatar' is the path to the avatar image shown on the bot (PNG recommended, 128 KB max).
#username = botamusique
#comment = "Hi, I'm here to play radio, local music or youtube/soundcloud music. Have fun!"
#avatar =
# 'language': Available languages can be found inside lang/ folder.
#language=en_US

View File

@ -127,7 +127,6 @@ class MumbleBot:
exit()
self.set_comment()
self.set_avatar()
self.mumble.users.myself.unmute() # by sure the user is not muted
self.join_channel()
self.mumble.set_bandwidth(self.bandwidth)
@ -234,15 +233,6 @@ class MumbleBot:
def set_comment(self):
self.mumble.users.myself.comment(var.config.get('bot', 'comment'))
def set_avatar(self):
avatar_path = var.config.get('bot', 'avatar', fallback=None)
if avatar_path:
with open(avatar_path, 'rb') as avatar_file:
self.mumble.users.myself.texture(avatar_file.read())
else:
self.mumble.users.myself.texture(b'')
def join_channel(self):
if self.channel:
if '/' in self.channel:
@ -740,7 +730,7 @@ def start_web_interface(addr, port):
werkzeug_logger = logging.getLogger('werkzeug')
logfile = util.solve_filepath(var.config.get('webinterface', 'web_logfile'))
if logfile:
handler = logging.handlers.RotatingFileHandler(logfile, mode='a', maxBytes=10240, backupCount=3) # Rotate after 10KB, leave 3 old logs
handler = logging.handlers.RotatingFileHandler(logfile, mode='a', maxBytes=10240) # Rotate after 10KB
else:
handler = logging.StreamHandler()
@ -823,7 +813,7 @@ if __name__ == '__main__':
handler = None
if logfile:
print(f"Redirecting stdout and stderr to log file: {logfile}")
handler = logging.handlers.RotatingFileHandler(logfile, mode='a', maxBytes=10240, backupCount=3) # Rotate after 10KB, leave 3 old logs
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)