spoiler filtering

This commit is contained in:
Klemek
2021-05-19 15:11:29 +02:00
parent da5e3fdb35
commit a8b1ede962
6 changed files with 69 additions and 10 deletions
+7 -2
View File
@@ -12,7 +12,10 @@ class RandomScanner(HistoryScanner):
return generate_help(
"rand",
"Read a random message (add text to filter like %find)",
args=["image - pull an image instead of a message"],
args=[
"image - pull an image instead of a message",
"spoiler:allow/only - allow spoiler images",
],
)
def __init__(self):
@@ -20,6 +23,8 @@ class RandomScanner(HistoryScanner):
async def get_results(self, intro: str) -> List[str]:
if self.images_only:
return await self.history.to_string_image(type="random")
return await self.history.to_string_image(
type="random", spoiler=self.spoiler
)
else:
return self.history.to_string(type="random")