Fix skip command and add compile flags for release build

This commit is contained in:
hodasemi 2018-12-04 10:04:58 +01:00
parent 5a0412f3b8
commit 6e202646f4
2 changed files with 17 additions and 7 deletions

View file

@ -27,3 +27,8 @@ branch = "current"
[dependencies.parking_lot]
version = "^0.5"
[profile.release]
opt-level = 3
lto = true
codegen-units = 4

View file

@ -74,14 +74,19 @@ impl serenity::framework::standard::Command for Skip {
}
};
*song = Some(handler.play_returning(source));
let song_name = self.media.name_mut();
*song_name.borrow_mut() = first.name.clone();
match self.media.next_callback.borrow().as_ref() {
Some(callback) => {
*song = Some(handler.play_returning_and_callback(source, callback.clone()));
let song_name = self.media.name_mut();
*song_name.borrow_mut() = first.name.clone();
print_error!(
msg.channel_id
.say(format!("Skipped current song, now playing: {}", first.name))
);
print_error!(
msg.channel_id
.say(format!("Skipped current song, now playing: {}", first.name))
);
}
None => println!("error getting callback from media"),
}
}
}