Disabling emoji auto-complete as a user

If someone wants logic to disable the emoji recommender in a theme component, something like the below will work. (I started a proof of concept, but this still allows emoji to be rendered, just not recommended in the composer).

You’d need to code up the conditions for when it bypassed the recommender. It turns off only the recommender, though. Emoji are still rendered if they type in something like :persevering_face:

import { withPluginApi } from "discourse/lib/plugin-api";

export default {
  name: "disable-emoji-autocomplete-non-staff",

  initialize() {
    withPluginApi("0.8.12", (api) => {
      api.modifyClass("component:d-editor", {
        _applyEmojiAutocomplete() {
          let isGroupMember = ...logic to get members...
            });
          // Only apply emoji autocomplete for staff
          if (!isGroupMember) {
            // or maybe you want to make it not suggest emoji for members of the hate_emoji group
            return; // disables autocompletion for non-staff
          }
          // Fallback to the original behavior otherwise
          this._super(...arguments);
        },
      });
    });
  },
};

If you want a proper working theme component that disables/allows the emoji recommender by group (or maybe something else?) you could point to this in your Marketplace topic.