Comments (8)
@trogwarz You can try this.
services:
GuzzleHttp\Client:
arguments:
- { timeout: 120, proxy : '%env(TELEGRAM_PROXY)%'}
Http\Adapter\Guzzle6\Client:
arguments:
- '@GuzzleHttp\Client'
TgBotApi\BotApiBase\ApiClient:
arguments:
$requestFactory: '@Psr\Http\Message\RequestFactoryInterface'
$streamFactory: '@Psr\Http\Message\StreamFactoryInterface'
$client: '@Http\Adapter\Guzzle6\Client:'
from bot-api-base.
Sorry for late answer. This works, thank you!
from bot-api-base.
Hi! We will add possibility to answer webhooks in 2-3 days (#30).
from bot-api-base.
@Big-Shark I think you can show examples for few clients. It's may come in handy for all.
from bot-api-base.
I mean, not only answer to them but sending requests too, in general.
It would be awesome if there will be possibility to set proxy in yaml config. 👍
from bot-api-base.
Аbout proxy, you can set it up in your http client config:
symfony http client can follows system proxies
for other clients you can find it in client docs.
@Big-Shark, please provide examples how to set guzzle up in symfony config, or, maybe, set other clients too.
from bot-api-base.
@trogwarz Can you send me your YAML config? Because I need to know, what do you use, Symfony HTTP client, buzz, guzzle, or something else.
from bot-api-base.
@trogwarz Can you send me your YAML config? Because I need to know, what do you use, Symfony HTTP client, buzz, guzzle, or something else.
Sure. Here is some info about packages and versions i'm using. From server that is outside of Russia – works perfectly. It would be great to write help information about proxy config in that situation.
php:7.4
symfony/*:5.0.7
tg-bot-api/bot-api-base:1.3.3
nyholm/psr7:1.2.1
http-interop/http-factory-guzzle:1.0.0
php-http/guzzle6-adapter:2.0.1
Config files:
./config/packages/nyholm_psr7.yaml
:
services:
# Register nyholm/psr7 services for autowiring with PSR-17 (HTTP factories)
Psr\Http\Message\RequestFactoryInterface: '@nyholm.psr7.psr17_factory'
Psr\Http\Message\ResponseFactoryInterface: '@nyholm.psr7.psr17_factory'
Psr\Http\Message\ServerRequestFactoryInterface: '@nyholm.psr7.psr17_factory'
Psr\Http\Message\StreamFactoryInterface: '@nyholm.psr7.psr17_factory'
Psr\Http\Message\UploadedFileFactoryInterface: '@nyholm.psr7.psr17_factory'
Psr\Http\Message\UriFactoryInterface: '@nyholm.psr7.psr17_factory'
# Register nyholm/psr7 services for autowiring with HTTPlug factories
Http\Message\MessageFactory: '@nyholm.psr7.httplug_factory'
Http\Message\RequestFactory: '@nyholm.psr7.httplug_factory'
Http\Message\ResponseFactory: '@nyholm.psr7.httplug_factory'
Http\Message\StreamFactory: '@nyholm.psr7.httplug_factory'
Http\Message\UriFactory: '@nyholm.psr7.httplug_factory'
nyholm.psr7.psr17_factory:
class: Nyholm\Psr7\Factory\Psr17Factory
nyholm.psr7.httplug_factory:
class: Nyholm\Psr7\Factory\HttplugFactory
./config/packages/tg_bot_api.yaml
:
services:
TgBotApi\BotApiBase\ApiClient:
arguments:
$requestFactory: '@Psr\Http\Message\RequestFactoryInterface'
$streamFactory: '@Psr\Http\Message\StreamFactoryInterface'
$client: '@Psr\Http\Client\ClientInterface'
TgBotApi\BotApiBase\BotApiNormalizer: null
TgBotApi\BotApiBase\ApiClientInterface: '@TgBotApi\BotApiBase\ApiClient'
TgBotApi\BotApiBase\NormalizerInterface: '@TgBotApi\BotApiBase\BotApiNormalizer'
TgBotApi\BotApiBase\BotApi:
arguments:
$botKey: '%env(resolve:TG_BOT_API_KEY)%'
$apiClient: '@TgBotApi\BotApiBase\ApiClientInterface'
$normalizer: '@TgBotApi\BotApiBase\NormalizerInterface'
TgBotApi\BotApiBase\BotApiComplete:
parent: TgBotApi\BotApiBase\BotApi
TgBotApi\BotApiBase\BotApiInterface: '@TgBotApi\BotApiBase\BotApi'
from bot-api-base.
Related Issues (20)
- New version bot api released HOT 1
- Bot api update April 24, 2020
- Normalize problem with prices attribute of SendInvoiceMethod HOT 3
- Bot api update June 4, 2020 HOT 1
- Packages conflict on Laravel 7 HOT 2
- BotApi::edit(EditMessageMediaMethod) cast error HOT 8
- Bot api version 5 (November 4, 2020)
- Replace Travis to GithubActions
- Update library to support Bot API 5.1 HOT 2
- Баг нормализации InlineKeyboardMarkupType HOT 2
- Bot
- All_languages_music_bot
- All_languages_music_bot HOT 1
- Carding spamming Cc tools
- CC tools Carding IG & Fb logs
- Entities property of SendMessageMethod misses important comment HOT 2
- Bot
- Microcom
- telegrambot
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 bot-api-base.