aboutsummaryrefslogtreecommitdiffstats
path: root/src/bot/master.rs
diff options
context:
space:
mode:
authorJokler <jokler@protonmail.com>2020-02-22 22:46:06 +0100
committerJokler <jokler@protonmail.com>2020-02-22 23:20:10 +0100
commit84804836f5c1e782c77f1bbf676177151558e008 (patch)
tree55f0ee9664018f6ed0cc41d2cfcf13ca3e0ffe60 /src/bot/master.rs
parent5eea11a03c11551091b2c72f48590aec7f5410f0 (diff)
downloadpokebot-84804836f5c1e782c77f1bbf676177151558e008.tar.gz
pokebot-84804836f5c1e782c77f1bbf676177151558e008.zip
Add tmtu mode as a front-end
Diffstat (limited to 'src/bot/master.rs')
-rw-r--r--src/bot/master.rs18
1 files changed, 18 insertions, 0 deletions
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<String> {
+ 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<String>,
#[serde(default = "default_verbose")]
pub verbose: u8,
+ pub domain: String,
+ pub bind_address: String,
pub names: Vec<String>,
pub id: Identity,
pub ids: Vec<Identity>,
@@ -301,6 +317,8 @@ impl MasterArgs {
ids: self.ids,
local,
address,
+ domain: self.domain,
+ bind_address: self.bind_address,
id: self.id,
channel,
verbose,