From d61567094447069061fcce7f8d243cff0e5b3283 Mon Sep 17 00:00:00 2001 From: suxb201 Date: Thu, 22 Sep 2022 14:38:01 +0800 Subject: [PATCH] add key_prefix.lua --- filters/key_prefix.lua | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 filters/key_prefix.lua diff --git a/filters/key_prefix.lua b/filters/key_prefix.lua new file mode 100644 index 00000000..e17d18c2 --- /dev/null +++ b/filters/key_prefix.lua @@ -0,0 +1,12 @@ +-- skip keys prefixed with ABC +function filter(id, is_base, group, cmd_name, keys, slots, db_id, timestamp_ms) + if #keys ~= 1 then + return 0, db_id -- allow + end + + if string.sub(keys[1], 0, 3) == "ABC" then + return 1, db_id -- disallow + end + + return 0, db_id -- allow +end \ No newline at end of file