You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
521 B
23 lines
521 B
class ReactionInfo {
|
|
final String targetMessageId;
|
|
final String emoji;
|
|
|
|
ReactionInfo({
|
|
required this.targetMessageId,
|
|
required this.emoji,
|
|
});
|
|
}
|
|
|
|
class ReactionHelper {
|
|
/// Parse reaction format: r:[messageId]:[emoji]
|
|
static ReactionInfo? parseReaction(String text) {
|
|
final regex = RegExp(r'^r:([^:]+):(.+)$');
|
|
final match = regex.firstMatch(text);
|
|
if (match == null) return null;
|
|
return ReactionInfo(
|
|
targetMessageId: match.group(1)!,
|
|
emoji: match.group(2)!,
|
|
);
|
|
}
|
|
}
|