feat(bot): basic webhook username templating

This commit is contained in:
libglfw 2024-10-22 03:05:32 -04:00 committed by Iris System
parent 87196e3297
commit 4248b7bc32
16 changed files with 78 additions and 14 deletions

View file

@ -86,4 +86,10 @@ public static class StringUtils
return output;
}
// Lightweight formatting that intentionally is very basic to not have silly things like in-template for loops like other templating engines seem to have
// Currently doesn't handle escapes which might cause problems
public static string SafeFormat(string template, (string pattern, string arg)[] args) =>
args
.Aggregate(template, (acc, x) => acc.Replace(x.pattern, x.arg));
}