mirror of
https://github.com/PHIDIAS0303/ExpCluster.git
synced 2026-11-17 08:50:42 +09:00
Move the report commands into exp_reports
The create-report, get-reports and clear-reports commands now live in the plugin's own module next to the functions they call, with their locale. The permissions keep their exp_scenario.command names because the command authority derives them from the command name. The Discord report alert in exp_scenario is gone since exp_reports posts to its own webhook. The shared add_player stub takes an options table with connected and admin defaulting to true and false, replacing the copy in the exp_reports test environment. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
e47f41d440
commit
9ddb7b362b
20 files changed
+95
-155
No files matched your search
@@ -1,8 +1,8 @@
|
||||
local Suite = ... --- @type Suite<ExpReports.TestEnv>
|
||||
|
||||
Suite.test("create_report() sends the report to the controller", function(env)
|
||||
local alice = env.add_player("alice")
|
||||
local bob = env.add_player("bob")
|
||||
local alice = env.add_player{ name = "alice" }
|
||||
local bob = env.add_player{ name = "bob" }
|
||||
env.Reports.create_report(alice, bob, "griefing")
|
||||
Suite.eq(env.sent, {
|
||||
{ channel = "exp_reports:create", data = { player_name = "bob", by_player_name = "alice", reason = "griefing" } },
|
||||
@@ -10,8 +10,8 @@ Suite.test("create_report() sends the report to the controller", function(env)
|
||||
end)
|
||||
|
||||
Suite.test("list_reports() sends the caller and the player", function(env)
|
||||
local alice = env.add_player("alice")
|
||||
local bob = env.add_player("bob")
|
||||
local alice = env.add_player{ name = "alice" }
|
||||
local bob = env.add_player{ name = "bob" }
|
||||
env.Reports.list_reports(alice, bob)
|
||||
env.Reports.list_reports(alice)
|
||||
Suite.eq(env.sent, {
|
||||
@@ -21,8 +21,8 @@ Suite.test("list_reports() sends the caller and the player", function(env)
|
||||
end)
|
||||
|
||||
Suite.test("delete_reports() sends the caller, the player and the reporter", function(env)
|
||||
local alice = env.add_player("alice")
|
||||
local bob = env.add_player("bob")
|
||||
local alice = env.add_player{ name = "alice" }
|
||||
local bob = env.add_player{ name = "bob" }
|
||||
env.Reports.delete_reports(alice, bob, "carol")
|
||||
env.Reports.delete_reports(alice, bob)
|
||||
Suite.eq(env.sent, {
|
||||
|
||||
Reference in new issue
Block a user