Getting Started
The default run times for searching is:
Users: 1 minute
Subreddits: 2 minutes
To change the run time use: .setSearch(<number>, 'users')
or .setSearch(<number>, 'subs')
const { Reddit } = require("@elara-services/reddit"),
reddit = new Reddit();
Adding Subreddit
reddit.subs.add("aww");
reddit.subs.bulk([
"aww",
"discordapp",
]);
Removing Subreddit
reddit.subs.remove("aww");
List Subreddits
reddit.subs.list();
Adding Users
reddit.users.add("SUPERCHIEFYT");
reddit.users.bulk([
"SUPERCHIEFYT",
"Reddit",
]);
Removing User
reddit.users.remove("SUPERCHIEFYT");
List Users
reddit.users.list();
Listen to new posts for users
reddit.listen("user", async (user, post) => {
});
Listen to new posts for subreddits
reddit.listen("subreddit", async (sub, post) => {
});
Listen to 'searching' for subs and users
reddit.listen("searching", (list, type) => {
});
reddit.setEnabled(true, 'users');
reddit.setEnabled(false, 'users');
reddit.setEnabled(true, 'users');
reddit.setEnabled(false, 'subs');
Toggle the minute(s) until search
reddit.setSearch(1, 'users');
reddit.setSearch(1, 'subs');