Comments (11)
Hi, which URL are you sending?
There was a change on the Telegram API, maybe for a while wasn’t working.
Test are passing now, could you please check again? Thanks
from node-telegram-bot-api.
Hi & thanks for getting back to me so quick.
It's still failing, the URL that is used is:
https://api.telegram.org/<token>/sendPhoto
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.....).
from node-telegram-bot-api.
I mean the request URL (someUrl
) on client.sendPhoto(config.group_chat_id, request(someUrl));
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 Unhandled rejection Error: 400 {"ok":false,"error_code":400,"description":"Error: AUDIO_EXT_INVALID"}
from node-telegram-bot-api.
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
problem I guess.
Can you run the demo in `/examples? ? I'm getting the same error for any kind
of upload here.
Thanks!
from node-telegram-bot-api.
Maybe it because of the lib make only GET requests, not POST. So large queries can be cut.
from node-telegram-bot-api.
@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.
from node-telegram-bot-api.
In order to send form data, it sends a POST
request. Could you please provide me the URL which you are testing? It works fine with URL with file format extension because Telegram needs an extension.
from node-telegram-bot-api.
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 /examples/polling.js
as it would fail with the exact same error.
from node-telegram-bot-api.
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
from node-telegram-bot-api.
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).
from node-telegram-bot-api.
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.
from node-telegram-bot-api.
Related Issues (20)
- Does the API not support:Message about members leaving the group? HOT 1
- How to get call on setmenubutton ?
- Stop listening for new message events and crash app
- how to create sticker with pack, i'm new with this library so i got many error while trying
- sendMediaGroup - InputMediaDocument HOT 2
- question how to save photos by reply HOT 1
- multiple upload file HOT 1
- bot.on('message', ...) works unexpected
- Occasionally not receiving message update
- Listening for a reply to an image with the '/isimage' command, replying with a message saying 'this is an image' HOT 1
- Deleting old message IDs in Telegram
- function createInvoiceLink not exist HOT 1
- Add to sendInvoice start_parameter HOT 2
- Pre-Checkout Timeout Error while making a Payment
- The editMessageMedia method is working a bit wrong
- The 'Update' object sometimes does not have an attribute 'reply_to_message' in private messages
- Webhook setup via URL returns blank
- Business Mode HOT 5
- please help me i got this error HOT 1
- Bot replys to user no problem, but when i want it to send announchment to channel or group. nothing happens
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 node-telegram-bot-api.