-
Notifications
You must be signed in to change notification settings - Fork 204
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
Feature Request: Telegram TEST mode #1039
Comments
There is I'm not sure I like the "mode enum" solution. Should we maybe just allow you to forge the full url? i.e. store something like |
If I understand correctly, Here's an example: fn main() {
let token = "_token_";
let method_name = "_method_";
let api_url = url::Url::parse(&format!("https://api.telegram.org/bot{token}/test")).unwrap();
println!("api_url = {}, full = {}", api_url, api_url.join(&format!("/bot{token}/{method_name}")).unwrap());
} result
It seems too convoluted for such a task. I'll have to set up a separate proxy application that is only needed for testing purposes. I'll try to implement this approach for now.
Regarding this, I think it wouldn't hurt to consider the possibility of working with the test environment in a more convenient way than using a separate proxy 🤓 |
To be clear: the proxy thing is a workaround, not a solution. I think it's reasonable to expect teloxide to provide a convenient way of calling into the test environment. |
I couldn't find any description anywhere on how to make the bot send requests to the Telegram test environment (if there is any mention of it somewhere, please let me know).
I suggest adding an option to the bot called "mode," which will have values Prod (by default) / Test.
As an example, this can be done as follows:
Then pass the value of mode to the function for creating the URL request:
Pros
Cons
Unable to find
The text was updated successfully, but these errors were encountered: