Comments (12)
Hi @lawik,
I've pushed branch ISSUE-137
, it extend the example/example_bot.exs
with a command to send you back a photo.
Just tested right now and "it works on my machine"!
Could you play there and check again?
Start the bot from that branch:
~/Code/telegram ISSUE-137
❯ BOT_TOKEN=___YOUR_BOT_TOKEN___ ./example/example_bot.exs
then from a telegram client send to your bot the command /send_photo
.
You should get back the telegram logo without notification sound.
If you can pin the variables that give you the issue will be easier to backtrack the root cause.
from telegram.
Some constraints on photos are described here (max 10 MB, ...) https://core.telegram.org/bots/api#sendphoto
Anyway, a HTTP request (multipart or not) should end soon or later, even more considering:
@gun_config Application.compile_env(:telegram, :gun_config,
timeout: 60_000,
connect_timeout: 5_000,
certificates_verification: true)
from telegram.
Did some fun debugging. My images were slightly bigger, 211Kb and up. Not big by any means but bigger than 6.3Kb that you have for testing. So yours is just under 64Kb :)
I tried padding your image with 1Kb of nulls until a send failed.
I was okay sending 64745 bytes.
I failed sending 65769 bytes.
from telegram.
So yes, your example works. No other image I have will :D
from telegram.
Oh, and it never returns. It idles for 30 seconds and then times out and retries.
from telegram.
Ahh!
I would like to play with the tesla Telegram.Client
adapter.
Currently it uses gun
and the Retry middleware (with default opts)
from telegram.
It also happens with both {:file_content, binary, name}
and {:file, path}
variants which was surprising.
I just tried switching the entire client to Hackney. Went through, no issue. So this is probably an issue with Gun then.
Seems similar to this: elixir-tesla/tesla#230
from telegram.
Exactly what I expected!
Maybe more close elixir-tesla/tesla#394.
Honestly, the HTTP side of things is really horrible Erlang/Elixir side.
(even more now, when 99% of the beam app find application in the web and the 5G inter-NF is HTTP based).
from telegram.
Well found! That is the exact issue but not the same HTTP client.
I haven't had many problems with the HTTP-clients but I'll take your word for it :)
from telegram.
Is there a particular reason this library configures Gun and not another HTTP library? Can it be overridden with config?
I don't have time to figure out the Tesla problem but switching to Hackney seems to work fine.
from telegram.
No particular reason.
The tesa client adapter and its config could be made configurable, ie the library user can choose what to use or just leave the default (hackney).
And, by the way, the need to have an HTTP client stays in the pooler, that should be used in dev mode or if serving small amount of traffic. Another way to say it doesn't matter that much what client you use unless you have strong dependency requirements.
from telegram.
@lawik could you give a quick review to #138 ?
from telegram.
Related Issues (14)
- HandShake error HOT 1
- Phoenix and Webhooks mode. HOT 1
- Callback query. Can't find chat field HOT 1
- Is there any reason this is not on Hex? HOT 2
- how can I silent the message Authenticity is not established by certificate path validation HOT 1
- `ChatBot` running in `Poller` mode gets `{:error, "Too Many Requests: retry after 5"}` HOT 4
- `Poller` terminates on `{:error, "Bad Gateway"}` HOT 3
- bad child specification, more than one child specification has the id HOT 2
- handle_info in Telegram.ChatBot HOT 5
- Configurable Api and Bot options
- [Question] How should I call the DSL from webhooks HOT 1
- Multiple custom commands not matching HOT 2
- Error on deps compile 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.