Function serenity::utils::parse_message_id_pair[][src]

pub fn parse_message_id_pair(s: &str) -> Option<(ChannelId, MessageId)>
Expand description

Retrieves IDs from “{channel ID}-{message ID}” (retrieved by shift-clicking on “Copy ID”).

If the string is invalid, None is returned.

Examples

use serenity::model::prelude::*;
use serenity::utils::parse_message_id_pair;

assert_eq!(
    parse_message_id_pair("673965002805477386-842482646604972082"),
    Some((ChannelId(673965002805477386), MessageId(842482646604972082))),
);
assert_eq!(
    parse_message_id_pair("673965002805477386-842482646604972082-472029906943868929"),
    None,
);