test
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
mol
2023-12-14 10:07:44 +08:00
parent eb57171700
commit 83964b678d
4 changed files with 17 additions and 12 deletions

View File

@ -13,16 +13,10 @@ steps: # 定义管道的执行步骤
# - npm config set registry https://registry.npm.taobao.org # - npm config set registry https://registry.npm.taobao.org
# - npm i # - npm i
- name: build-tags
image: yxs970707/drone-web-tags
depends_on: [clone]
settings:
tags:
- latest
- name: cache # 加载缓存 - name: cache # 加载缓存
image: drillster/drone-volume-cache image: drillster/drone-volume-cache
depends_on: [build-tags] pull: if-not-exists
depends_on: [clone]
volumes: volumes:
- name: cache - name: cache
path: /cache path: /cache
@ -32,9 +26,18 @@ steps: # 定义管道的执行步骤
- ./node_modules - ./node_modules
- ./nugetpackages - ./nugetpackages
- name: build-tags
image: yxs970707/drone-web-tags
pull: if-not-exists
depends_on: [cache]
settings:
tags:
- latest
- name: build-image - name: build-image
image: plugins/docker image: plugins/docker
depends_on: [cache] pull: if-not-exists
depends_on: [build-tags]
settings: settings:
username: username:
from_secret: docker_username from_secret: docker_username
@ -47,6 +50,7 @@ steps: # 定义管道的执行步骤
- name: rebuild cache # 构建缓存 - name: rebuild cache # 构建缓存
image: drillster/drone-volume-cache image: drillster/drone-volume-cache
pull: if-not-exists
depends_on: [build-image] depends_on: [build-image]
volumes: volumes:
- name: cache - name: cache

3
app.js
View File

@ -2,6 +2,7 @@ import CreateBot from '#root/bot/index.js';
import CreateWebhookServer from '#root/http/index.js'; import CreateWebhookServer from '#root/http/index.js';
import logger from '#root/utils/logger.js'; import logger from '#root/utils/logger.js';
import handlers from './handlers/index.js'; import handlers from './handlers/index.js';
import plugins from '#root/plugins/index.js';
let retryCount = 0; let retryCount = 0;
@ -32,6 +33,8 @@ let retryCount = 0;
}); });
logger('bot 连接成功!!'); logger('bot 连接成功!!');
bot.mountPlugin(plugins);
logger('开启 webhook 服务器'); logger('开启 webhook 服务器');
const webhook = new CreateWebhookServer(); const webhook = new CreateWebhookServer();

View File

@ -1,7 +1,6 @@
import pkg from 'mirai-js'; import pkg from 'mirai-js';
import Queue from '#root/utils/queue.js'; import Queue from '#root/utils/queue.js';
import logger from '#root/utils/logger.js'; import logger from '#root/utils/logger.js';
import plugins from '#root/plugins/index.js';
const { Bot } = pkg; const { Bot } = pkg;
@ -19,8 +18,6 @@ export default class CreateBot {
verifyKey: config.verifyKey, verifyKey: config.verifyKey,
qq: config.qq, qq: config.qq,
}); });
this.mountPlugin(plugins);
} }
async sendMessageToFriend(qq, message) { async sendMessageToFriend(qq, message) {

View File

@ -37,6 +37,7 @@ function cookInit() {
'FriendMessage', 'FriendMessage',
new Middleware().friendFilter(cookSubs.users).done(dealCommon), new Middleware().friendFilter(cookSubs.users).done(dealCommon),
); );
Bot.sendMessageToFriend(752753679, '测试');
logger('cook 初始化完成') logger('cook 初始化完成')
} }