The general etiquette is that it is permissible/appropriate if
- it is directly on topic
- you make a non-botlike comment
- you do it sparingly
(it also helps if it is a reasonable reward link)
Your comment passed all three criteria and was definitely pro-social rather than rude . . . .