Comments (10)
update, when I'm enable the log feature.
$telegram->setLogRequests(true);
$telegram->setLogPath($BOT_NAME.'.log');
the result is:
D:\xampp\htdocs\tgbot>php getUpdatesCLI.php
Catchable fatal error: Object of class Longman\TelegramBot\Entities\ServerResponse could not be converted to string in D:\xampp\htdocs\tgbot\vendor\longman\telegram-bot\src\Request.php on line 80
line 80 Request.php : $status = file_put_contents($path, self::$input . "\n", FILE_APPEND);
I'm also tried to make emty file for log file manually : botname.log
The result is still the same
then I open ServerResponse.php, on line 93, I enable this : throw new TelegramException('ok(variable) is not set!');
so, the result come like this
D:\xampp\htdocs\tgbot>php getUpdatesCLI.php
ok(variable) is not set!
just to make sure, this getUpdate result using http api
{"ok":true,"result":[{"update_id":113043923,
"message":{"message_id":12,"from":{"id":2212531,"first_name":"Kurnia","last_name":"Adhiwibowo","username":"camagenta"},"chat":{"id":2212531,"first_name":"Kurnia","last_name":"Adhiwibowo","username":"camagenta"},"date":1442067302,"text":"hi"}},{"update_id":113043924,
"message":{"message_id":13,"from":{"id":2212531,"first_name":"Kurnia","last_name":"Adhiwibowo","username":"camagenta"},"chat":{"id":2212531,"first_name":"Kurnia","last_name":"Adhiwibowo","username":"camagenta"},"date":1442067304,"text":"hi"}}]}
from core.
Hi @camagenta, you have my same error, i have opened this issue (#31) but i am still without an answer!
from core.
yes @weiddolo. But I'm not using webhook methods. I'm using the getUpdate methods.
Dunno, maybe the cause is same
from core.
Have you enabled the db?
from core.
Can you perform the procedure described here (the phpunit one)
Did you define PHPUNIT_TESTSUITE somewhere?
from core.
@MBoretto I have added the MySQL credentials, i've opened getUpdatesCLI.php and i have got this message:
2015-09-16 16:14:32 - Fail fetch updates
from core.
@MBoretto I receive this error because I had previously set webhook. Now I reset the bot configuration and the bot responds when I update the page getUpdatesCLI.php.
Now work. But i how can I do a automatically replies without me surf on Page getUpdatesCLI.php
from core.
before i use webhook, i used getUpdatesCLI.php.
To automatically replies without me surf on Page getUpdatesCLI.php, i used deamon:-
create a daemon configuration script under /etc/init ( NOT /etc/init.d ):-
nano /etc/init/mybot.conf
code sample:-
description "MyBot Daemon"
author "larknart"start on startup
stop on shutdown
respawnexec /usr/share/getUpdateCLI.php
alter getUpdateCLI.php:-
below code:
#while true; do ./getUpdatesCLI.php; done
add:-
$seconds = 5;
$micro = $seconds * 1000000;
at end of code below:
}
add:-
usleep($micro);
create symbolic link to /usr/share/
ln -s /var/www/html/bot/getUpdateCLI.php /usr/share
after finish all those steps...now you can use " stop mybot | start mybot | status mybot " in terminal then you'll automatically get update.
from core.
@larknart Why don't you report your solution in the wiki page of your bot? It wuold be great!
from core.
feel free to reopen this
from core.
Related Issues (20)
- MessageOrigin
- forward inline_keyboard with data to command HOT 3
- CallbackqueryCommand -> executeCommand HOT 2
- Bot API 7.0
- Parallel commands HOT 7
- "PHP Deprecated: ... " HOT 3
- Provide further variables to *all* commands.
- Fix PHP Error - Call to a member function getChat() on null
- Migrations fail in MySQL 8.4 HOT 1
- replyToChat() function ignore topic (context of reply)
- Bot API 7.1
- Bot API 7.2 HOT 1
- 2239 HOT 1
- Reactions Broken on Channels - Fix Attached
- My BOT doesn't work - It does nothing HOT 6
- folder problem HOT 2
- Problem with Sending Multiple Files Causing Infinite Loop in Bot Due to Delayed Server Response
- Write me a source that will be a button and when the user clicks on it, a greeting will be sent, and if the user starts the robot, the greeting will be received.
- DB insertion errors
- bug | insert Edit Message Request 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 core.