Stores the URL of a suitable post
image hosting domains accepted by Reddit to prevent linking to unkown sites
Array of strings of subreddits the bot should not pull from
Whether or not the channel for the command is NSFW
Loops through all children of a query response to find if any of them meet the required critera
the array of the children
part of the Reddit API response
true
if a suitable post is found false
otherwise
Queries a subreddit's About info to see if it's NSFW and whether it's quarantined or private or not
the name of the subreddit
true
if all ok, false if NSFW even thought the channel isn't or a string
containing either private
or quarantined
if either of those are true for the sub
Wrapper function which sets a generic error message to respond with and calls respond()
checks the subreddit if it NSFW or not and whether it's quarantined or not queries a random post and returns an appropriate one if able
the name of the subreddit to query
Gets an an array with all the parameters passed to a command
string[]
Performs the query to get a post from the subreddit, or empty if a suitable post can't be found
the name of the subreddit
the index of number of queries performed, can't be more than 5 before the function gives up
A base function that returns whatever reply has been set by other base functions, the command object returns this response after the command has been successfully ran defaults to sending it as a normal message, but can send it as reply if replyTo is set to true
checks whether the channel the request was made in was NSFW or not
Returns the commands properties, for use in the Help command
object
The meat of the object, this function is called by the commander object and instantiates the object proper with all required values, then runs the encompassing function and returns the resulting promise object
Generated using TypeDoc
Queries a specified subreddit for a random image post to post in the chat