Giter VIP home page Giter VIP logo

Comments (6)

MrRoundRobin avatar MrRoundRobin commented on May 16, 2024

i'm working on this, but currently i'm not sure how i'll implement it.

from telegram.bot.

a-a-k avatar a-a-k commented on May 16, 2024

Hi,
could you show some samples of your work version to us?

from telegram.bot.

mhverbakel avatar mhverbakel commented on May 16, 2024

The problem is that the called methods are all plain dictionaries at the moment. To be able to return them in MVC for example, you would need to switch to classes for method calls, and return an instance of that class using this.Json(instance) (in MVC).

Another option is making internal helper methods that generate the request parameters, and exposing them through public methods. Where you usually return with a return SendWebRequestAsync, you replace that by setting the method parameter and returning the dictionary. The client of the library can then handle outputting that in the webhook response.

from telegram.bot.

mikemikhaylov avatar mikemikhaylov commented on May 16, 2024

Maybe it's better to just return instance of some class that represents http response?
I mean some custom class, not HttpResponseMessage.
This class will have string body property, and some properies with headers.
This would hide all implementation details and would not expose dictionary to the client.

from telegram.bot.

Olfi01 avatar Olfi01 commented on May 16, 2024

I have looked into this, and it seems that you've just got to return a json-encoded object containing all the parameters and the method name. So how about just adding a class for that? I'll try to do something like that.

from telegram.bot.

tuscen avatar tuscen commented on May 16, 2024

Fixed by #847.

from telegram.bot.

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.