pub struct DiscordBot { /* private fields */ }Expand description
Discord bot client.
Implementations§
Source§impl DiscordBot
impl DiscordBot
pub fn new(config: DiscordConfig) -> Self
Sourcepub fn parse_command(&self, text: &str) -> DiscordCommand
pub fn parse_command(&self, text: &str) -> DiscordCommand
Parse a prefix-based command (!run, !workflows, etc.).
Sourcepub fn parse_command_with_prefix(text: &str, prefix: &str) -> DiscordCommand
pub fn parse_command_with_prefix(text: &str, prefix: &str) -> DiscordCommand
Parse a command with a given prefix.
Sourcepub fn slash_commands() -> Vec<SlashCommand>
pub fn slash_commands() -> Vec<SlashCommand>
Build the list of slash commands for registration.
Sourcepub async fn register_slash_commands(
&self,
guild_id: Option<&str>,
) -> Result<()>
pub async fn register_slash_commands( &self, guild_id: Option<&str>, ) -> Result<()>
Register slash commands with Discord for a guild (or globally).
Sourcepub fn parse_approval_reaction(emoji: &str) -> ApprovalReaction
pub fn parse_approval_reaction(emoji: &str) -> ApprovalReaction
Interpret a reaction emoji as an approval decision.
Trait Implementations§
Source§impl ChatPlatform for DiscordBot
impl ChatPlatform for DiscordBot
Source§async fn send_message(&self, msg: &OutgoingMessage) -> Result<String>
async fn send_message(&self, msg: &OutgoingMessage) -> Result<String>
Send a message to a channel.
Source§async fn send_approval(
&self,
channel_id: &str,
request: &ApprovalRequest,
) -> Result<String>
async fn send_approval( &self, channel_id: &str, request: &ApprovalRequest, ) -> Result<String>
Send an approval request with interactive buttons.
Source§async fn update_message(
&self,
channel_id: &str,
message_id: &str,
text: &str,
) -> Result<()>
async fn update_message( &self, channel_id: &str, message_id: &str, text: &str, ) -> Result<()>
Update an existing message.
Source§async fn add_reaction(
&self,
channel_id: &str,
message_id: &str,
emoji: &str,
) -> Result<()>
async fn add_reaction( &self, channel_id: &str, message_id: &str, emoji: &str, ) -> Result<()>
React to a message with an emoji.
Source§async fn send_progress(
&self,
channel_id: &str,
thread_id: &str,
progress: &ProgressUpdate,
) -> Result<String>
async fn send_progress( &self, channel_id: &str, thread_id: &str, progress: &ProgressUpdate, ) -> Result<String>
Send a progress update (step started/completed) in a thread.
Source§async fn send_notification(
&self,
channel_id: &str,
thread_id: Option<&str>,
notification: &WorkflowNotification,
) -> Result<String>
async fn send_notification( &self, channel_id: &str, thread_id: Option<&str>, notification: &WorkflowNotification, ) -> Result<String>
Send a workflow completion/failure notification.
Auto Trait Implementations§
impl Freeze for DiscordBot
impl !RefUnwindSafe for DiscordBot
impl Send for DiscordBot
impl Sync for DiscordBot
impl Unpin for DiscordBot
impl UnsafeUnpin for DiscordBot
impl !UnwindSafe for DiscordBot
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