adb-plugin-moderation 1.2.0 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/logCase.js CHANGED
@@ -29,6 +29,7 @@ async function createCase(CaseModel, { guildId, type, targetId, moderatorId, rea
29
29
  caseNumber,
30
30
  type,
31
31
  targetUserId: targetId,
32
+ userId: targetId,
32
33
  moderatorId,
33
34
  reason: reason || "No reason provided",
34
35
  duration: duration || null,
package/models/case.js CHANGED
@@ -11,6 +11,9 @@ const CaseSchema = new Schema({
11
11
  required: true,
12
12
  },
13
13
  targetUserId: { type: String, required: true },
14
+ // Same value as targetUserId; duplicated so the platform's member-scope
15
+ // query ({guildId, userId}) can find a member's own cases.
16
+ userId: { type: String, default: null, index: true },
14
17
  moderatorId: { type: String, required: true },
15
18
  reason: { type: String, default: "No reason provided" },
16
19
  duration: { type: String, default: null },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "adb-plugin-moderation",
3
- "version": "1.2.0",
3
+ "version": "1.3.0",
4
4
  "description": "Core moderation commands for Advanced Discord Bot",
5
5
  "main": "index.js",
6
6
  "files": [
package/plugin.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "adb-plugin-moderation",
3
3
  "displayName": "Basic Moderation",
4
- "version": "1.2.0",
4
+ "version": "1.3.0",
5
5
  "description": "Core moderation commands: ban, kick, timeout, warn, purge, tickets, and case logging.",
6
6
  "author": "DeadIndian",
7
7
  "main": "index.js",
@@ -108,6 +108,43 @@
108
108
  "ManageMessages",
109
109
  "ManageChannels"
110
110
  ],
111
+ "webUi": {
112
+ "memberPages": [
113
+ {
114
+ "path": "/me/mod-record",
115
+ "label": "My Mod Record",
116
+ "icon": "Shield",
117
+ "source": { "model": "Case", "scope": "member", "sort": { "createdAt": -1 }, "limit": 100 },
118
+ "view": {
119
+ "type": "table",
120
+ "empty": "You have a clean record in this server.",
121
+ "columns": [
122
+ { "field": "caseNumber", "label": "Case" },
123
+ { "field": "type", "label": "Type" },
124
+ { "field": "reason", "label": "Reason" },
125
+ { "field": "active", "label": "Active" },
126
+ { "field": "createdAt", "label": "Date" }
127
+ ]
128
+ }
129
+ },
130
+ {
131
+ "path": "/me/tickets",
132
+ "label": "My Tickets",
133
+ "icon": "LifeBuoy",
134
+ "source": { "model": "Ticket", "scope": "member", "sort": { "createdAt": -1 }, "limit": 50 },
135
+ "view": {
136
+ "type": "table",
137
+ "empty": "You have no tickets in this server.",
138
+ "columns": [
139
+ { "field": "reason", "label": "Reason" },
140
+ { "field": "status", "label": "Status" },
141
+ { "field": "createdAt", "label": "Opened" },
142
+ { "field": "closedAt", "label": "Closed" }
143
+ ]
144
+ }
145
+ }
146
+ ]
147
+ },
111
148
  "configSchema": {
112
149
  "type": "object",
113
150
  "properties": {