Gateway: Introduce Call::current_channel (#60)

* Introduce Call::current_channel

* Add note on channel id
This commit is contained in:
Douman
2021-04-10 15:19:59 +03:00
committed by GitHub
parent df64ad92e5
commit 22214a0f89

View File

@@ -240,6 +240,19 @@ impl Call {
}
}
/// Returns `id` of the channel, if connected to any.
///
/// **Note:**: Returned `id` is of the channel, to which bot performed connection.
/// It is possible that it is different from actual channel due to ability of server's admin to
/// move bot from channel to channel. This is to be fixed with next breaking change release.
#[instrument(skip(self))]
pub fn current_channel(&self) -> Option<ChannelId> {
match &self.connection {
Some((id, _, _)) => Some(*id),
_ => None,
}
}
/// Leaves the current voice channel, disconnecting from it.
///
/// This does _not_ forget settings, like whether to be self-deafened or