Gateway: Simplify return value of join/join_gateway (#157)
Replaces the annoying dual-return (i.e., created `Call` *and* `Result<x>`) with a single `Return<Call/ConnectionInfo>`. Users are now informed via that a `Call` is created -- thus, cleanup in event of connection failure is now their responsibility. Tested using `cargo make ready`. Closes #65.
This commit is contained in:
@@ -174,9 +174,7 @@ async fn join(ctx: &Context, msg: &Message) -> CommandResult {
|
||||
.expect("Songbird Voice client placed in at initialisation.")
|
||||
.clone();
|
||||
|
||||
let (handle_lock, success) = manager.join(guild_id, connect_to).await;
|
||||
|
||||
if let Ok(_channel) = success {
|
||||
if let Ok(handle_lock) = manager.join(guild_id, connect_to).await {
|
||||
check_msg(
|
||||
msg.channel_id
|
||||
.say(&ctx.http, &format!("Joined {}", connect_to.mention()))
|
||||
|
||||
Reference in New Issue
Block a user