Function wicrs_server::api::change_channel_description[][src]

pub async fn change_channel_description<S: Into<String> + Clone>(
    user_id: &str,
    hub_id: ID,
    channel_id: ID,
    new_description: S
) -> Result<String>
Expand description

Renames a text channel in a hub. Returns the previous name of the channel if successful.

Arguments

  • user_id - ID of the user to check for permission to rename the channel.
  • hub_id - ID of the hub that has the channel.
  • channel_id - ID of the channel to be renamed.
  • new_name - New name for the channel.

Errors

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

  • THe user is not in the hub.
  • The name failed to pass the checks for any of the reasons outlined in check_name_validity.
  • The hub could not be loaded for any of the reasons outlined by Hub::load.
  • The hub could not be saved for any of the reasons outlined by Hub::save.
  • The user does not have permission to rename channels.
  • The channel could not be renamed for any of the reasons outlined by Hub::rename_channel.