NSFW Channels for Subreddit Images

NSFW Channels for Subreddit Images

Table of Contents

  1. Introduction
  2. Revisiting the Global Settings File
  3. Creating the NSFW Channel
  4. Flagging the Channel as Not Suitable for Work
  5. Sending a Message when the Subreddit is Not Found
  6. Testing for NSFW Subreddits
  7. Debugging the Code
  8. Closing the Episode

Is Your Discord Server NSFW-Friendly?

In this episode, we will be discussing a reddit command that we created where we randomly get an image and post it in the text channel. We will be checking whether the command is suitable for work or not. We will be revisiting our global settings file to modify our enabled means subreddits and only keep NSFW subreddits within one particular channel. We will create a new channel that is flagged as not suitable for work and we will discuss how to check for NSFW subreddits.

Revisiting the Global Settings File

To modify the enabled means subreddits, we will revisit our global settings file and copy the already created enabled means subreddits. We will put in our NSFW subreddit and remove WTF. With this in place, we will import the images from the settings as well. Then, we can check if the subreddit supplied by the user is in the enabled meme subreddits. If it is, we will choose it. If it is not, we will check another thing and tell the user what the subreddits to use are.

Creating the NSFW Channel

We will ignore the else part for now and use a flag to indicate whether the channel is suitable for work. If the channel is not suitable for work, we will Create another channel, add the check for the NSFW, and save it. Then, we can check if the channel is suitable for work and Continue only if it is.

Flagging the Channel as Not Suitable for Work

If the NSFW flag is set, we will check if it is not set to true and return with an answer saying that this is not allowed. If it is set to true, we will continue with the command.

Sending a Message when the Subreddit is Not Found

We will also send a message when the subreddit is not found which includes the list of enabled meme subreddits. We will include the NSFW subreddits as well and ask the user to choose the separator from the list.

Testing for NSFW Subreddits

To test for NSFW subreddits, we will check if the channel is suitable for work and only proceed if it is. If it is not suitable for work, we will return with an answer saying that this is not allowed.

Debugging the Code

If the code has any issues, we will solve them by debugging. We may face issues with double bot instances, in which case, it is best to regenerate a new token as it will automatically knock out all the parts.

Closing the Episode

With this, we conclude our episode on random images on Discord and NSFW channels. In the next episode, we will explore a new topic.

Highlights

  • Modifying enabled means subreddits
  • Creating an NSFW channel
  • Checking for NSFW subreddits
  • Debugging

FAQ

Q. What is an NSFW channel? A. An NSFW channel stands for Not Suitable For Work, which is a type of channel on Discord that contains explicit content.

Q. How can I check if a channel is NSFW? A. If a channel is NSFW, it will be flagged as such and will require extra checks before posting content.

Q. Can I change the NSFW flag on my channel? A. Yes, you can change the NSFW flag on your channel by going to the server settings and modifying the channel settings.

Find AI tools in Toolify

Join TOOLIFY to find the ai tools

Get started

Sign Up
App rating
4.9
AI Tools
20k+
Trusted Users
5000+
No complicated
No difficulty
Free forever
Browse More Content