#How do I check if there are too many characters in text

1 messages · Page 1 of 1 (latest)

worn stratus
#

I'm making a chat system and trying to make it so the chats can't be flooded but I'm not sure how to do that, also how do I check for messages with only spaces?

tiny cove
#

U can just remove all spaces from the message and check if the message is empty

#

As for checking for spam you can just log the amount of messages a player has sent and remove the first entry after a certain time, repeatedly, and if the amount of messages exceed your limit just don’t send anything

#

there’s def a better solution than that but just throwing out some ideas

worn stratus
#

what about if there's too many spaces before text?

steel cape
worn stratus
#

yeah but like is there anyway to check for text after the space?

tiny cove
#

If the message still contains any content after the removal of the spaces then you have your message..?

worn stratus
tiny cove
#

?

civic cosmos
#

:>