Git Product home page Git Product logo

Comments (3)

marcelcorso avatar marcelcorso commented on September 23, 2024

thanks @callowaylc. Pull request #44 should fix it, right?

from sachet.

callowaylc avatar callowaylc commented on September 23, 2024

Theoretically, it should, but I haven't tested it.

Browsing through cmd/sachet/main.go and examples/config.yaml, there seems to be a disconnect between the token definition, defined "in" config.telegram.token, and the unmarshaling of the receiver object, which does not contain the bot token.
https://github.com/messagebird/sachet/blob/master/examples/config.yaml#L22-L23
https://github.com/messagebird/sachet/blob/master/examples/config.yaml#L40-L43

Unless I am mistaken, when we unmarshal the receiver, it shouldn't contain the token.
https://github.com/messagebird/sachet/blob/master/cmd/sachet/main.go#L50-L55

Which if the case, token will not be present there.
https://github.com/messagebird/sachet/pull/44/files#diff-f0743f22c708ff8f49227a99aa165690R19

from sachet.

marcelcorso avatar marcelcorso commented on September 23, 2024

Nice that you spent time looking!

The thing is that I think it works :-D

Right at the beginning of the handler we get the receiver name from the request (call to receiverConfByReceiver):
https://github.com/messagebird/sachet/blob/master/cmd/sachet/main.go#L50

With the receiverConf we do providerByName. There is a simple switch and here
https://github.com/messagebird/sachet/blob/master/cmd/sachet/main.go#L152 you see we instantiating a telegram.Telegram passing the config.Providers.Telegram that has the token!

Back in main we use that provider by calling Send on it https://github.com/messagebird/sachet/blob/master/cmd/sachet/main.go#L96

all should work :-D

from sachet.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.