Function wicrs_server::api::send_message[][src]

pub async fn send_message<S: Into<String>>(
    user_id: &ID,
    hub_id: &ID,
    channel_id: &ID,
    message: S
) -> Result<Message>

Sends a message in a text channel in a hub. Returns the message if successful.

Arguments

  • user_id - ID of the user who is sending the message.
  • hub_id - ID of the hub where the message is being sent.
  • channel_id - ID of the channel where the message is being sent.
  • message - The actual message to be sent.

Errors

This function may return an error for any of the following reasons:

  • The user is not in the hub.
  • The message is too big (maximum size in bytes is determined by crate::MESSAGE_MAX_SIZE).
  • The message could not be sent for any of the reasons outlined by Hub::send_message.
  • The channel could not be gotten for any of the reasons outlined by Hub::get_channel.
  • The hub could not be loaded for any of the reasons outlined by Hub::load.