koishi-plugin-maple-dice-v2 0.0.6 → 0.0.7
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/index.js +13 -5
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -278,18 +278,26 @@ function apply(ctx, config) {
|
|
|
278
278
|
const diceCommands = ["r", "ra", "rb", "rp"];
|
|
279
279
|
if (diceCommands.includes(commandName)) {
|
|
280
280
|
try {
|
|
281
|
+
let result = "";
|
|
281
282
|
switch (commandName) {
|
|
282
283
|
case "r":
|
|
283
|
-
|
|
284
|
+
result = await handleRCommand(session, args);
|
|
285
|
+
break;
|
|
284
286
|
case "ra":
|
|
285
|
-
|
|
287
|
+
result = await handleRACommand(session, args);
|
|
288
|
+
break;
|
|
286
289
|
case "rb":
|
|
287
|
-
|
|
290
|
+
result = await handleRBCommand(session, args);
|
|
291
|
+
break;
|
|
288
292
|
case "rp":
|
|
289
|
-
|
|
293
|
+
result = await handleRPCommand(session, args);
|
|
294
|
+
break;
|
|
295
|
+
}
|
|
296
|
+
if (result) {
|
|
297
|
+
session.send(result);
|
|
290
298
|
}
|
|
291
299
|
} catch (error) {
|
|
292
|
-
|
|
300
|
+
session.send(`错误: ${error.message}`);
|
|
293
301
|
}
|
|
294
302
|
}
|
|
295
303
|
}
|