2022-06-02 15:45:35 +08:00
|
|
|
import dayjs from "dayjs"
|
|
|
|
import { getRole } from "../../bin/channel-core/tools.js"
|
2022-06-02 00:50:48 +08:00
|
|
|
import { onMessageCreate } from "../../bin/message/index.js"
|
|
|
|
|
2022-06-02 15:45:35 +08:00
|
|
|
|
|
|
|
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)
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2022-06-02 00:50:48 +08:00
|
|
|
/**
|
|
|
|
* 收到消息处理函数
|
|
|
|
* @param {Object} msg 消息对象
|
|
|
|
*/
|
2022-06-02 15:45:35 +08:00
|
|
|
function createMessage({msg}){
|
2022-06-02 00:50:48 +08:00
|
|
|
console.log("收到消息",msg)
|
2022-06-02 15:45:35 +08:00
|
|
|
updateActive(msg.member,msg.author,msg.guild_id)
|
2022-06-02 00:50:48 +08:00
|
|
|
}
|
|
|
|
onMessageCreate(createMessage)
|