2
0
mirror of https://github.com/Nick80835/microbot synced 2025-09-01 15:05:48 +00:00

tweak nsfw check in booru

This commit is contained in:
Nick80835
2023-02-05 12:33:39 -05:00
parent 601890f3af
commit 7e8abbc330

View File

@@ -56,7 +56,7 @@ async def booru(event):
for image in images: for image in images:
try: try:
if event.chat_db.spoiler_nsfw and (event.object.nsfw or event.extra[0]._get_rating("x") in image[3]): if event.chat_db.spoiler_nsfw and event.extra[0]._get_rating("x") in image[3]:
if bool(event.other_args[1]): if bool(event.other_args[1]):
file = InputMediaDocumentExternal(url=image[0], spoiler=True) file = InputMediaDocumentExternal(url=image[0], spoiler=True)
else: else:
@@ -103,7 +103,7 @@ async def booru_buttons(event):
event.extra[1][f"{event.chat.id}_{event.id}"] = [0, images] event.extra[1][f"{event.chat.id}_{event.id}"] = [0, images]
if event.chat_db.spoiler_nsfw and (event.object.nsfw or event.extra[0]._get_rating("x") in images[0][3]): if event.chat_db.spoiler_nsfw and event.extra[0]._get_rating("x") in images[0][3]:
file = InputMediaPhotoExternal(url=images[0][0], spoiler=True) file = InputMediaPhotoExternal(url=images[0][0], spoiler=True)
else: else:
file = images[0][0] file = images[0][0]