Gankra / cargo-mommy

Mommy's here to support you when running cargo~
https://faultlore.com/cargo-mommy/
Apache License 2.0
726 stars 49 forks source link

Regex filtering through environment variables for responses? #61

Open fuel-pcbox opened 9 months ago

fuel-pcbox commented 9 months ago

I have extremely severe Tourette's Syndrome, and almost all of my triggers are extremely common, and cause me great physical pain through motor tics (taking the form of painful twitching). Unfortunately, some of my triggers are in the current database of responses for certain moods, so I can't exactly use the full extent of cargo-mommy's features, without editing responses.json. Thankfully, if cargo-mommy supported regexes (with hex escapes so that I don't have to type my triggers, since that would also trigger me) for filtering out certain responses via an environment variable, all I'd have to do is set an environment variable in my .bashrc or whatever, and cargo-mommy would be safe for me to use. Sadly, I don't have much experience with the Rust ecosystem, so I have no idea what crates would be best for this, or how to implement this effectively.

fuel-pcbox commented 9 months ago

I will also note that I have something similar set up for my IRC client, HexChat, using a Python script. It's kinda finicky and doesn't always work, but when it does it's pretty great.

FWDekker commented 6 months ago

Not to toot my own horn (well, maybe just a little bit), but my own mommy implementation allows you to filter out phrases that include specific words or phrases using the MOMMY_FORBIDDEN_WORDS setting. If you have any issues or suggestions for the feature, feel free to open an issue over there.