blackmesadev / black-mesa

Black Mesa is a Discord Moderation bot designed with Performance, Reliability and Customisation in mind.
https://blackmesa.bot
MIT License
20 stars 4 forks source link

Allow for the automod reason to be changed. #27

Closed damaredayo closed 2 years ago

damaredayo commented 2 years ago

Currently all automod reasons have the same format which is: Module -> Function (Cause for infraction).

I would like to expose some variables and allow for the user to be able to change the automod reason however they wish. {{module}} - Module {{function}} - Function {{trigger}} / {{cause}} - Trigger for infraction {{trigger_censored}} / {{trigger_censored}} - Censored trigger, it should be noted that this will cause the reason to be permanently censored, unlike if you were to enable censored searches while using standard trigger. {{strike_no}} - How many strikes the user now has. {{strikes_until}} - How many strikes until the user will receive their next punishment.

Then easily using a strings.Replace call will allow these to come into effect. It might be worth doing some caching for this though, which could be implemented by doing a strings.Replace call once to replace the appropriate substrings with %v, @LewisTehMinerz will benchmark if this is worth doing and follow up with whatever is the faster option.

RGBCube commented 2 years ago

maybe strike_num instead of strike_no?

damaredayo commented 2 years ago

Added in https://github.com/blackmesadev/black-mesa/commit/3ed734ffaf81609dc59da82861ab95b44bca354b.