Comments (7)
the problem is in concept of loading bot logic from route file because botman-resolving will be triggered for each application request even if it is absolutely unnecessary
I moved botman logic from route file to Controller handle method BotManController@handle. It solve problem globally, not only for yajra/laravel-datatables-oracle
Do not forget to add your webhook path to $except array in VerifyCsrfToken Middleware
from driver-telegram.
Can you show us what code you wrote, just showing the error doesn't help enough.
from driver-telegram.
Actually, I don't know exactly what went wrong. It happened when I add this package https://packagist.org/packages/yajra/laravel-datatables-oracle to my project. Seems really odd. Which code should I provide? Thanks!
from driver-telegram.
Hmm what happens when you remove this package? Is it then working again? If not, then for us, it would be good to know what you did when you get this error. Did you write something to the bot? What is the code that you wrote or have you tested the BotMan Studio examples?
from driver-telegram.
I having the same problem with the implementation of datatable with Botman
from driver-telegram.
I got same issue with Botman v.2.6.1, telegram driver v1.6.2 and Laravel 5.8. Not sure why and I do not know how to reproduce it, but sometimes, $value
in closure is an array. that is why line 154.
return $key.'='.$value;
throws exception. Still investigating. I will update when I get more information. I do not use datatable by the way as other mentioned, so I do not think this is related to datatable.
[2022-05-04 04:23:50] production.ERROR: Array to string conversion {"exception":"[object] (ErrorException(code: 0): Array to string conversion at /home/sinbot/vendor/botman/driver-telegram/src/TelegramDriver.php:154)
[stacktrace]
#0 /home/sinbot/vendor/botman/driver-telegram/src/TelegramDriver.php(154): Illuminate\\Foundation\\Bootstrap\\HandleExceptions->handleError()
#1 [internal function]: BotMan\\Drivers\\Telegram\\TelegramDriver->BotMan\\Drivers\\Telegram\\{closure}()
#2 /home/sinbot/vendor/laravel/framework/src/Illuminate/Support/Collection.php(1120): array_map()
#3 /home/sinbot/vendor/botman/driver-telegram/src/TelegramDriver.php(155): Illuminate\\Support\\Collection->map()
#4 /home/sinbot/vendor/botman/driver-telegram/src/TelegramDriver.php(123): BotMan\\Drivers\\Telegram\\TelegramDriver->isValidLoginRequest()
#5 /home/sinbot/vendor/botman/botman/src/Drivers/DriverManager.php(174): BotMan\\Drivers\\Telegram\\TelegramDriver->hasMatchingEvent()
#6 /home/sinbot/vendor/botman/botman/src/BotManFactory.php(68): BotMan\\BotMan\\Drivers\\DriverManager->getMatchingDriver()
#7 /home/sinbot/vendor/botman/botman/src/BotManServiceProvider.php(22): BotMan\\BotMan\\BotManFactory::create()
#8 /home/sinbot/vendor/laravel/framework/src/Illuminate/Container/Container.php(785): BotMan\\BotMan\\BotManServiceProvider->BotMan\\BotMan\\{closure}()
#9 /home/sinbot/vendor/laravel/framework/src/Illuminate/Container/Container.php(667): Illuminate\\Container\\Container->build()
#10 /home/sinbot/vendor/laravel/framework/src/Illuminate/Container/Container.php(615): Illuminate\\Container\\Container->resolve()
#11 /home/sinbot/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(767): Illuminate\\Container\\Container->make()
#12 /home/sinbot/vendor/laravel/framework/src/Illuminate/Foundation/helpers.php(121): Illuminate\\Foundation\\Application->make()
#13 /home/sinbot/vendor/laravel/framework/src/Illuminate/Foundation/helpers.php(733): app()
#14 /home/sinbot/routes/botman.php(5): resolve()
#15 /home/sinbot/app/Providers/RouteServiceProvider.php(40): require('/home/sinbot/ap...')
#16 /home/sinbot/app/Providers/RouteServiceProvider.php(30): App\\Providers\\RouteServiceProvider->mapBotManCommands()
#17 [internal function]: App\\Providers\\RouteServiceProvider->map()
#18 /home/sinbot/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(32): call_user_func_array()
#19 /home/sinbot/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(90): Illuminate\\Container\\BoundMethod::Illuminate\\Container\\{closure}()
#20 /home/sinbot/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(34): Illuminate\\Container\\BoundMethod::callBoundMethod()
#21 /home/sinbot/vendor/laravel/framework/src/Illuminate/Container/Container.php(576): Illuminate\\Container\\BoundMethod::call()
#22 /home/sinbot/vendor/laravel/framework/src/Illuminate/Foundation/Support/Providers/RouteServiceProvider.php(87): Illuminate\\Container\\Container->call()
#23 /home/sinbot/vendor/laravel/framework/src/Illuminate/Foundation/Support/Providers/RouteServiceProvider.php(36): Illuminate\\Foundation\\Support\\Providers\\RouteServiceProvider->loadRoutes()
#24 [internal function]: Illuminate\\Foundation\\Support\\Providers\\RouteServiceProvider->boot()
#25 /home/sinbot/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(32): call_user_func_array()
#26 /home/sinbot/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(90): Illuminate\\Container\\BoundMethod::Illuminate\\Container\\{closure}()
#27 /home/sinbot/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(34): Illuminate\\Container\\BoundMethod::callBoundMethod()
#28 /home/sinbot/vendor/laravel/framework/src/Illuminate/Container/Container.php(576): Illuminate\\Container\\BoundMethod::call()
#29 /home/sinbot/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(827): Illuminate\\Container\\Container->call()
#30 /home/sinbot/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(810): Illuminate\\Foundation\\Application->bootProvider()
#31 [internal function]: Illuminate\\Foundation\\Application->Illuminate\\Foundation\\{closure}()
#32 /home/sinbot/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(811): array_walk()
#33 /home/sinbot/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/BootProviders.php(17): Illuminate\\Foundation\\Application->boot()
#34 /home/sinbot/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(210): Illuminate\\Foundation\\Bootstrap\\BootProviders->bootstrap()
#35 /home/sinbot/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(162): Illuminate\\Foundation\\Application->bootstrapWith()
#36 /home/sinbot/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(146): Illuminate\\Foundation\\Http\\Kernel->bootstrap()
#37 /home/sinbot/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(116): Illuminate\\Foundation\\Http\\Kernel->sendRequestThroughRouter()
#38 /home/sinbot/public/index.php(55): Illuminate\\Foundation\\Http\\Kernel->handle()
#39 {main}
"}
from driver-telegram.
The problem is still there and is thrown randomly on the line 154. I can see it in logs.
driver-telegram/src/TelegramDriver.php
Line 154 in b681bf9
I can reliably reproduce it when I'm trying to delete an object from the DB via Laravel Nova (v2). I have no idea why Telegram driver is even called in that case. Looks like isValidLoginRequest()
is called by mistake.
From Nova request I can see that $this->queryParameters
is equal to {"search":"","filters":"W10=","trashed":"","resources":["6157"]}
and as you can see the last parameter is an array.
I believe @AlekseiiShevchuk is right and the Telegram Driver is called all the time even when it's not needed because it runs from routes. @AlekseiiShevchuk could you, please, share some code?
Looks like getting rid of routes/botman.php
makes tests impossible.
from driver-telegram.
Related Issues (20)
- Is it possible to send local files (not by URL)? HOT 2
- Receiving image caption HOT 2
- How to send video via telegram bot HOT 1
- Not working callback_data in menu HOT 3
- Feature request: Implement sendMediaGroup for attachments
- How to get callback_query_id into Conversation HOT 1
- Feature request / suggest: detect when message is pinned / unpinned
- Replace PSR-2 with PSR-12
- The tests GitHub workflow is not working HOT 1
- Error with contacts that don't have telegram account!
- Is there way to send files (not images) without extending the driver?
- New Feature: Get the complete chatMember object
- TODO: Improve documentation HOT 4
- Undefined index: vcard in TelegramContactDriver HOT 3
- how we could add custom generic events?
- Add new exceptions: bot was blocked by the user, chat not found
- Error retrieving user contact HOT 1
- TelegramInlineQueryDriver [feature discussion]
- Class 'BotMan\BotMan\Messages\Attachments\Contact' not found HOT 1
- How to use Keyboard HOT 2
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 driver-telegram.