message
This commit is contained in:
@@ -1,10 +1,33 @@
|
||||
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){
|
||||
function createMessage({msg}){
|
||||
console.log("收到消息",msg)
|
||||
updateActive(msg.member,msg.author,msg.guild_id)
|
||||
}
|
||||
onMessageCreate(createMessage)
|
||||
Reference in New Issue
Block a user