-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtestv3.js
58 lines (45 loc) · 861 Bytes
/
testv3.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
const KoaOicq = require('.');
const app = new KoaOicq(2770315275, {
log_level: 'off'
});
async function aaa(ctx, next) {
ctx.reply("你好");
console.log('测试');
await next();
console.log("测试2");
ctx.bot.unuse('test')
}
class bbb {
install(add) {
add(async function (ctx, next) {
ctx.reply("你好");
console.log('测试');
await next();
console.log("测试2");
ctx.bot.unuse('test2')
})
}
}
app.plugin('test2', bbb)
app.use({
install(add) {
add(function (ctx, next) {
ctx.reply('测试')
next();
})
}
})
app.plugin('test', () => aaa);
app.use(async (ctx, next) => {
console.log(111);
await next();
console.log(333);
})
app.use(async (ctx, next) => {
console.log(222);
await next();
console.log(444);
})
app.use('test');
app.use('test2')
app.listen();