# Omit Emoji component

**URL:** https://meta.discourse.org/t/omit-emoji-component/119562
**Category:** Theme component
**Tags:** emoji, broken
**Created:** [05.Июнь.2019 09:50:46 UTC](https://meta.discourse.org/t/omit-emoji-component/119562 "2019-06-05T09:50:46Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![tshenry](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tshenry/32/119495_2.png) [@tshenry](https://meta.discourse.org/u/tshenry)
#### Post date: [05.Июнь.2019 09:50:46 UTC](https://meta.discourse.org/t/omit-emoji-component/119562/1 "2019-06-05T09:50:46Z")

</div>

This theme component will allow you to specify a set of emoji and/or emoji groups to omit from the emoji picker.

 ![20%20AM](https://global.discourse-cdn.com/meta/original/3X/3/8/3815795299f80dd9f075df2133653d784a16b522.png)

There are several levels of omission you can achieve. These are outlined below along with the related settings:

#### 1. Remove emoji groups from the picker

This configuration is for those that want to reduce the clutter in the emoji picker. There’s a lot to scroll through, so if certain emoji groups don’t make sense for your community, this allows you to remove them. The omitted emoji can still be discovered through the emoji picker search or emoji auto complete features.

- **omitted emoji groups** - Remove the groups you wish to keep, leave the ones you want to omit

#### 2. Prevent emoji from showing up in the emoji picker search or emoji auto-complete feature

Users will never be presented these emoji. They would only ever be posted if the user explicitly added emoji code like `:slight_smile:`

- **omitted emoji** - Add the names of the emoji you wish to remove from all manners of discovery

#### 3. Block emoji from being posted

As a final measure, you can add any emoji you wish to block from being posted to the “Watched Words” setting found at `/admin/logs/watched_words/action/block`. Be sure to use the full emoji code like `:slight_smile:`. Watched words allows you to upload a list, but it needs to be one emoji on each line.

### Installation

[Repository Link](https://github.com/tshenry/discourse-omit-emoji)  
`https://github.com/tshenry/discourse-omit-emoji`

If you are unfamiliar with theme components and how to install them, check out the [theme installation guide](https://meta.discourse.org/t/how-do-i-install-a-theme-or-theme-component/63682). And if you’d like to learn more about Discourse themes, take a look at [this guide](https://meta.discourse.org/t/beginners-guide-to-using-discourse-themes/91966).

If you have any ideas for improvement, or issues to report please don’t hesitate to share. Note that there are limitations with theme components, so I can’t promise every proposed improvement will be possible 🙂

---

<div class="post-metadata">

### Author: ![tachibanalolo](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tachibanalolo/32/233762_2.png) [@tachibanalolo](https://meta.discourse.org/u/tachibanalolo)
#### Post date: [22.Февраль.2022 05:10:24 UTC](https://meta.discourse.org/t/omit-emoji-component/119562/3 "2022-02-22T05:10:24Z")

</div>

Этот компонент сломан? В сообщении указано, что он не работает с версией 2.9.0.beta2.

---

<div class="post-metadata">

### Author: ![tshenry](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tshenry/32/119495_2.png) [@tshenry](https://meta.discourse.org/u/tshenry)
#### Post date: [01.Март.2022 04:03:30 UTC](https://meta.discourse.org/t/omit-emoji-component/119562/5 "2022-03-01T04:03:30Z")

</div>

Прошло довольно много времени с тех пор, как я в последний раз смотрел на этот компонент. Код также довольно хрупкий, поэтому вполне вероятно, что его потребуется исправить. Я займусь этим на этой неделе! Спасибо, что обратили на это мое внимание.

---

<div class="post-metadata">

### Author: ![tshenry](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tshenry/32/119495_2.png) [@tshenry](https://meta.discourse.org/u/tshenry)
#### Post date: [08.Март.2022 02:53:26 UTC](https://meta.discourse.org/t/omit-emoji-component/119562/6 "2022-03-08T02:53:26Z")

</div>

Хорошо, этот компонент должен быть исправлен следующим коммитом:

> <https://github.com/tshenry/discourse-omit-emoji/commit/ef7c5aa505040da2bef24bbb279ff363afdb8049>
>
> Fixes issues and moves away from massive code overrides. It's not perfect, but i…t shouldn't break as easily and is probably close to the best that can be done without a proper feature in core.

Как указано в сообщении коммита, это не идеальное решение, но, думаю, будет лучше, чем было. В идеале когда-нибудь в ядре появится настройка, позволяющая более точно управлять эмодзи. Хотя я не уверен, что это достаточно часто возникает, чтобы это оправдывало.

Дайте знать, если возникнут какие-либо проблемы!

---

<div class="post-metadata">

### Author: ![tachibanalolo](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tachibanalolo/32/233762_2.png) [@tachibanalolo](https://meta.discourse.org/u/tachibanalolo)
#### Post date: [10.Март.2022 11:59:34 UTC](https://meta.discourse.org/t/omit-emoji-component/119562/7 "2022-03-10T11:59:34Z")

</div>

Спасибо за вашу работу! Ура!

---

<div class="post-metadata">

### Author: ![Monikas](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/monikas/32/375316_2.png) [@Monikas](https://meta.discourse.org/u/Monikas)
#### Post date: [18.Апрель.2024 08:30:36 UTC](https://meta.discourse.org/t/omit-emoji-component/119562/8 "2024-04-18T08:30:36Z")

</div>

Возможно ли отключить эмодзи в чате? Я обнаружил, что плагин отключает эмодзи только в постах.

---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [18.Апрель.2024 09:21:04 UTC](https://meta.discourse.org/t/omit-emoji-component/119562/9 "2024-04-18T09:21:04Z")

</div>

Теперь у нас есть настройка администратора «Список запрещённых эмодзи», поэтому этот компонент темы может быть не так необходим, как раньше:

 ![emoji deny list](https://global.discourse-cdn.com/meta/original/4X/3/e/3/3e3bcbe1c900935fc9fd0b02f45db1e7e6d1a3aa.png)

Подойдёт ли вам использование этой настройки вместо компонента?

---

<div class="post-metadata">

### Author: ![Monikas](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/monikas/32/375316_2.png) [@Monikas](https://meta.discourse.org/u/Monikas)
#### Post date: [19.Январь.2025 11:40:32 UTC](https://meta.discourse.org/t/omit-emoji-component/119562/12 "2025-01-19T11:40:32Z")

</div>

Надеюсь, автор обновит последнюю версию Discourse, которая больше не работает.

 ![На изображении показан список пропущенных групп эмодзи, включая Смайлики и эмоции, Люди и тело, Животные и природа, Еда и напитки, Путешествия и места, Деятельность, Объекты, Символы и Флаги, с возможностью удаления разделов из селектора эмодзи. (Подпись сгенерирована ИИ)](https://global.discourse-cdn.com/meta/original/4X/1/7/3/173e5ff014cc8ebdc54209c6bf10de9cf89439ab.png)

 ![На изображении показан экран мобильного телефона с открытым селектором эмодзи, отображающим несколько вариантов эмодзи для добавления в текстовые сообщения. (Подпись сгенерирована ИИ)](https://global.discourse-cdn.com/meta/original/4X/0/a/8/0a8d5e54bf4ce7ce7544672b2c2281f4f8617ca2.png)

---

<div class="post-metadata">

### Author: ![tshenry](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tshenry/32/119495_2.png) [@tshenry](https://meta.discourse.org/u/tshenry)
#### Post date: [23.Январь.2025 04:30:39 UTC](https://meta.discourse.org/t/omit-emoji-component/119562/13 "2025-01-23T04:30:39Z")

</div>

Это определенно потребует обновления в соответствии с:

> <https://github.com/discourse/discourse/pull/28277>
>
> The chat emoji picker is renamed emoji-picker, and the old emoji-picker is remov…ed.
> 
> This commit doesn't attempt to fully rework a new emoji-picker but instead tries to migrate everything to one picker (the chat one) and add small changes.
> 
> Other notable changes:
> \- all the favorite emojis code has been mixed into one service which is able to store one state per context, favorites emojis will be stored for all topics, and for each chat channel. Meaning that if you always use a specific emoji in a channel, it will only show as favorite emoji in this channel.
> \- a lot of static code has been removed which should improve initial load perf of discourse. Initially this code was around to improve the performance of the emoji picker rendering.
> \- the emojis are now stored, once the full list has been loaded, if you close and reopen the picker it won't have to load them again.
> 
> List of components:
> 
> \- \`\<EmojiPicker /\>\` will render a button which will open a dropdown
> \- \`\<EmojiPickerContent /\>\` represents the content of the dropdown alone, it's useful when you want to render a picker from an action which is not the default picker button
> \- \`\<EmojiPickerDetached /\>\` just a simple wrapper over \`\<EmojiPickerContent /\>\` to make it easier to use it with \`this.menu.show(...)\`

К сожалению, в данный момент у меня нет на это ресурсов. Если кто-то захочет попробовать, я с радостью рассмотрю ваш PR.

На данный момент, боюсь, мне придется пометить это как неработающее 😢

* * *

ℹ Помните, что существует настройка сайта «список запрещенных эмодзи». Если вы хотите удалить множество эмодзи, это может быть утомительно, но такой вариант существует.

---

<div class="post-metadata">

### Author: ![Arkshine](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/arkshine/32/298682_2.png) [@Arkshine](https://meta.discourse.org/u/Arkshine)
#### Post date: [27.Январь.2025 04:01:35 UTC](https://meta.discourse.org/t/omit-emoji-component/119562/14 "2025-01-27T04:01:35Z")

</div>

Я предложил PR для исправления TC 👍

> <https://github.com/tshenry/discourse-omit-emoji/pull/1>
>
> This PR fixes the compatibility with the latest Discourse version.
> 
> The change…s are:
> \* Emoji picker:
> \* \`component:emoji-picker\` -\> \`component:emoji-picker/content\`
> \* Instead of relying on DOM manipulation, simplify by changing the output of \[\`get groups()\`\](https://github.com/discourse/discourse/blob/main/app/assets/javascripts/discourse/app/components/emoji-picker/content.gjs#L101) and\[\`get flatEmojis()\`\](https://github.com/discourse/discourse/blob/main/app/assets/javascripts/discourse/app/components/emoji-picker/content.gjs#L121) (input filter)
> \* Autocomplete:
> Essentially, the same with the following differences:
> \* Relies on \`setupEditor\` and calls \`.disconnect()\` on cleanup
> \* Classnames are checked separately to add compatibility with other components.
> \* Uses \`node\` context to get the parent directly
> \* Parent is hidden instead of removed; it messes up the result on click.
> \* Added a few system tests
> \* Added lint config files
> \* Add CI config files
> \* Pin TC to 3.4.0.beta4-dev
> 
> Let me know what you think. Hopefully, I did not miss something.

---

<div class="post-metadata">

### Author: ![Kartoon](https://avatars.discourse-cdn.com/v4/letter/k/e36b37/32.png) [@Kartoon](https://meta.discourse.org/u/Kartoon)
#### Post date: [18.Май.2025 06:51:59 UTC](https://meta.discourse.org/t/omit-emoji-component/119562/15 "2025-05-18T06:51:59Z")

</div>

> [@tshenry](#):
>
> ℹ Помните, что существует настройка сайта «список запрещённых эмодзи». Это утомительно, если вы хотите удалить множество эмодзи, но это вариант.

Это было бы идеально, если бы они добавили возможность отключать целые категории, тогда этот (сломанный 😅) компонент точно стал бы избыточным.

На самом деле нет, это всё ещё будет актуально — мне нравится иметь возможность использовать их, если знаешь код, но при этом не захламлять меню.
