44 lines
1001 B
JavaScript
44 lines
1001 B
JavaScript
import dayjs from "dayjs"
|
|
import { getRole } from "../../bin/channel-core/tools.js"
|
|
import { onMessageCreate } from "../../bin/message/index.js"
|
|
|
|
|
|
function init(){
|
|
|
|
}
|
|
|
|
|
|
async function updateActive({member,author,guild_id,content}){
|
|
const jointime = dayjs(member.joined_at).format('YYYY-MM-DD HH:mm:ss')
|
|
// console.log(time.format('YYYY-MM-DD HH:mm:ss'))
|
|
const nickname = member.nick
|
|
const roles = []
|
|
const avatar = author.avatar
|
|
const id = author.id
|
|
const bot = author.bot
|
|
const username = author.username
|
|
// const roleList = await getRole(guild_id)
|
|
// const content = content
|
|
// console.log(roleList)
|
|
const info = {
|
|
jointime,
|
|
nickname,
|
|
avatar,
|
|
id,
|
|
bot,
|
|
username,
|
|
content
|
|
}
|
|
console.log(info)
|
|
}
|
|
|
|
|
|
/**
|
|
* 收到消息处理函数
|
|
* @param {Object} msg 消息对象
|
|
*/
|
|
function createMessage({msg}){
|
|
console.log("收到消息",msg)
|
|
updateActive(msg)
|
|
}
|
|
onMessageCreate(createMessage) |