nzlosh / err-stackstorm

StackStorm ChatOps for Errbot.
Apache License 2.0
16 stars 13 forks source link

customizable prefix? #24

Closed moet78 closed 4 years ago

moet78 commented 5 years ago

What to do to setup customizable prefix? for both the !st2 and !st2help part. I am hoping to customize this so we can use the same bot for different environment

nzlosh commented 5 years ago

This is a feature I had wanted to include but the problem is more complex than it would appear.

Due to the way triggers are defined (Python function decorators) and the moment user configuration is available to the err-stackstorm plugin, I've not been able to find a way to allow users to customise the trigger without modifying the source code.

That said, I'll take another look at the issue to see if I can find a workaround/solution.

nicholasamorim commented 5 years ago

Yeah, same use case here. We can't unify our ST2 deployment because the dev and prod environment do not talk to each other. So we'd like another bot in the channels but can't do because of this.

moet78 commented 5 years ago

Right now I add a different bot for prod, and also a different channel for prod chatops to get around this. I find it actually is a clean solution as it leave very little room for confusion. Might also work for you

nzlosh commented 5 years ago

@moejarv @nicholasamorim I've created a branch called plugin_prefix. The st2help is currently unchangable, but once I find the way to customise it, I'll merge the branch to master. In the mean time you can test the new feature if you wish. You just need to add a new variable to the STACKSTORM dictionary in config.py. The variable must be placed at the root of the dictionary and is called plugin_prefix.

nzlosh commented 4 years ago

plugin_prefix branch has been updated to allow modification of st2help prefix too.