(&self, arg: UpdateThread)
| 1019 | } |
| 1020 | |
| 1021 | async fn discord_edit_thread(&self, arg: UpdateThread) -> Result<GuildChannel, anyhow::Error> { |
| 1022 | let rt_ctx = get_rt_ctx(&self.state); |
| 1023 | let channel = parse_get_guild_channel(&self.state, &rt_ctx, &arg.channel_id).await?; |
| 1024 | |
| 1025 | Ok(discord_request_with_extra_error(&self.state, async move { |
| 1026 | let mut req = rt_ctx.discord_config.client.update_thread(channel.id); |
| 1027 | |
| 1028 | let maybe_tags: Option<Vec<Id<TagMarker>>> = arg.tag_ids.map(|v| { |
| 1029 | v.into_iter() |
| 1030 | .filter_map(|string_id| parse_discord_id(&string_id).ok()) |
| 1031 | .collect() |
| 1032 | }); |
| 1033 | |
| 1034 | if let Some(tags) = &maybe_tags { |
| 1035 | req = req.applied_tags(Some(tags)); |
| 1036 | } |
| 1037 | |
| 1038 | if let Some(archived) = arg.archived { |
| 1039 | req = req.archived(archived); |
| 1040 | } |
| 1041 | |
| 1042 | if let Some(auto_archive_duration_minutes) = arg.auto_archive_duration_minutes { |
| 1043 | req = req.auto_archive_duration(auto_archive_duration_minutes.into()) |
| 1044 | } |
| 1045 | |
| 1046 | if let Some(invitable) = arg.invitable { |
| 1047 | req = req.invitable(invitable) |
| 1048 | } |
| 1049 | |
| 1050 | if let Some(locked) = arg.locked { |
| 1051 | req = req.locked(locked) |
| 1052 | } |
| 1053 | |
| 1054 | if let Some(name) = &arg.name { |
| 1055 | req = req.name(name); |
| 1056 | } |
| 1057 | |
| 1058 | if let Some(rate_limit_per_user) = &arg.rate_limit_per_user { |
| 1059 | req = req.rate_limit_per_user(*rate_limit_per_user); |
| 1060 | } |
| 1061 | |
| 1062 | Ok(req.await) |
| 1063 | }) |
| 1064 | .await? |
| 1065 | .model() |
| 1066 | .await? |
| 1067 | .try_into()?) |
| 1068 | } |
| 1069 | |
| 1070 | async fn discord_bulk_edit_channels( |
| 1071 | &self, |
nothing calls this directly
no test coverage detected