Skip to content

Commit

Permalink
Tellable: format CTCP ACTION
Browse files Browse the repository at this point in the history
Closes #360
  • Loading branch information
taboege committed Sep 18, 2019
1 parent 9c25608 commit a600ecb
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
8 changes: 7 additions & 1 deletion xbin/Tellable.p6
Expand Up @@ -131,7 +131,13 @@ multi method irc-to-me($msg where { m:r/^ \s* [seen \s+]?
return I haven't seen $who around
~ maybe , did you mean %s?, did-you-mean-seen $who, %seen
}
I saw $who $entry<timestamp> in $entry<channel>: <$entry<nick>> $entry<text>

# Format CTCP ACTION aka /me
my $said = $entry<text> ~~ /^ \x[01] ‘ACTION ’ <( .* )> \x[01] $/ ??
* $entry<nick> $/ !!
<$entry<nick>> $entry<text>;

I saw $who $entry<timestamp> in $entry<channel>: $said
}

#| tell
Expand Down
9 changes: 9 additions & 0 deletions xt/tellable.t
Expand Up @@ -103,6 +103,15 @@ $t.test(‘.seen (normalization, doubled letters)’,
);


# CTCP ACTION

$t.test(:!both, send a /me, \x[01]ACTION waves\x[01]);

$t.test(:!both, .seen a /me,
.seen {$t.our-nick},
/^ <me($t)>‘, I saw ’<me($t)>‘ 2’\S+‘Z in #whateverable_tellable6: * ’<me($t)>‘ waves’ $/
);


# Tell

Expand Down

0 comments on commit a600ecb

Please sign in to comment.