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.
Files changed (2) hide show
  1. package/lib/index.js +13 -5
  2. 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
- return await handleRCommand(session, args);
284
+ result = await handleRCommand(session, args);
285
+ break;
284
286
  case "ra":
285
- return await handleRACommand(session, args);
287
+ result = await handleRACommand(session, args);
288
+ break;
286
289
  case "rb":
287
- return await handleRBCommand(session, args);
290
+ result = await handleRBCommand(session, args);
291
+ break;
288
292
  case "rp":
289
- return await handleRPCommand(session, args);
293
+ result = await handleRPCommand(session, args);
294
+ break;
295
+ }
296
+ if (result) {
297
+ session.send(result);
290
298
  }
291
299
  } catch (error) {
292
- return `错误: ${error.message}`;
300
+ session.send(`错误: ${error.message}`);
293
301
  }
294
302
  }
295
303
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "koishi-plugin-maple-dice-v2",
3
3
  "description": "-",
4
- "version": "0.0.6",
4
+ "version": "0.0.7",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",
7
7
  "files": [