Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A Userbot Undefined offset: 0 Error in Utils.php on line 43 #8

Open
soulhd opened this issue Jul 18, 2021 · 9 comments
Open

A Userbot Undefined offset: 0 Error in Utils.php on line 43 #8

soulhd opened this issue Jul 18, 2021 · 9 comments

Comments

@soulhd
Copy link

soulhd commented Jul 18, 2021

I'm using a Userbot (modified it a little bit) with latest version of NovaGram and getting this error message:

[Sun Jul 18 08:08:43.555377 2021] [php7:notice] [pid 64165] [client 185.242.180.125:35294] PHP Notice:  Undefined offset: 0 in /var/www/robot/vendor/skrtdev/novagram/src/NovaGram/Utils.php on line 43
[Sun Jul 18 08:08:48.379605 2021] [php7:notice] [pid 64165] [client 185.242.180.125:35294] [2021-07-18T08:08:48.379454+07:00] NovaGram.CRITICAL: An Exception has been thrown inside internal error handling: skrtdev\\Telegram\\BadRequestException. Full exception has been printed to stdout. [] []
[Sun Jul 18 08:11:18.587280 2021] [php7:notice] [pid 63104] [client 185.242.180.125:36244] PHP Notice:  Undefined offset: 0 in /var/www/robot/vendor/skrtdev/novagram/src/NovaGram/Utils.php on line 43
[Sun Jul 18 08:11:18.779592 2021] [php7:notice] [pid 63104] [client 185.242.180.125:36244] PHP Notice:  Undefined offset: 0 in /var/www/robot/vendor/skrtdev/novagram/src/NovaGram/Utils.php on line 43
[Sun Jul 18 08:12:24.947972 2021] [php7:notice] [pid 63101] [client 185.242.180.125:36594] PHP Notice:  Undefined offset: 0 in /var/www/robot/vendor/skrtdev/novagram/src/NovaGram/Utils.php on line 43
[Sun Jul 18 08:12:25.145462 2021] [php7:notice] [pid 63101] [client 185.242.180.125:36594] PHP Notice:  Undefined offset: 0 in /var/www/robot/vendor/skrtdev/novagram/src/NovaGram/Utils.php on line 43
[Sun Jul 18 08:15:02.117104 2021] [php7:notice] [pid 63075] [client 185.242.180.125:37408] PHP Notice:  Undefined offset: 0 in /var/www/robot/vendor/skrtdev/novagram/src/NovaGram/Utils.php on line 43
[Sun Jul 18 08:15:02.309639 2021] [php7:notice] [pid 63075] [client 185.242.180.125:37408] PHP Notice:  Undefined offset: 0 in /var/www/robot/vendor/skrtdev/novagram/src/NovaGram/Utils.php on line 43
[Sun Jul 18 08:15:06.676806 2021] [php7:notice] [pid 63075] [client 185.242.180.125:37408] PHP Notice:  Undefined offset: 0 in /var/www/robot/vendor/skrtdev/novagram/src/NovaGram/Utils.php on line 43
[Sun Jul 18 08:15:10.633559 2021] [php7:notice] [pid 63075] [client 185.242.180.125:37408] PHP Notice:  Undefined offset: 0 in /var/www/robot/vendor/skrtdev/novagram/src/NovaGram/Utils.php on line 43
[Sun Jul 18 08:22:00.243235 2021] [php7:notice] [pid 64165] [client 185.242.180.125:39584] PHP Notice:  Undefined offset: 0 in /var/www/robot/vendor/skrtdev/novagram/src/NovaGram/Utils.php on line 43
[Sun Jul 18 08:22:00.435600 2021] [php7:notice] [pid 64165] [client 185.242.180.125:39584] PHP Notice:  Undefined offset: 0 in /var/www/robot/vendor/skrtdev/novagram/src/NovaGram/Utils.php on line 43
[Sun Jul 18 09:17:15.537236 2021] [php7:notice] [pid 64166] [client 185.242.180.125:56718] PHP Notice:  Undefined offset: 0 in /var/www/robot/vendor/skrtdev/novagram/src/NovaGram/Utils.php on line 43
[Sun Jul 18 09:17:15.731295 2021] [php7:notice] [pid 64166] [client 185.242.180.125:56718] PHP Notice:  Undefined offset: 0 in /var/www/robot/vendor/skrtdev/novagram/src/NovaGram/Utils.php on line 43
[Sun Jul 18 09:35:41.126093 2021] [php7:notice] [pid 63073] [client 125.164.11.83:57684] PHP Notice:  Undefined offset: 0 in /var/www/robot/vendor/skrtdev/novagram/src/NovaGram/Utils.php on line 43

What could have gone wrong? Is it because the token ID is my phone number (because I'm using Userbot)?

@soulhd soulhd changed the title A Userbot A Userbot Undefined offset: 0 Error in Utils.php on line 43 Jul 18, 2021
@skrtdev
Copy link
Owner

skrtdev commented Jul 18, 2021

What version of tdlight bot api are you using? If you’re using a public instance, which one are you using?

@soulhd
Copy link
Author

soulhd commented Jul 18, 2021

What version of tdlight bot api are you using? If you’re using a public instance, which one are you using?

I'm using the server offered here https://tdlight-team.github.io/tdlight-telegram-bot-api

Computed URL:https://botapi.giuseppem99.xyz/bot123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11

I replaced the token with the content of .token file generated by NovaGram in my script directory. Set the webhook by https://botapi.giuseppem99.xyz/user123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11/setWebhook?url=https://xxxxx/mybot.php and successfully set, getWebhookInfo also giving me proper result:

{
"ok": true,
"result": {
"url": "https://xxxxx/mybot.php",
"has_custom_certificate": false,
"pending_update_count": 0,
"max_connections": 100,
"ip_address": "xxx.xxx.x.xx",
"allowed_updates": [
"message"
]
}
}

@skrtdev
Copy link
Owner

skrtdev commented Jul 18, 2021

@soulhd Well ok, I’ll fix it in v2.0, user tokens are different. However, when you log in using novagram, webhook is automatically set, so you don’t have to manually set it. Does bot work even with this error?

@soulhd
Copy link
Author

soulhd commented Jul 18, 2021

@soulhd Well ok, I’ll fix it in v2.0, user tokens are different. However, when you log in using novagram, webhook is automatically set, so you don’t have to manually set it.

I see. OK, I'll watch for an update and report it to you.

Does bot work even with this error?

It's working even errors reported. But I'm getting double replies when communicating with the bot in group or private message. I don't know whether or not it is affected by the errors or by something else.

@skrtdev
Copy link
Owner

skrtdev commented Jul 18, 2021

@soulhd Probably you set webhook two times, check if there are two instances of bot api logged in your account. Telegram Settings -> devices

@soulhd
Copy link
Author

soulhd commented Jul 18, 2021

@soulhd Probably you set webhook two times, check if there are two instances of bot api logged in your account. Telegram Settings -> devices

Wonderful, you're my hero!! Been looking for the problem all this day, google didn't even mention about this when I search for "bot double reply" :)

@skrtdev
Copy link
Owner

skrtdev commented Jul 18, 2021

@soulhd Nothing. I’ll close issue when I’ll fix it in v2

@soulhd
Copy link
Author

soulhd commented Jul 18, 2021

got it. is there any telegram group/channel of yours which I can participate?

@skrtdev
Copy link
Owner

skrtdev commented Jul 18, 2021

@soulhd Yes, it’s mentioned in readme

skrtdev added a commit that referenced this issue Sep 18, 2021
@github-staff github-staff deleted a comment from mzm-alanfong Apr 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants