Skip to content

Commit

Permalink
Renormalize nicknames on startup
Browse files Browse the repository at this point in the history
Should improve the bus factor a bit, assuming that nothing goes wrong
with these few lines.
  • Loading branch information
AlexDaniel committed Aug 16, 2019
1 parent 2ac5e98 commit a0ae907
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions xbin/Tellable.p6
Expand Up @@ -142,6 +142,16 @@ multi method irc-to-me($msg where { m:r/^ \s* [[to|tell|ask] \s+]?

my %*BOT-ENV = %();

{
# Renormalize on startup in case the rules were updated
$db-tell.write: $db-tell.read.values».list.flat.classify: {
normalize-weirdly .<to>
};
$db-seen.write: %($db-seen.read.values.map: {
normalize-weirdly(.<nick>) => $_
});
}

Tellable.new.selfrun: tellable6, [/ [to|tell|ask|seen] 6? <before ‘:’> /,
fuzzy-nick(tellable6, 1)];

Expand Down

0 comments on commit a0ae907

Please sign in to comment.