qqbot/plugins/activeStatistics/index.js
2022-06-02 15:45:35 +08:00

33 lines
795 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,guildId){
const jointime = dayjs(member.joined_at)
// 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(guildId)
console.log(roleList)
}
/**
* 收到消息处理函数
* @param {Object} msg 消息对象
*/
function createMessage({msg}){
console.log("收到消息",msg)
updateActive(msg.member,msg.author,msg.guild_id)
}
onMessageCreate(createMessage)