From af00e0c9d92794345a2334fa55cab32c0b9ecdcc Mon Sep 17 00:00:00 2001 From: Yessiest Date: Sun, 8 May 2022 22:42:55 +0400 Subject: [PATCH] Changed behaviour of infraction paging --- plugins/security/init.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/security/init.lua b/plugins/security/init.lua index f6751e3..36fa3e6 100644 --- a/plugins/security/init.lua +++ b/plugins/security/init.lua @@ -98,7 +98,7 @@ local infractions = command("infractions", { title = "List user infractions", description = "Infractions include kicks, bans, mutes and warnings.", fields = { - {name = "Usage: ", value = "infractions []"}, + {name = "Usage: ", value = "infractions []"}, {name = "Perms: ", value = "kick_members"}, {name = "Options: ", value = "--type=(warn default,ban,kick)"} } @@ -123,13 +123,13 @@ local infractions = command("infractions", { title = "Infractions list for "..args[1].name, fields = {}, footer = { - text = "Total: "..tostring(tonumber(v[1])).." | Page: "..tostring(page) + text = "Total: "..tostring(tonumber(v[1])).." | Starting from: "..tostring(page) } }} -- Prepare a statement to match infractions local pagedb = db:prepare("SELECT * FROM infractions WHERE action = ? AND user = ? AND id > ? ORDER BY id LIMIT 5") - local pagecomm = pagedb:reset():bind(dtype,tostring(args[1].id),5*page) + local pagecomm = pagedb:reset():bind(dtype,tostring(args[1].id),page) -- Keep matching infractions as long as something is returned local pagedata = pagecomm:step() while pagedata ~= nil do