添加查看一年没发言的人

This commit is contained in:
yeyang
2022-10-30 14:41:50 +08:00
parent 7273248287
commit 96147e73d1
3 changed files with 23 additions and 7 deletions

View File

@@ -11,7 +11,7 @@ const ROLE_MAP = {
member: '群员'
}
let noactivereg = new RegExp('^#(查看|清理|确认清理)(\\d+)(月|周|天)没发言的人(第(\\d+)页)?$')
let noactivereg = new RegExp('^#(查看|清理|确认清理)(\\d+)(年|月|周|天)没发言的人(第(\\d+)页)?$')
export class Basics extends plugin {
constructor() {

View File

@@ -137,6 +137,9 @@ class Group_admin {
}
let msgs = Page[num - 1]
let res = msgs.list
if (num < Page.length) {
res.unshift(`可用 "#查看${times}${unit}没发言过的人第${msgs.pageNum + 1}页" 翻页`)
}
res.unshift(`当前为第${msgs.pageNum}页,共${Page.length}页,本页共${res.length}人,共${msg.length}`)
res.unshift(`以下为${times}${unit}没发言过的坏淫`)
return res
@@ -174,10 +177,12 @@ class Group_admin {
timeunit = 604800
} else if (unit == "月") {
timeunit = 2592000
} else if (unit == "年") {
timeunit = 31536000
}
let time = nowtime - times * timeunit
let list = Array.from((await e.group.getMemberMap()).values());
list = list.filter(item => item.last_sent_time < time && item.role == "member")
if (lodash.isEmpty(list)) {

View File

@@ -64,14 +64,21 @@ export default class Pixiv {
let api = `https://api.bbmang.me/ranks?page=${page}&date=${date}&mode=${mode}&pageSize=30`
let res = await this.getfetch(api)
if (!res) return false
if (page > 17) {
this.e.reply("哪有那么多图片给你辣(•̀へ •́ ╮ )")
return false
}
if (!res.data) {
this.e.reply("暂无数据,请稍后重试哦(。-ω-)zzz")
return false
};
let list = [
`${date}${type[mode]}`,
`当前为第${page}`
`当前为第${page}共17页本页共${res.data.length}共500张`,
];
if (page < 17) {
list.push(`可使用 "#看看${type[mode]}${page - 0 + 1}页" 翻页`)
}
for (let i of res.data) {
let { title, id: pid } = i
let { name: uresname, id: uresid } = i.artistPreView
@@ -115,9 +122,11 @@ export default class Pixiv {
}
let list = [
`找到${res.data.count}插画`,
`当前为第${page}页,共${pageall}`
`当前为第${page}页,共${pageall}页,本页共${res.data.rows.length}张,${res.data.count}`
];
if (page < pageall) {
list.push(`可使用 "#tag搜图${tag}${page - 0 + 1}页" 翻页`)
}
for (let i of res.data.rows) {
let { picture_id, title, regular_url, tags, like_total } = i
list.push([
@@ -200,9 +209,11 @@ export default class Pixiv {
`画师:${nick_name}\n`,
`介绍:${lodash.truncate(desc)}`
],
`找到${res.data.count}插画`,
`当前为第${page}页,共${pageall}`
`当前为第${page}页,共${pageall}页,本页共${res.data.rows.length}张,${res.data.count}`,
]
if (page < pageall) {
list.push(`可使用 "#uid搜图${keyword}${page - 0 + 1}页" 翻页`)
}
for (let i of res.data.rows) {
let { picture_id, title, regular_url, tags, like_total } = i
list.push([