There’s no current event for this. However, you can include one as part of a plugin.
# plugin.rb
class ::PostAction
module ListenForLikes
def act(user, post, post_action_type_id, opts = {})
super(user, post, post_action_type_id, opts).tap do |action|
DiscourseEvent.trigger(:post_liked, action) if action.persisted? && action.is_like?
end
end
end
singleton_class.prepend ListenForLikes
end
on :post_liked do |action|
# do some stuff
end