Skip to content
This repository was archived by the owner on Jan 13, 2023. It is now read-only.

Commit 2b86f9d

Browse files
committed
Update antinsfw.py
1 parent 643c63e commit 2b86f9d

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

Shikimori/modules/antinsfw.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
from os import remove
4040
from pyrogram import filters
4141

42-
from Shikimori import BOT_USERNAME, SUDO_USERS, arq, pgram
42+
from Shikimori import BOT_USERNAME, DEV_USERS, arq, pbot
4343
from Shikimori.utils.errors import capture_err
4444
from Shikimori.utils.permissions import adminsOnly
4545
import Shikimori.modules.sql.nsfw_sql as sql
@@ -79,7 +79,7 @@ async def get_file_id_from_message(message):
7979
return file_id
8080

8181

82-
@pgram.on_message(
82+
@pbot.on_message(
8383
(
8484
filters.document
8585
| filters.photo
@@ -102,7 +102,7 @@ async def detect_nsfw(_, message):
102102
file_id = await get_file_id_from_message(message)
103103
if not file_id:
104104
return
105-
file = await pgram.download_media(file_id)
105+
file = await pbot.download_media(file_id)
106106
try:
107107
results = await arq.nsfw_scan(file=file)
108108
except Exception:
@@ -112,7 +112,7 @@ async def detect_nsfw(_, message):
112112
results = results.result
113113
remove(file)
114114
nsfw = results.is_nsfw
115-
if message.from_user.id in SUDO_USERS:
115+
if message.from_user.id in DEV_USERS:
116116
return
117117
if not nsfw:
118118
return
@@ -136,7 +136,7 @@ async def detect_nsfw(_, message):
136136
)
137137

138138

139-
@pgram.on_message(filters.command(["nsfwscan", "nsfwscan@Shikimori"]))
139+
@pbot.on_message(filters.command(["nsfwscan", "nsfwscan@Shikimori"]))
140140
@capture_err
141141
async def nsfw_scan_command(_, message):
142142
if not message.reply_to_message:
@@ -160,7 +160,7 @@ async def nsfw_scan_command(_, message):
160160
file_id = await get_file_id_from_message(reply)
161161
if not file_id:
162162
return await m.edit("Something wrong happened.")
163-
file = await pgram.download_media(file_id)
163+
file = await pbot.download_media(file_id)
164164
try:
165165
results = await arq.nsfw_scan(file=file)
166166
except Exception:
@@ -181,7 +181,7 @@ async def nsfw_scan_command(_, message):
181181
)
182182

183183

184-
@pgram.on_message(filters.command(["antinsfw", f"antinsfw@{BOT_USERNAME}"]) & ~filters.private)
184+
@pbot.on_message(filters.command(["antinsfw", f"antinsfw@{BOT_USERNAME}"]) & ~filters.private)
185185
@adminsOnly("can_change_info")
186186
async def nsfw_enable_disable(_, message):
187187
if len(message.command) != 2:

0 commit comments

Comments
 (0)