A separate app or (better) an extension you can use with most texting apps that enables a betting game between users. The game is about not using certain words in chats. Whenever the rule is broken and the app detects "illegal" word, the one who used it is charged a small, predefined fee which instantly goes to the account of the other party.
The initial idea is about not using swear words, but such function could be used in many creative ways, from betting not to use filler words like um, eh, etc., to not using someone's ex-partner's name which still evokes hard feelings for the chat companion who recently broke up with that person (and so on).
Quit/weaken your bad verbal habits through a fun, challenging game.
Challenge someone else to quit their verbal habits, especially if they are annoying to you.
Become more self-conscious and train your determination.
Make some money in a fun way.
Such a game guarantees some fun at least for one, but most likely both participating sides. E.g., you can try to tease some swear words out of your companion. The companion can try to swear in funny "legal" ways, use weird abbreviations, etc.
Why text chats: It simply seems the easiest option to realize technically. You could use software to listen to people speak and try to identify forbidden words from speech, but it would be more complicated since written words are strictly defined by existing keyboard symbols and vocal sounds are way more diverse and harder to pinpoint. It could at least start as a texting game and maybe take other forms later, if it's successful.
The words: The easiest way for the software to know which words are "illegal" in chats is for the participants to define those themselves. E.g. if I got enough of the frequent swearing of my companion, I'll probably know by hard all the swear words they use (or If not, I can scroll through chats to check), so I can write a list of those, then additionally include all the possible abbreviations and alternatives. Then I show the list to the companion for him/her to agree not to use any of those words and once we had a deal we submit the list to the software. The list can be checked at any point by both sides after the bet has started, but it can't be modified, unless the bet is stopped, restarted, etc.
The fee: The participants agree on a per-word fee that seems fair to both sides, then define it to the software in the betting rules, together with the word list.
The end of the bet: The easiest way to go about this is to set the time limit after which the bet is over, e.g. - one month. To have a safety switch on your money you could define a limit amount, which, when paid, ends the bet. Let's say you pay 10 cents for one forbidden word to your partner, once you paid 10 EUR, the bet is over. This could also work both ways - whoever swears more and first pays the limit amount, loses. Perhaps the best would be to combine the two - either the time is over or you paid the limit amount, whichever happens first, stops the bet.
The bet could also end on mutual consent, e.g. if both sides decide to change the rules, include more words, change the fee, etc. Or the rules could be changed by mutual consent without stopping the bet.