Giter Club home page Giter Club logo

Comments (10)

camagenta avatar camagenta commented on September 17, 2024

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.

weiddolo avatar weiddolo commented on September 17, 2024

Hi @camagenta, you have my same error, i have opened this issue (#31) but i am still without an answer!

from core.

camagenta avatar camagenta commented on September 17, 2024

yes @weiddolo. But I'm not using webhook methods. I'm using the getUpdate methods.

Dunno, maybe the cause is same

from core.

MBoretto avatar MBoretto commented on September 17, 2024

Have you enabled the db?

from core.

MBoretto avatar MBoretto commented on September 17, 2024

Can you perform the procedure described here (the phpunit one)
Did you define PHPUNIT_TESTSUITE somewhere?

from core.

weiddolo avatar weiddolo commented on September 17, 2024

@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.

weiddolo avatar weiddolo commented on September 17, 2024

@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.

larknart avatar larknart commented on September 17, 2024

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
respawn

exec /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.

MBoretto avatar MBoretto commented on September 17, 2024

@larknart Why don't you report your solution in the wiki page of your bot? It wuold be great!

from core.

MBoretto avatar MBoretto commented on September 17, 2024

feel free to reopen this

from core.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.