39
39
from os import remove
40
40
from pyrogram import filters
41
41
42
- from Shikimori import BOT_USERNAME , SUDO_USERS , arq , pgram
42
+ from Shikimori import BOT_USERNAME , DEV_USERS , arq , pbot
43
43
from Shikimori .utils .errors import capture_err
44
44
from Shikimori .utils .permissions import adminsOnly
45
45
import Shikimori .modules .sql .nsfw_sql as sql
@@ -79,7 +79,7 @@ async def get_file_id_from_message(message):
79
79
return file_id
80
80
81
81
82
- @pgram .on_message (
82
+ @pbot .on_message (
83
83
(
84
84
filters .document
85
85
| filters .photo
@@ -102,7 +102,7 @@ async def detect_nsfw(_, message):
102
102
file_id = await get_file_id_from_message (message )
103
103
if not file_id :
104
104
return
105
- file = await pgram .download_media (file_id )
105
+ file = await pbot .download_media (file_id )
106
106
try :
107
107
results = await arq .nsfw_scan (file = file )
108
108
except Exception :
@@ -112,7 +112,7 @@ async def detect_nsfw(_, message):
112
112
results = results .result
113
113
remove (file )
114
114
nsfw = results .is_nsfw
115
- if message .from_user .id in SUDO_USERS :
115
+ if message .from_user .id in DEV_USERS :
116
116
return
117
117
if not nsfw :
118
118
return
@@ -136,7 +136,7 @@ async def detect_nsfw(_, message):
136
136
)
137
137
138
138
139
- @pgram .on_message (filters .command (["nsfwscan" , "nsfwscan@Shikimori" ]))
139
+ @pbot .on_message (filters .command (["nsfwscan" , "nsfwscan@Shikimori" ]))
140
140
@capture_err
141
141
async def nsfw_scan_command (_ , message ):
142
142
if not message .reply_to_message :
@@ -160,7 +160,7 @@ async def nsfw_scan_command(_, message):
160
160
file_id = await get_file_id_from_message (reply )
161
161
if not file_id :
162
162
return await m .edit ("Something wrong happened." )
163
- file = await pgram .download_media (file_id )
163
+ file = await pbot .download_media (file_id )
164
164
try :
165
165
results = await arq .nsfw_scan (file = file )
166
166
except Exception :
@@ -181,7 +181,7 @@ async def nsfw_scan_command(_, message):
181
181
)
182
182
183
183
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 )
185
185
@adminsOnly ("can_change_info" )
186
186
async def nsfw_enable_disable (_ , message ):
187
187
if len (message .command ) != 2 :
0 commit comments