From fb2d9ae159bfcd8760fd080a1772a54032680ad3 Mon Sep 17 00:00:00 2001 From: theluyuan <1162963624@qq.com> Date: Thu, 2 Jun 2022 16:32:47 +0800 Subject: [PATCH] add content --- plugins/activeStatistics/index.js | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/plugins/activeStatistics/index.js b/plugins/activeStatistics/index.js index 856d986..b3c8a98 100644 --- a/plugins/activeStatistics/index.js +++ b/plugins/activeStatistics/index.js @@ -8,8 +8,8 @@ function init(){ } -async function updateActive(member,author,guildId){ - const jointime = dayjs(member.joined_at) +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 = [] @@ -17,8 +17,19 @@ async function updateActive(member,author,guildId){ const id = author.id const bot = author.bot const username = author.username - const roleList = await getRole(guildId) - console.log(roleList) + // const roleList = await getRole(guild_id) + // const content = content + // console.log(roleList) + const info = { + jointime, + nickname, + avatar, + id, + bot, + username, + content + } + console.log(info) } @@ -28,6 +39,6 @@ async function updateActive(member,author,guildId){ */ function createMessage({msg}){ console.log("收到消息",msg) - updateActive(msg.member,msg.author,msg.guild_id) + updateActive(msg) } onMessageCreate(createMessage) \ No newline at end of file