TeleDart
TeleDart copied to clipboard
`chat_id` need to accept type of int and string
Describe the bug
Currently it only accept id(int), however according to the official docs, it needs to accept username(string) also
Unique identifier for the target chat or username of the target channel (in the format `@channelusername`)
https://github.com/dart-lang/sdk/issues/4938
Any likelyhood of applying the patch?
@castaway I'm opposed to use dynamic
in the library, as it beat the purpose of having it statically typed. I have been looking into sealed_unions which does union type, still not decided to use it or not.
Fair enough, could always make a sendChatMessage, sendUserMessage ? Or always take a string, and convert to int when sending if it parses as one?
@castaway changing function parameters type would be considered a breaking change, which means it would break all existing bots depends on this library.
Although adding seperated implementation for each send message function would fix the issue we face, it also add unnecessary complexity to the project.
It is indeed a tough decision to make.
#99 has a better idea