A badge granted when someone posts a reply in a single specified topic

Anyone want a (hopefully easy) challenge? A badge granted when someone posts a reply in a single specified topic. (i.e., A “Please introduce yourself here” topic.)

9 Likes
SELECT
DISTINCT ON (p.user_id)
p.user_id, p.id post_id, p.created_at granted_at
FROM badge_posts p
WHERE p.topic_id = 32 AND -- 32 is the "please introduce yourself" topic
  (:backfill OR p.id IN (:post_ids) )

Triggered on “edit/create a post”.

16 Likes

Hi

I am seeking some help to do the following badge

I am trying to encourage users to post in a thread, I want them to post in this particular thread 10 times to earn this badge.

I was looking at

Which works for a single post, I am just unsure how to expand this out to 10 posts minimum.

1 Like

Can’t seem to get this to work,
I’ve added;

SELECT
DISTINCT ON (p.user_id)
p.user_id, p.id post_id, p.created_at granted_at
FROM badge_posts p
WHERE p.topic_id = 172 AND
(:backfill OR p.id IN (:post_ids) )

But running the query isn’t bringing anyone back :cry:

Did you change the topic ID? the 172

1 Like

Yeah, I think 172 is the topic number.

With the new SQL rules, how would you make a badge for introducing yourself on a topic?

I used this query…

SELECT
DISTINCT ON (p.user_id)
p.user_id, p.id post_id, p.created_at granted_at
FROM badge_posts p
WHERE p.topic_id = 6671 AND -- 6671 is the "Introduce yourself" topic
  (:backfill OR p.id IN (:post_ids) )

With the following settings
59%20PM

2 Likes