koishi-plugin-tmp-bot 1.6.2 → 1.7.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.
@@ -0,0 +1,16 @@
1
+ module.exports = async (session) => {
2
+ if (session.bot.platform !== 'onebot') {
3
+ return '当前适配器不支持该功能'
4
+ }
5
+
6
+ // 构建 OneBot 点赞消息并发送
7
+ let likeMeData = {
8
+ action: 'send_like',
9
+ params: {
10
+ user_id: session.event.user.id,
11
+ times: 10
12
+ }
13
+ }
14
+ session.bot.adapter.socket.send(JSON.stringify(likeMeData))
15
+ return '成功'
16
+ }
package/lib/index.js CHANGED
@@ -8,6 +8,7 @@ const tmpServer = require('./command/tmpServer');
8
8
  const tmpBind = require('./command/tmpBind');
9
9
  const tmpTraffic = require('./command/tmpTraffic');
10
10
  const tmpPosition = require('./command/tmpPosition');
11
+ const likeMe = require('./command/likeMe');
11
12
  exports.name = 'tmp-bot';
12
13
  exports.inject = {
13
14
  required: ['database'],
@@ -29,5 +30,6 @@ function apply(ctx, cfg) {
29
30
  ctx.command('tmpbind <tmpId>').action(async ({ session }, tmpId) => await tmpBind(ctx, cfg, session, tmpId));
30
31
  ctx.command('tmptraffic <serverName>').action(async ({ session }, serverName) => await tmpTraffic(ctx, cfg, serverName));
31
32
  ctx.command('tmpposition <tmpId>').action(async ({ session }, tmpId) => await tmpPosition(ctx, cfg, session, tmpId));
33
+ ctx.command('likeme').action(async ({ session }) => await likeMe(session));
32
34
  }
33
35
  exports.apply = apply;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "koishi-plugin-tmp-bot",
3
3
  "description": "欧洲卡车模拟2 TMP查询机器人",
4
- "version": "1.6.2",
4
+ "version": "1.7.0",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",
7
7
  "files": [