(input: &str)
| 23 | pub mod tasks; |
| 24 | |
| 25 | pub(crate) fn parse_discord_id<T>(input: &str) -> Result<Id<T>, AnyError> { |
| 26 | if let Some(id) = Id::new_checked(input.parse()?) { |
| 27 | Ok(id) |
| 28 | } else { |
| 29 | Err(anyhow::anyhow!("invalid discord snowflake")) |
| 30 | } |
| 31 | } |
| 32 | |
| 33 | // ensures the provided channel is in the guild, also checking the api as fallback |
| 34 | pub(crate) async fn parse_get_guild_channel( |
no outgoing calls
no test coverage detected