how to call a function with params inside program when a action triggered?a
how to call a function with params inside program when a action triggered?a
do you have an example?
you can do:
actions:
- name: sample script
type: exec
cmd: python config/scripts/main.py <insert parameter>
and your script would handle what to do with the parameter. if you're talking about something else, i might need an example.
@wass3r hi, I am not using script, I wanna call a function inside go program itself, with params. Is that possible?
i think the short answer is "no".
however, you could modify the Go app to accept command line args that call the function. but without modifying the Go code, i don't think there's a way.
@wass3r no , I mean, call the go code along with bot code, I have a operator object must initialized along with bot it self. which is injected into flatboat already.
I just wanna using yaml to config a func, and then execute this func (by name) inside same program , not a standalone executable file.
so you kind of want to use this as a module in your own code? it's not really meant or written for that purpose.
@wass3r Yes. May can done with some reflection way? Do u know any idea if I have this command?