Skip to content

Commit a0ae907

Browse files
committed
Renormalize nicknames on startup
Should improve the bus factor a bit, assuming that nothing goes wrong with these few lines.
1 parent 2ac5e98 commit a0ae907

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

xbin/Tellable.p6

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,16 @@ multi method irc-to-me($msg where { m:r/^ \s* [[to|tell|ask] \s+]?
142142

143143
my %*BOT-ENV = %();
144144

145+
{
146+
# Renormalize on startup in case the rules were updated
147+
$db-tell.write: $db-tell.read.values».list.flat.classify: {
148+
normalize-weirdly .<to>
149+
};
150+
$db-seen.write: %($db-seen.read.values.map: {
151+
normalize-weirdly(.<nick>) => $_
152+
});
153+
}
154+
145155
Tellable.new.selfrun: tellable6, [/ [to|tell|ask|seen] 6? <before ‘:’> /,
146156
fuzzy-nick(tellable6, 1)];
147157

0 commit comments

Comments
 (0)