Spaces:
Paused
Paused
Merge pull request #86 from Gojo-Bots/beta
Browse files- Powers/plugins/watchers.py +17 -15
- requirements.txt +1 -1
Powers/plugins/watchers.py
CHANGED
|
@@ -17,7 +17,7 @@ from Powers.database.warns_db import Warns, WarnSettings
|
|
| 17 |
from Powers.utils.caching import ADMIN_CACHE, admin_cache_reload
|
| 18 |
from Powers.utils.parser import mention_html
|
| 19 |
from Powers.utils.regex_utils import regex_searcher
|
| 20 |
-
from
|
| 21 |
|
| 22 |
# Initialise
|
| 23 |
gban_db = GBan()
|
|
@@ -167,6 +167,13 @@ async def bl_watcher(_, m: Message):
|
|
| 167 |
return
|
| 168 |
|
| 169 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 170 |
@Gojo.on_message(filters.user(list(ANTISPAM_BANNED)) & filters.group)
|
| 171 |
async def gban_watcher(c: Gojo, m: Message):
|
| 172 |
from Powers import SUPPORT_GROUP
|
|
@@ -206,26 +213,21 @@ async def gban_watcher(c: Gojo, m: Message):
|
|
| 206 |
<b>Chat:</b> <code>{m.chat.id}</code>
|
| 207 |
<b>Error:</b> <code>{ef}</code>""",
|
| 208 |
)
|
| 209 |
-
|
| 210 |
-
|
| 211 |
-
try:
|
| 212 |
msg = f"""
|
| 213 |
** Alert ⚠️**
|
| 214 |
User {m.from_user.mention} is officially
|
| 215 |
Scanned by TeamRed7 | Phoenix API ;)
|
| 216 |
Appeal [Here](https://t.me/Red7WatchSupport)
|
| 217 |
"""
|
| 218 |
-
|
| 219 |
-
|
| 220 |
-
|
| 221 |
-
|
| 222 |
-
|
| 223 |
-
|
| 224 |
-
|
| 225 |
-
except Exception as eror:
|
| 226 |
-
LOGGER.error(eror)
|
| 227 |
-
LOGGER.error(format_exc())
|
| 228 |
-
return
|
| 229 |
|
| 230 |
|
| 231 |
@Gojo.on_message(filters.chat(BLACKLIST_CHATS))
|
|
|
|
| 17 |
from Powers.utils.caching import ADMIN_CACHE, admin_cache_reload
|
| 18 |
from Powers.utils.parser import mention_html
|
| 19 |
from Powers.utils.regex_utils import regex_searcher
|
| 20 |
+
from RiZoeLX.functions import update_scanlist
|
| 21 |
|
| 22 |
# Initialise
|
| 23 |
gban_db = GBan()
|
|
|
|
| 167 |
return
|
| 168 |
|
| 169 |
|
| 170 |
+
SCANLIST = []
|
| 171 |
+
|
| 172 |
+
@Gojo.on_message(filters.command(["start", "ping"])
|
| 173 |
+
async def updatescanlist(_, message: Message):
|
| 174 |
+
global SCANLIST
|
| 175 |
+
SCANLIST = update_scanlist()
|
| 176 |
+
|
| 177 |
@Gojo.on_message(filters.user(list(ANTISPAM_BANNED)) & filters.group)
|
| 178 |
async def gban_watcher(c: Gojo, m: Message):
|
| 179 |
from Powers import SUPPORT_GROUP
|
|
|
|
| 213 |
<b>Chat:</b> <code>{m.chat.id}</code>
|
| 214 |
<b>Error:</b> <code>{ef}</code>""",
|
| 215 |
)
|
| 216 |
+
|
| 217 |
+
elif m.from_user.id in SCANLIST:
|
|
|
|
| 218 |
msg = f"""
|
| 219 |
** Alert ⚠️**
|
| 220 |
User {m.from_user.mention} is officially
|
| 221 |
Scanned by TeamRed7 | Phoenix API ;)
|
| 222 |
Appeal [Here](https://t.me/Red7WatchSupport)
|
| 223 |
"""
|
| 224 |
+
try:
|
| 225 |
+
await c.ban_chat_member(m.chat.id, user.id)
|
| 226 |
+
await c.send_message(m.chat.id, msg, disable_web_page_preview=True)
|
| 227 |
+
except Exception as a:
|
| 228 |
+
LOGGER.error(a)
|
| 229 |
+
LOGGER.error(format_exc())
|
| 230 |
+
return
|
|
|
|
|
|
|
|
|
|
|
|
|
| 231 |
|
| 232 |
|
| 233 |
@Gojo.on_message(filters.chat(BLACKLIST_CHATS))
|
requirements.txt
CHANGED
|
@@ -31,4 +31,4 @@ typing-extensions==4.3.0; python_full_version >= "3.6.2" and python_version >= "
|
|
| 31 |
ujson==5.7.0; python_version >= "3.7"
|
| 32 |
urllib3==1.26.11; python_version >= "3.7" and python_full_version < "3.0.0" and python_version < "4" or python_full_version >= "3.6.0" and python_version < "4" and python_version >= "3.7"
|
| 33 |
wikipedia==1.4.0
|
| 34 |
-
|
|
|
|
| 31 |
ujson==5.7.0; python_version >= "3.7"
|
| 32 |
urllib3==1.26.11; python_version >= "3.7" and python_full_version < "3.0.0" and python_version < "4" or python_full_version >= "3.6.0" and python_version < "4" and python_version >= "3.7"
|
| 33 |
wikipedia==1.4.0
|
| 34 |
+
pyRiZoeLX
|