Comments (6)
i'm working on this, but currently i'm not sure how i'll implement it.
from telegram.bot.
Hi,
could you show some samples of your work version to us?
from telegram.bot.
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.
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.
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.
Fixed by #847.
from telegram.bot.
Related Issues (20)
- Bot API 6.8 (August 18, 2023)
- Missing documentation InputOnlineFile => InputFileUrl HOT 3
- Bot API 6.9 (September 22, 2023)
- Could we have InputMediaBase inherit from IAlbumInputMedia? HOT 3
- Erro não autorizado HOT 2
- Bug Report - Lack of Graceful Shutdown in Message Updates Handling HOT 4
- Replace Newtonsoft.Json with System.Text.Json with proper source generation HOT 10
- Release 19.0.1 HOT 3
- Bot API 7.0 (December 29, 2023)
- Calling MakeRequestAsync with Stream content more then once results in error HOT 2
- Looks like this source generator is completely non incremental HOT 3
- telegram.bot is missing NuGet package README file
- Telegram.Bot.dll PUA classification with ESET problem HOT 5
- Send v20.0.0-alpha.3 to nuget plz HOT 1
- Project is not compatible with net8.0 (.NETCoreApp,Version=v8.0) HOT 7
- System.Text.Json deserialization issue HOT 5
- Temporary alternative NuGet feed due to AV software false positives
- GetStickerSetAsync() fails: Required property 'is_animated' not found in JSON HOT 2
- Required property 'is_animated' not found in JSON HOT 2
- How to resize replymarkup? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from telegram.bot.