Merge pull request #107 from HerHde/master
Extract channel_join logic into seperate method
This commit is contained in:
commit
91f603c15e
@ -611,8 +611,7 @@ def cmd_stop_and_getout(bot, user, text, command, parameter):
|
|||||||
if var.playlist.mode == "one-shot":
|
if var.playlist.mode == "one-shot":
|
||||||
var.playlist.clear()
|
var.playlist.clear()
|
||||||
|
|
||||||
if bot.channel:
|
bot.join_channel()
|
||||||
bot.mumble.channels.find_by_name(bot.channel).move_in()
|
|
||||||
|
|
||||||
|
|
||||||
def cmd_volume(bot, user, text, command, parameter):
|
def cmd_volume(bot, user, text, command, parameter):
|
||||||
|
13
mumbleBot.py
13
mumbleBot.py
@ -131,11 +131,7 @@ class MumbleBot:
|
|||||||
self.mumble.is_ready() # wait for the connection
|
self.mumble.is_ready() # wait for the connection
|
||||||
self.set_comment()
|
self.set_comment()
|
||||||
self.mumble.users.myself.unmute() # by sure the user is not muted
|
self.mumble.users.myself.unmute() # by sure the user is not muted
|
||||||
if self.channel:
|
self.join_channel()
|
||||||
if '/' in self.channel:
|
|
||||||
self.mumble.channels.find_by_tree(channel.split('/')).move_in()
|
|
||||||
else:
|
|
||||||
self.mumble.channels.find_by_name(self.channel).move_in()
|
|
||||||
self.mumble.set_bandwidth(200000)
|
self.mumble.set_bandwidth(200000)
|
||||||
|
|
||||||
self.is_ducking = False
|
self.is_ducking = False
|
||||||
@ -197,6 +193,13 @@ class MumbleBot:
|
|||||||
def set_comment(self):
|
def set_comment(self):
|
||||||
self.mumble.users.myself.comment(var.config.get('bot', 'comment'))
|
self.mumble.users.myself.comment(var.config.get('bot', 'comment'))
|
||||||
|
|
||||||
|
def join_channel(self):
|
||||||
|
if self.channel:
|
||||||
|
if '/' in self.channel:
|
||||||
|
self.mumble.channels.find_by_tree(self.channel.split('/')).move_in()
|
||||||
|
else:
|
||||||
|
self.mumble.channels.find_by_name(self.channel).move_in()
|
||||||
|
|
||||||
# =======================
|
# =======================
|
||||||
# Message
|
# Message
|
||||||
# =======================
|
# =======================
|
||||||
|
Loading…
x
Reference in New Issue
Block a user