pub struct Utils;Expand description
Utility struct for common Discord bot operations
Implementations§
Source§impl Utils
impl Utils
Sourcepub async fn ephemeral_response(
http: &Http,
command: &CommandInteraction,
content: impl Into<String>,
)
pub async fn ephemeral_response( http: &Http, command: &CommandInteraction, content: impl Into<String>, )
Send an ephemeral (only visible to the user) response to a command interaction
Sourcepub async fn register_commands(
ctx: &Context,
guild_id: Option<GuildId>,
commands: Vec<CreateCommand>,
)
pub async fn register_commands( ctx: &Context, guild_id: Option<GuildId>, commands: Vec<CreateCommand>, )
Register slash commands with Discord If guild_id is provided, registers commands for that guild (instant update) Otherwise registers global commands (can take up to 1 hour to propagate)
Auto Trait Implementations§
impl Freeze for Utils
impl RefUnwindSafe for Utils
impl Send for Utils
impl Sync for Utils
impl Unpin for Utils
impl UnsafeUnpin for Utils
impl UnwindSafe for Utils
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