@atri-bot/plugin-the-cake-is-a-lie 1.1.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/CHANGELOG.md +7 -0
- package/README.md +3 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.js +1 -0
- package/package.json +21 -0
- package/src/index.ts +30 -0
- package/tsconfig.json +7 -0
- package/tsup.config.ts +11 -0
package/CHANGELOG.md
ADDED
package/README.md
ADDED
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{BasePlugin as l}from"@atri-bot/core";import{Structs as e}from"node-napcat-ts";var a=class extends l{pluginName="the_cake_is_a_lie";auto_load_config=!1;load(){this.regMessageEvent({regexp:/^(the cake is a lie|蛋糕是个谎言)$/i,callback:this.cake_is_a_lie.bind(this)})}unload(){}messages=[e.text("You Will Be Baked, And Then There Will Be Cake"),e.music("163",2005125394),e.text("But The Cake Is A Lie")];async cake_is_a_lie({context:s}){this.messages.forEach(async(t,i)=>{setTimeout(async()=>{await this.bot.sendMsg(s,[t],{reply:!1,at:!1})},i*1e3)})}};export{a as Plugin};
|
package/package.json
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@atri-bot/plugin-the-cake-is-a-lie",
|
|
3
|
+
"version": "1.1.0",
|
|
4
|
+
"description": "the cake is a lie plugin for atri framework",
|
|
5
|
+
"author": "huan_kong",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"type": "module",
|
|
8
|
+
"scripts": {
|
|
9
|
+
"build": "pnpm run type-check && pnpm run lint && tsup",
|
|
10
|
+
"clean": "rimraf dist",
|
|
11
|
+
"lint": "eslint",
|
|
12
|
+
"lint:fix": "eslint --fix",
|
|
13
|
+
"type-check": "tsc --noEmit -p tsconfig.json --composite false"
|
|
14
|
+
},
|
|
15
|
+
"dependencies": {
|
|
16
|
+
"@atri-bot/core": "^1.1.4",
|
|
17
|
+
"@huan_kong/logger": "^1.0.6",
|
|
18
|
+
"commander": "^14.0.0",
|
|
19
|
+
"node-napcat-ts": "^0.4.19"
|
|
20
|
+
}
|
|
21
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { BasePlugin, type MessageCallback } from '@atri-bot/core'
|
|
2
|
+
import { Structs, type SendMessageSegment } from 'node-napcat-ts'
|
|
3
|
+
|
|
4
|
+
export class Plugin extends BasePlugin {
|
|
5
|
+
pluginName = 'the_cake_is_a_lie'
|
|
6
|
+
auto_load_config = false
|
|
7
|
+
|
|
8
|
+
load() {
|
|
9
|
+
this.regMessageEvent({
|
|
10
|
+
regexp: /^(the cake is a lie|蛋糕是个谎言)$/i,
|
|
11
|
+
callback: this.cake_is_a_lie.bind(this),
|
|
12
|
+
})
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
unload() {}
|
|
16
|
+
|
|
17
|
+
private messages: SendMessageSegment[] = [
|
|
18
|
+
Structs.text('You Will Be Baked, And Then There Will Be Cake'),
|
|
19
|
+
Structs.music('163', 2005125394),
|
|
20
|
+
Structs.text('But The Cake Is A Lie'),
|
|
21
|
+
]
|
|
22
|
+
|
|
23
|
+
private async cake_is_a_lie({ context }: MessageCallback) {
|
|
24
|
+
this.messages.forEach(async (message, index) => {
|
|
25
|
+
setTimeout(async () => {
|
|
26
|
+
await this.bot.sendMsg(context, [message], { reply: false, at: false })
|
|
27
|
+
}, index * 1000)
|
|
28
|
+
})
|
|
29
|
+
}
|
|
30
|
+
}
|
package/tsconfig.json
ADDED
package/tsup.config.ts
ADDED