Function serenity::utils::parse_user_tag[][src]

pub fn parse_user_tag(s: &str) -> Option<(&str, u16)>
Expand description

Retrieves the username and discriminator out of a user tag (name#discrim).

If the user tag is invalid, None is returned.

Examples

use serenity::utils::parse_user_tag;

assert_eq!(parse_user_tag("kangalioo#9108"), Some(("kangalioo", 9108)));
assert_eq!(parse_user_tag("kangalioo#10108"), None);