koishi-plugin-common
Advanced tools
Comparing version 0.1.5 to 0.1.6
@@ -5,3 +5,2 @@ "use strict"; | ||
const koishi_utils_1 = require("koishi-utils"); | ||
const BROADCAST_INTERVAL = 1000; | ||
const defaultOptions = { | ||
@@ -26,6 +25,6 @@ authority: 4, | ||
const groups = assignMap[id]; | ||
const { sender } = koishi_core_1.apps[id]; | ||
const { sender } = koishi_core_1.appMap[id]; | ||
for (let index = 0; index < groups.length; index++) { | ||
if (index) | ||
await koishi_utils_1.sleep(BROADCAST_INTERVAL); | ||
await koishi_utils_1.sleep(options.broadcastInterval); | ||
await sender.sendGroupMsg(groups[index], message); | ||
@@ -32,0 +31,0 @@ } |
{ | ||
"name": "koishi-plugin-common", | ||
"version": "0.1.5", | ||
"version": "0.1.6", | ||
"main": "dist/index.js", | ||
@@ -27,5 +27,5 @@ "typings": "dist/index.d.ts", | ||
"dependencies": { | ||
"koishi-core": "^0.2.3", | ||
"koishi-utils": "^0.1.6" | ||
"koishi-core": "^0.2.4", | ||
"koishi-utils": "^0.1.7" | ||
} | ||
} |
@@ -1,6 +0,4 @@ | ||
import { Context, apps, CommandConfig } from 'koishi-core' | ||
import { Context, appMap, CommandConfig } from 'koishi-core' | ||
import { sleep } from 'koishi-utils' | ||
const BROADCAST_INTERVAL = 1000 | ||
export interface BroadcastOptions extends CommandConfig { | ||
@@ -29,5 +27,5 @@ broadcastInterval?: number | ||
const groups = assignMap[id] | ||
const { sender } = apps[id] | ||
const { sender } = appMap[id] | ||
for (let index = 0; index < groups.length; index++) { | ||
if (index) await sleep(BROADCAST_INTERVAL) | ||
if (index) await sleep(options.broadcastInterval) | ||
await sender.sendGroupMsg(groups[index], message) | ||
@@ -34,0 +32,0 @@ } |
95141
1869
Updatedkoishi-core@^0.2.4
Updatedkoishi-utils@^0.1.7