-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
sendPhoto returns 400 #12
Comments
Hi, which URL are you sending? |
Hi & thanks for getting back to me so quick. It's still failing, the URL that is used is:
A little unrelated (but maybe related again), I was looking at your tests as well but I'm not too sure if they work at all (that's probably another issue): When doing with a plain A+ promise: it('does stuff', function(done){
thingy().then(function(result){
assert(false);
done();
});
}); the test will still pass as the promise will swallow the thrown exception. So I usually use it like this: it('does stuff', function(){
return thingy().then(function(result){
assert(false);
});
}); I never use Bluebird though, so I don't know if it handles this smarter (I'm asking in hope for a yes, so I can get rid of that.....). |
I mean the request URL ( You can run the test with: DEBUG='node-telegram-bot-api' \
TEST_TELEGRAM_TOKEN=<YOUR_TOKEN> \
TEST_USER_ID=<YOUR_USER> ./node_modules/.bin/mocha test/index.js If promise fails, it will throw an |
I'm using random image URLs from flickr. I can save them to disk and do whatever with them so that should not be the Can you run the demo in `/examples? ? I'm getting the same error for any kind Thanks! |
Maybe it because of the lib make only GET requests, not POST. So large queries can be cut. |
@SerjoPepper I actually tried hacking on the lib to make it a POST as I was thinking the same thing as you, but it did not make a difference. I ended up "manually" (i.e. no lib) uploading the files which worked fine. |
In order to send form data, it sends a |
I was using full image URLs like: https://farm1.staticflickr.com/323/19723079154_f405855a4c.jpg But as I have already written above I also could not run the example bot in |
Did you try the test and passed them out? Clone the repository, get inside the folder and then: DEBUG='node-telegram-bot-api' \
TEST_TELEGRAM_TOKEN=<YOUR_TOKEN> \
TEST_USER_ID=<YOUR_USER> ./node_modules/.bin/mocha test/index.js |
Ok so this is super weird and seems to be an issue with Telegram. I created a new bot where the token works perfectly fine, whereas when I use the "old" token it will still return the 400. I'll try to use the two tokens with my own wrapper once I find the time to do so, so we can find out if this is a Telegram issue or not (sounds a lot like it). |
So this really is an issue with the token I am using. My own lib, test suites and everything fails when using that one single token. Everything else works. Going to contact Telegram regarding that. Thanks for your input and sorry for all that noise. |
I'm having trouble sending any type of media (photos in my case).
I'm passing a
request
Object (that has a readable Stream interface) tosendPhoto
yet telegram returns
I noticed the same thing happens when running the examples in the repository. Has there been an API change, am I doing something wrong or is this a bug?
The text was updated successfully, but these errors were encountered: