-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
31 lines (31 loc) · 820 Bytes
/
index.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
const { bot } = require('./bot')
const { qq, baseUrl, verifyKey } = require('./config.json')
const grouphandle = require('./handles/grouphandle')
const friendhandle = require('./handles/friendhandle')
const axios=require("axios")
const { Message } = require('mirai-js')
const addtext=Message.prototype.addText
Message.prototype.addText=function(text){
if(text.length>100){
text.length=100
text+="\n100字符后被省略......"
}
addtext.call(this,text)
return this
}
axios.interceptors.request.use(config=>config,err=>{
console.log(err)
})
axios.interceptors.response.use(data=>data,err=>{
console.log(err)
})
const main = async () => {
await bot.open({
baseUrl,
verifyKey,
qq,
})
bot.on('FriendMessage', friendhandle)
bot.on('GroupMessage', grouphandle)
}
main()