Gateway: Introduce Call::current_channel (#60)
* Introduce Call::current_channel * Add note on channel id
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user