pub struct VotekickCommand;Expand description
Slash command for starting a votekick poll against a user.
Implementations§
Source§impl VotekickCommand
impl VotekickCommand
Sourceasync fn run_internal(
&self,
ctx: &Context,
command: &CommandInteraction,
config: &Config,
) -> Result<()>
async fn run_internal( &self, ctx: &Context, command: &CommandInteraction, config: &Config, ) -> Result<()>
Internal implementation of the votekick command. Validates preconditions and starts the poll if all checks pass.
Sourcefn get_user_voice_channel(
&self,
ctx: &Context,
guild_id: GuildId,
user_id: UserId,
) -> Option<ChannelId>
fn get_user_voice_channel( &self, ctx: &Context, guild_id: GuildId, user_id: UserId, ) -> Option<ChannelId>
Get the voice channel ID for a user in a guild.
Sourcefn check_target_user(
&self,
ctx: &Context,
guild_id: GuildId,
target_user_id: UserId,
user_channel_id: ChannelId,
) -> (bool, bool)
fn check_target_user( &self, ctx: &Context, guild_id: GuildId, target_user_id: UserId, user_channel_id: ChannelId, ) -> (bool, bool)
Check if target user is in the same channel and screensharing. Returns (in_same_channel, is_screensharing).
Sourceasync fn send_error(
&self,
ctx: &Context,
command: &CommandInteraction,
message: &str,
)
async fn send_error( &self, ctx: &Context, command: &CommandInteraction, message: &str, )
Send an ephemeral error response to the user.
Trait Implementations§
Source§impl SlashCommand for VotekickCommand
impl SlashCommand for VotekickCommand
Source§fn register(&self) -> CreateCommand
fn register(&self) -> CreateCommand
Register the command with Discord.
Auto Trait Implementations§
impl Freeze for VotekickCommand
impl RefUnwindSafe for VotekickCommand
impl Send for VotekickCommand
impl Sync for VotekickCommand
impl Unpin for VotekickCommand
impl UnsafeUnpin for VotekickCommand
impl UnwindSafe for VotekickCommand
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more