mirror of
https://github.com/TeamPGM/PagerMaid_Plugins.git
synced 2024-11-25 12:17:50 +00:00
🐛 fuckadmin 修复逻辑错误
This commit is contained in:
parent
a315456881
commit
bd8c1680b9
18
fuckadmin.py
18
fuckadmin.py
@ -6,21 +6,21 @@ from telethon.tl.types import ChannelParticipantsAdmins
|
|||||||
def eval_time(context, msg, day):
|
def eval_time(context, msg, day):
|
||||||
now = context.date
|
now = context.date
|
||||||
old = msg.date
|
old = msg.date
|
||||||
between = (now - old).seconds
|
sec = (now - old).seconds
|
||||||
require_sec = day * 86400
|
days = (now - old).days
|
||||||
if between < require_sec:
|
if days < day:
|
||||||
return None
|
return None
|
||||||
minute, sec = divmod(between, 60)
|
minute, sec = divmod(sec, 60)
|
||||||
hour, minute = divmod(minute, 60)
|
hour, minute = divmod(minute, 60)
|
||||||
day, hour = divmod(hour, 24)
|
|
||||||
month, day = divmod(day, 30)
|
month, days = divmod(days, 30)
|
||||||
year, month = divmod(month, 12)
|
year, month = divmod(month, 12)
|
||||||
if year > 0:
|
if year > 0:
|
||||||
time = "%02d年%02d月%02d天%02d时%02d分%02d秒" % (year, month, day, hour, minute, sec)
|
time = "%02d年%02d月%02d天%02d时%02d分%02d秒" % (year, month, days, hour, minute, sec)
|
||||||
elif month > 0:
|
elif month > 0:
|
||||||
time = "%02d月%02d天%02d时%02d分%02d秒" % (month, day, hour, minute, sec)
|
time = "%02d月%02d天%02d时%02d分%02d秒" % (month, days, hour, minute, sec)
|
||||||
elif day > 0:
|
elif day > 0:
|
||||||
time = "%02d天%02d时%02d分%02d秒" % (day, hour, minute, sec)
|
time = "%02d天%02d时%02d分%02d秒" % (days, hour, minute, sec)
|
||||||
elif hour > 0:
|
elif hour > 0:
|
||||||
time = "%02d时%02d分%02d秒" % (hour, minute, sec)
|
time = "%02d时%02d分%02d秒" % (hour, minute, sec)
|
||||||
elif minute > 0:
|
elif minute > 0:
|
||||||
|
@ -572,10 +572,10 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "fuckadmin",
|
"name": "fuckadmin",
|
||||||
"version": "1.01",
|
"version": "1.1",
|
||||||
"section": "daily",
|
"section": "daily",
|
||||||
"maintainer": "xtaodada",
|
"maintainer": "xtaodada",
|
||||||
"size": "2.7 kb",
|
"size": "2.9 kb",
|
||||||
"supported": true,
|
"supported": true,
|
||||||
"des-short": "列出群组中所有潜水超过 n 天的管理员。",
|
"des-short": "列出群组中所有潜水超过 n 天的管理员。",
|
||||||
"des": "列出群组中所有潜水超过 n 天的管理员。(n>=7)。命令:fuckadmin 。"
|
"des": "列出群组中所有潜水超过 n 天的管理员。(n>=7)。命令:fuckadmin 。"
|
||||||
|
Loading…
Reference in New Issue
Block a user