Skip to content
Moderation threadUserCount

$threadUserCount

The function $threadUserCount[] returns the number of members present in a thread.

Syntax

bdfd
$threadUserCount[threadID]

Syntax

$threadUserCount[threadID]

Parameters

Parameter Description
threadID The ID of the thread to analyze.

Return Value

  • Type: Integer
  • The number of members in the thread.
  • 0 if the thread is empty or inaccessible.

Behavior

  • Counts all users who have joined the thread (public) or have been added to it (private).
  • Includes the bot itself if it has joined the thread.
  • The bot must have access to the thread.

Examples

Thread Summary

$title[Thread Activity]
$description[
**Members:** $threadUserCount[$threadID] participants
**Messages:** $threadMessageCount[$threadID] messages
]
$color[#57F287]
$sendMessage[]

Popularity Alert

$var[userCount;$threadUserCount[$threadID]]
$if[$var[userCount]>=10]
  $sendMessage[This thread has attracted $var[userCount] participants! 🔥]
$endif

Participation Monitoring

$var[members;$threadUserCount[$threadID]]
$var[messages;$threadMessageCount[$threadID]]
$var[ratio;$round[$divide[$var[messages];$var[members]]]]
$sendMessage[Average of $var[ratio] messages per participant.]

Notes

  • In public threads, the count includes all users who have opened the thread.
  • Useful alongside $threadMessageCount[] to evaluate engagement.
  • Members who leave a public thread are no longer counted.