hotcat-bot-qq 0.1.1 → 0.1.2
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/package.json
CHANGED
|
@@ -13,7 +13,6 @@ export class HotCatPlugin extends PluginBase {
|
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
private startTime = 0
|
|
16
|
-
private enabled = false
|
|
17
16
|
|
|
18
17
|
static create(api: BotApi, bot: BotClient) {
|
|
19
18
|
return new HotCatPlugin(api, bot)
|
|
@@ -21,16 +20,14 @@ export class HotCatPlugin extends PluginBase {
|
|
|
21
20
|
|
|
22
21
|
async load() {
|
|
23
22
|
this.startTime = Date.now()
|
|
24
|
-
this.
|
|
25
|
-
this.bot.event.message.onGroupMessage(this.onGroupMsg)
|
|
23
|
+
this.api.napcat.on('message.group', this.onGroupMsg)
|
|
26
24
|
}
|
|
27
25
|
|
|
28
26
|
async unload() {
|
|
29
|
-
this.
|
|
27
|
+
this.api.napcat.off('message.group', this.onGroupMsg)
|
|
30
28
|
}
|
|
31
29
|
|
|
32
|
-
private onGroupMsg = async (
|
|
33
|
-
if (!this.enabled) return
|
|
30
|
+
private onGroupMsg = async (event: any) => {
|
|
34
31
|
const msg = event.raw_message.trim()
|
|
35
32
|
|
|
36
33
|
if (msg === '#hotCat' || msg === '#hotcat') {
|