From 84804836f5c1e782c77f1bbf676177151558e008 Mon Sep 17 00:00:00 2001 From: Jokler Date: Sat, 22 Feb 2020 22:46:06 +0100 Subject: Add tmtu mode as a front-end --- src/bot/master.rs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src/bot/master.rs') diff --git a/src/bot/master.rs b/src/bot/master.rs index 67867ef..9b33744 100644 --- a/src/bot/master.rs +++ b/src/bot/master.rs @@ -222,6 +222,7 @@ impl MasterBot { name: name, state: bot.state(), volume: bot.volume(), + position: bot.position(), currently_playing: bot.currently_playing(), playlist: bot.playlist_to_vec(), }) @@ -237,6 +238,7 @@ impl MasterBot { name: name.clone(), state: bot.state(), volume: bot.volume(), + position: bot.position(), currently_playing: bot.currently_playing(), playlist: bot.playlist_to_vec(), }; @@ -247,6 +249,18 @@ impl MasterBot { result } + pub fn bot_names(&self) -> Vec { + let music_bots = self.music_bots.read().unwrap(); + + let len = music_bots.connected_bots.len(); + let mut result = Vec::with_capacity(len); + for (name, _) in &music_bots.connected_bots { + result.push(name.clone()); + } + + result + } + pub fn quit(&self, reason: String) { let music_bots = self.music_bots.read().unwrap(); for (_, bot) in &music_bots.connected_bots { @@ -267,6 +281,8 @@ pub struct MasterArgs { pub channel: Option, #[serde(default = "default_verbose")] pub verbose: u8, + pub domain: String, + pub bind_address: String, pub names: Vec, pub id: Identity, pub ids: Vec, @@ -301,6 +317,8 @@ impl MasterArgs { ids: self.ids, local, address, + domain: self.domain, + bind_address: self.bind_address, id: self.id, channel, verbose, -- cgit v1.2.3-70-g09d2