What query to award a badge for liking or replying to a particular topic?

Is there a way to write a query to award a badge to all users who like a certain post/topic or reply to it?

1 Like

That should help:

3 Likes