Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Save all outgoing messages from bot. #106

Open
prtngn opened this issue Mar 1, 2023 · 1 comment
Open

Save all outgoing messages from bot. #106

prtngn opened this issue Mar 1, 2023 · 1 comment

Comments

@prtngn
Copy link
Contributor

prtngn commented Mar 1, 2023

I need all outgoing messages to be saved in the database. How can this be implemented with minimal costs?

@rockneurotiko
Copy link
Owner

That's a good question, and a use case that I haven't thought yet.

I think that the best way to handle this would be to improve #97 and add a telemetry message on executed methods.

It would be somewhere near here: https://github.com/rockneurotiko/ex_gram/blob/master/lib/ex_gram/macros/executer.ex#L48 and it would send a telemetry event like [:ex_gram, :method, :executed] with at least the method, body and result in the metadata

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants