πNSFW
π NSFW Module 5.3
π Overview
The NSFW Content feature allows users with appropriate permissions to access adult-oriented content in designated NSFW channels. The system provides a wide range of content categories and ensures that only authorized users can view the material.
βοΈ How It Works
Users can access NSFW content using slash commands in NSFW-marked channels, provided they have the necessary roles configured by server administrators.
π Access Control
Server administrators can designate which roles are allowed to access NSFW content using the /manage features command. Only users with these roles will be able to use the NSFW commands.
The system also checks that the command is used in an NSFW-marked channel. If either the role or channel requirement isn't met, the user will receive an error message explaining the restriction.
π Content Categories
The following categories of NSFW content are available:
/nsfw ass- Ass-focused content/nsfw anal- Anal-focused content/nsfw pussy- Vagina-focused content/nsfw blowjob- Oral sex on penis/nsfw hairpulling- Hair pulling during sexual activity/nsfw rough- Rough, intense sexual activity/nsfw dominate- Dominant/submissive content/nsfw lesbian- Sexual activity between women/nsfw bondage- Bondage and restraints/nsfw pegging- Women using strap-ons with partners/nsfw choking- Erotic asphyxiation and choking/nsfw cunnilingus- Oral sex on vulva/vagina/nsfw tease- Teasing and orgasm control/nsfw squirt- Squirting/female ejaculation/nsfw spank- Spanking and impact play/nsfw creampie- Internal ejaculation/nsfw cumfest- Cum-focused content/nsfw deepthroat- Deep throat oral sex/nsfw 69- Mutual oral sex position/nsfw gangbang- Group sex content/nsfw gay- Sexual activity between men
πΌοΈ Content Delivery
When a user requests NSFW content with the appropriate permissions, the system attempts to deliver it in the following order:
Check the local cache for a pre-downloaded video file matching the request. If found, send this file.
If no cached file exists, try to download a new video from dedicated content channels.
Searches most recent 100 messages in the designated channel for the category
Randomly selects a video attachment from the results
Downloads and sends the video file if under the 25MB limit
If no video can be sent directly, either because the downloaded file is too large or no video attachments were found, the system will send an embedded image instead.
This delivery method aims to provide the best user experience by prioritizing fast-loading video files when possible, while falling back to embedded images if needed.
π« Error Handling
If the content delivery fails for any reason, such as an invalid category, network error, or lack of available content, the user will receive a friendly error message explaining the issue.
The system also handles errors gracefully to prevent disruption to the user experience. If an error occurs after the interaction has already been acknowledged, the error message will be sent as a follow-up message.
β±οΈ Cooldowns and Limits
To prevent spam and abuse, the NSFW commands have the following restrictions:
3 seconds per user cooldown on each command
100 results searched per content request to limit API calls
These limits strike a balance between allowing users to freely explore content while protecting server resources and preventing misuse.
π§ Technical Details
The NSFW feature is implemented as a standalone Cog in the Ivar bot, providing modularity and separation of concerns.
Key technical details:
Slash commands for each content category
Permissions checks for user roles and channel NSFW status
Caching of downloaded video files to improve response times
Automatic thumbnail generation for video attachments
Modular, reusable functions for content fetching and delivery
Robust error handling and logging
Customizable cooldowns and search limits
The code is designed to be readable, maintainable, and extensible, with clear separation of responsibilities and error handling at each step of the content delivery process.
Made by DIVINITY β’ Pleasure Corner
Last updated
Was this helpful?