Support for Twilight 0.16 (#227)

This commit is contained in:
Erk
2025-01-14 08:00:34 +01:00
committed by Kyle Simpson
parent 1c52e6ebc0
commit b46a568fb5
6 changed files with 76 additions and 70 deletions

View File

@@ -8,7 +8,7 @@ use serenity::gateway::ShardRunnerMessage;
#[cfg(feature = "gateway")]
use std::{error::Error, fmt};
#[cfg(feature = "twilight")]
use twilight_gateway::error::SendError;
use twilight_gateway::error::ChannelError;
#[cfg(feature = "gateway")]
#[derive(Debug)]
@@ -48,7 +48,7 @@ pub enum JoinError {
Serenity(Box<TrySendError<ShardRunnerMessage>>),
#[cfg(feature = "twilight")]
/// Twilight-specific WebSocket send error when a message fails to send over websocket.
Twilight(SendError),
Twilight(ChannelError),
}
#[cfg(feature = "gateway")]
@@ -121,8 +121,8 @@ impl From<Box<TrySendError<ShardRunnerMessage>>> for JoinError {
}
#[cfg(all(feature = "twilight", feature = "gateway"))]
impl From<SendError> for JoinError {
fn from(e: SendError) -> Self {
impl From<ChannelError> for JoinError {
fn from(e: ChannelError) -> Self {
JoinError::Twilight(e)
}
}