Update Akeno/plugins/deakall.py
Browse files- Akeno/plugins/deakall.py +48 -1
Akeno/plugins/deakall.py
CHANGED
@@ -113,4 +113,51 @@ async def deakall(client: Client, message: Message):
|
|
113 |
f"Failed count: {failed}\n"
|
114 |
f"{error_text}\n"
|
115 |
)
|
116 |
-
await pro.edit_text(detele_all_msg)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
113 |
f"Failed count: {failed}\n"
|
114 |
f"{error_text}\n"
|
115 |
)
|
116 |
+
await pro.edit_text(detele_all_msg)
|
117 |
+
|
118 |
+
@Akeno(
|
119 |
+
~filters.scheduled
|
120 |
+
& filters.command(["lastall"], CMD_HANDLER)
|
121 |
+
& filters.me
|
122 |
+
& ~filters.forwarded
|
123 |
+
)
|
124 |
+
async def lastall(client: Client, message: Message):
|
125 |
+
month_count = 0
|
126 |
+
long_ago_count = 0
|
127 |
+
offline_count = 0
|
128 |
+
recently_count = 0
|
129 |
+
last_week_count = 0
|
130 |
+
online_count = 0
|
131 |
+
pro = await message.reply_text("Wait processing.....")
|
132 |
+
async for dialog in client.get_dialogs():
|
133 |
+
if dialog.top_message and dialog.top_message.from_user:
|
134 |
+
user_id = dialog.top_message.from_user.id
|
135 |
+
if dialog.chat.type == ChatType.PRIVATE:
|
136 |
+
if dialog.top_message.from_user:
|
137 |
+
if dialog.top_message.from_user.status == UserStatus.LAST_MONTH:
|
138 |
+
if user_id:
|
139 |
+
month_count += 1
|
140 |
+
elif dialog.top_message.from_user.status == UserStatus.LONG_AGO:
|
141 |
+
if user_id:
|
142 |
+
long_ago_count += 1
|
143 |
+
elif dialog.top_message.from_user.status == UserStatus.OFFLINE:
|
144 |
+
if user_id:
|
145 |
+
offline_count += 1
|
146 |
+
elif dialog.top_message.from_user.status == UserStatus.RECENTLY:
|
147 |
+
if user_id:
|
148 |
+
recently_count += 1
|
149 |
+
elif dialog.top_message.from_user.status == UserStatus.LAST_WEEK:
|
150 |
+
if user_id:
|
151 |
+
last_week_count += 1
|
152 |
+
elif dialog.top_message.from_user.status == UserStatus.ONLINE:
|
153 |
+
if user_id:
|
154 |
+
online_count += 1
|
155 |
+
count_all_msg = (
|
156 |
+
f"LAST_MONTH: `{month_count}`\n"
|
157 |
+
f"LONG_AGO: `{long_ago_count}`\n"
|
158 |
+
f"OFFLINE: `{offline_count}`\n"
|
159 |
+
f"RECENTLY: `{recently_count}`\n"
|
160 |
+
f"LAST_WEEK: `{last_week_count}`\n"
|
161 |
+
f"ONLINE: `{online_count}`\n"
|
162 |
+
)
|
163 |
+
await pro.edit_text(count_all_msg)
|