From 3ead8562f130510327303f19ed751220c2661446 Mon Sep 17 00:00:00 2001 From: Azlux Date: Sat, 28 Dec 2019 01:32:20 +0100 Subject: [PATCH 1/3] Update pymumble for ipv6 support https://github.com/azlux/botamusique/issues/58 --- pymumble | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pymumble b/pymumble index 437d2eb..8ccfb0e 160000 --- a/pymumble +++ b/pymumble @@ -1 +1 @@ -Subproject commit 437d2ebec6e18b5ad69b77020596c250a5e1b785 +Subproject commit 8ccfb0e7cf7183cc6766591b985dfc1bcf5a2d37 From f2c153e582b88c47e8e19c8343f2ea406aef9299 Mon Sep 17 00:00:00 2001 From: Azlux Date: Sun, 5 Jan 2020 00:49:41 +0100 Subject: [PATCH 2/3] Fix issue bad bot anwser --- README.md | 4 ++-- configuration.default.ini | 4 +++- mumbleBot.py | 14 +++++++------- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 744b1ff..f5b3858 100644 --- a/README.md +++ b/README.md @@ -76,7 +76,7 @@ If you want information about autoStart and auto-Restart the bot, [you can have ### Custom commands You can copy the file `configuration.default.ini` to `configuration.ini` and customize all variable. Everything can be change but don't remove the default file. -you have the section : +you have the sections : - server : configuration about the server and bot name. This is overrided by the `./mumbleBot.py` parameters. - bot : basic configuration of the bot : comment, folder, volume at start .... - webinterface : basic configuration about the interface (disabled by default) @@ -110,4 +110,4 @@ The following people joined the collaborators for a faster development, big than - @slipenbois - @mertkutay -Feel free to ask me if you want to help activelly without using pull requests. +Feel free to ask me if you want to help activelly without using pull requests. diff --git a/configuration.default.ini b/configuration.default.ini index 568d470..d035fb1 100644 --- a/configuration.default.ini +++ b/configuration.default.ini @@ -105,7 +105,9 @@ no_possible = it's not possible to do that removing_item = Removing entry %s from queue user_ban = You are ban, not allowed to do that ! url_ban = This url isn't allowed ! -rbqueryresult = This is the result of your query, send !rbplay 'ID' to play a station +rb_query_result = This is the result of your query, send !rbplay 'ID' to play a station +rb_query_empty = You have to add a query text to search for a matching radio stations. +rb_play_empty = Please enter a station ID from rbquery. Example: !rbplay 96748 help = Command available:
!file [path] diff --git a/mumbleBot.py b/mumbleBot.py index 3924788..2b6fc23 100644 --- a/mumbleBot.py +++ b/mumbleBot.py @@ -56,7 +56,7 @@ type : file user """ -version = 4 +version = 5 class MumbleBot: @@ -365,13 +365,13 @@ class MumbleBot: logging.info('Querying radio stations') if not parameter: logging.debug('rbquery without parameter') - msg += 'You have to add a query text to search for a matching radio stations.' + msg = var.config.get('strings', 'rb_query_empty') self.send_msg(msg, text) else: logging.debug('Found query parameter: ' + parameter) # self.send_msg('Searching for stations - this may take some seconds...', text) rb_stations = radiobrowser.getstations_byname(parameter) - msg = var.config.get('strings', 'rbqueryresult') + " :" + msg = var.config.get('strings', 'rb_query_result') + " :" msg += '\n' if not rb_stations: logging.debug('No matches found for rbquery ' + parameter) @@ -393,7 +393,7 @@ class MumbleBot: # Shorten message if message too long (stage I) else: logging.debug('Result too long stage I') - msg = var.config.get('strings', 'rbqueryresult') + " :" + ' (shortened L1)' + msg = var.config.get('strings', 'rb_query_result') + " :" + ' (shortened L1)' msg += '\n
!rbplay IDStation NameGenreCodec/BitrateCountry
' for s in rb_stations: stationid = s['id'] @@ -406,7 +406,7 @@ class MumbleBot: # Shorten message if message too long (stage II) else: logging.debug('Result too long stage II') - msg = var.config.get('strings', 'rbqueryresult') + " :" + ' (shortened L2)' + msg = var.config.get('strings', 'rb_query_result') + " :" + ' (shortened L2)' msg += '!rbplay ID - Station Name' for s in rb_stations: stationid = s['id'] @@ -423,7 +423,7 @@ class MumbleBot: logging.debug('Play a station by ID') if not parameter: logging.debug('rbplay without parameter') - msg += 'Please enter a station ID from rbquery. Example: !rbplay 96748' + msg = var.config.get('strings', 'rb_play_empty') self.send_msg(msg, text) else: logging.debug('Retreiving url for station ID ' + parameter) @@ -885,4 +885,4 @@ if __name__ == '__main__': var.config = config var.db = db - botamusique = MumbleBot(args) \ No newline at end of file + botamusique = MumbleBot(args) From f50b660451cfc24217a07acfccb6ed0c921615a6 Mon Sep 17 00:00:00 2001 From: ajmandourah Date: Mon, 3 Feb 2020 06:47:23 +0100 Subject: [PATCH 3/3] isAlive is now deprecated --- mumbleBot.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mumbleBot.py b/mumbleBot.py index 2b6fc23..1cc2c3a 100644 --- a/mumbleBot.py +++ b/mumbleBot.py @@ -765,7 +765,7 @@ class MumbleBot: # Main loop of the Bot def loop(self): raw_music = "" - while not self.exit and self.mumble.isAlive(): + while not self.exit and self.mumble.is_alive(): while self.mumble.sound_output.get_buffer_size() > 0.5 and not self.exit: # If the buffer isn't empty, I cannot send new music part, so I wait
!rbplay IDStation Name