2
0
mirror of https://github.com/Nick80835/microbot synced 2025-08-22 10:09:40 +00:00

implement nsfw spoiler toggle

This commit is contained in:
Nick80835 2023-02-05 11:15:43 -05:00
parent 8339982ac4
commit 7bd2aa02ca

View File

@ -167,6 +167,25 @@ async def nsfw_toggle(event):
await event.reply("NSFW commands disabled for this chat!")
@ldr.add("spoilernsfw", admin=True, help="Enables or disables spoilering NSFW media for a chat, requires admin.")
async def spoiler_nsfw_toggle(event):
if event.args.lower() not in ("on", "off"):
if event.chat_db.spoiler_nsfw:
current_config = 'On'
else:
current_config = 'Off'
await event.reply(f"Syntax: {event.prefix}nsfw (on|off)\nCurrent config for this chat: {current_config}")
return
if event.args == "on":
event.chat_db.spoiler_nsfw = True
await event.reply("NSFW spoilers enabled for this chat!")
elif event.args == "off":
event.chat_db.spoiler_nsfw = False
await event.reply("NSFW spoilers disabled for this chat!")
@ldr.add("fun", admin=True, help="Enables or disables fun commands for a chat, requires admin.")
async def fun_toggle(event):
if event.args.lower() not in ("on", "off"):