For the complete documentation index, see llms.txt. This page is also available as Markdown.

Reddit

Retrieve the title of a subreddit along with the total number of members and the count of members currently online.

The Reddit counter reads one subreddit and returns its member count, how many members are online, or the subreddit title.

Availability: every bot, including the free public bot. It needs no API key and no extra configuration.

Reddit options
The Reddit counter options in the template editor

Options

Option
What it does
Notes

Display

Picks what the counter outputs: Members, Members online or Subreddit title.

Starts on Members. Does not accept a nested counter.

Subreddit name

The subreddit to look up.

Type the bare name, for example memes. It also accepts a nested counter, which has to return a valid subreddit name.

What it returns

Display

Value

Members

How many members the subreddit has.

Members online

How many members Reddit reports as active right now.

Subreddit title

The title of the subreddit, the line under its name on Reddit. It is not the r/ name.

Formatting

Members and Members online are numbers, so the Format settings panel applies. Subreddit title is text, and formatting does nothing to it. See Formatting counters.

Refresh and caching

The bot keeps each subreddit's data for 15 minutes, so a channel can show a value up to 15 minutes old. More in How counters update.

Examples

Display = Members, Subreddit name = memes, Use compact notation = Yes.

A subreddit with 1,200,000 members shows as 1.2M.

Display = Members online, Subreddit name = AskReddit.

A voice channel showing a subreddit member count
A voice channel driven by a Reddit counter

Errors

Message
What to do

A subreddit must be provided for the Reddit counter.

Fill in Subreddit name, or check that the nested counter in it returns a name.

A subreddit that is private, banned or misspelled fails with a generic error instead. Check the spelling first, then see Troubleshooting.

Technical details
  • Evaluator: packages/services/src/DataSource/DataSourceEvaluator/evaluators/reddit.ts.

  • One GET https://www.reddit.com/r/<subreddit>/about.json per lookup, with a 5 second timeout. The value of Subreddit name is put straight into that address.

  • The three values come from data.subscribers, data.active_user_count and data.title of that response. One request fills all three, so they always move together.

  • Cached in Redis for 15 minutes under the key 1:9:<subreddit>. The key holds no server id, so every server watching the same subreddit shares one fetch.

  • Only successful lookups are cached. A failing counter retries on every channel update.

  • The update job runs every 10 minutes on the public bot and every 5 minutes on every other bot, on its own clock. In the worst case the text on the channel is about 25 minutes behind Reddit, 20 minutes on a 5 minute bot.

  • An unset Display evaluates as Members.

  • A subreddit must be provided for the Reddit counter. (REDDIT_MISSING_SUBREDDIT): Subreddit name is empty, or the nested counter in it returned nothing.

  • In Discord the same error reads A subreddit must be provided for the Reddit coutner.; the typo is in the bot's en-US string, the dashboard string is correct.

  • A private, banned, quarantined or misspelled subreddit, and Reddit rate limiting the bot, make the response fail validation. There is no error name for that case, so the dashboard shows a generic failure and no value is cached.

  • The evaluation took too long and timed out. (EVALUATION_TIMEOUT): one counter in the template took more than 60 seconds.

  • No environment variables. The evaluator never checks isPremium, so the counter also runs on a self-hosted bot with an empty .env.

Last updated