# Detecting oversized message in NLU component

**URL:** <https://forum.rasa.com/t/detecting-oversized-message-in-nlu-component/48592>\
**Category:** Rasa Open Source\
**Created:** [October 19, 2021, 9:05am UTC](https://forum.rasa.com/t/detecting-oversized-message-in-nlu-component/48592 "2021-10-19T09:05:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![IgNoRaNt23](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/ignorant23/32/8029_2.png) [@IgNoRaNt23](https://forum.rasa.com/u/IgNoRaNt23)\
**Post date:** [October 19, 2021, 9:05am UTC](https://forum.rasa.com/t/detecting-oversized-message-in-nlu-component/48592/1 "2021-10-19T09:05:46Z")

</div>

Hi, currently using Rasa 2.4.3.

I’m trying to build a custom component that detects too long message (we have a size limit in the UI, but still one could send messages to the bot directly), deletes the message and sets a specific intent, so that we can react to this later. However, I can’t find a way to manipulate the incomming message. I read some guides about spell corrector components, which basically try the same thing, but they seem to be outdated. So, how do I change the message text in a component so that every component later sees the altered message and not the original?

---

<div class="post-metadata">

**Author:** ![koaning](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/koaning/32/6626_2.png) [@koaning](https://forum.rasa.com/u/koaning)\
**Post date:** [October 27, 2021, 11:43am UTC](https://forum.rasa.com/t/detecting-oversized-message-in-nlu-component/48592/2 "2021-10-27T11:43:29Z")

</div>

Technically, you could write a custom component that removes text from the incoming message before it is passed on to the tokenizer. This, mainly technical, would work for Rasa Open Source `2.x` but it would be a giant hack that won’t work in Rasa Open Source 3.0 going forward.

I wonder. If there is a size limit in the UI, doesn’t that already prevent very long messages from getting to the bot?

---

<div class="post-metadata">

**Author:** ![IgNoRaNt23](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/ignorant23/32/8029_2.png) [@IgNoRaNt23](https://forum.rasa.com/u/IgNoRaNt23)\
**Post date:** [October 27, 2021, 11:55am UTC](https://forum.rasa.com/t/detecting-oversized-message-in-nlu-component/48592/3 "2021-10-27T11:55:43Z")

</div>

We fixed the issue now, with a custom connector, that prevents oversized messages from reaching the bot.

Sure the UI may be limited, but it is always possible to circumvent the UI using a script and sending oversized messages to the bot directly.
