MCPcopy Create free account
hub / github.com/Botloader/botloader / parse_discord_id

Function parse_discord_id

components/runtime/src/extensions/mod.rs:25–31  ·  view source on GitHub ↗
(input: &str)

Source from the content-addressed store, hash-verified

23pub mod tasks;
24
25pub(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
34pub(crate) async fn parse_get_guild_channel(

Calls

no outgoing calls

Tested by

no test coverage detected