How to access $(this) with api.attachWidgetAction?

Yes you can use this.attrs to access the attributes within your action. If it’s not working, make sure you’re not using the ES2015 fat arrow function syntax, as it preserves this from the outer scope, which is NOT what you want in this case.

For example:

api.attachWidgetAction('post', 'annoyMe', function() {
   // this.attrs is the attrs
});