Comments (6)
@arcturial strange...my bot is running with 0.1.1 for a while and I never seen this error...
By looking at the code the exception is thrown at 143 and 150, where we split messages in chunks recursively...can you try to set HUBOT_LOG_LEVEL=debug
for a few days?
from hubot-telegram.
I shall do that
from hubot-telegram.
i have the same problems of @arcturial
i found that after removing
res.envelope.telegram = {
parse_mode: 'HTML',
reply_markup: {
keyboard: [['option1', 'option2']]
}
};
my bot works again.
Before the error was:
[Tue Jul 26 2016 01:01:35 GMT+0200 (CEST)] DEBUG Message 'bot command' matched regex //command/i/; listener.options = { id: null }
[Tue Jul 26 2016 01:01:35 GMT+0200 (CEST)] DEBUG Executing listener callback for Message 'bot command'
[Tue Jul 26 2016 01:01:36 GMT+0200 (CEST)] DEBUG Message length: 90
[Tue Jul 26 2016 01:01:36 GMT+0200 (CEST)] DEBUG Message parts: 1
[Tue Jul 26 2016 01:01:36 GMT+0200 (CEST)] ERROR RangeError: Maximum call stack size exceeded
at Object.stringify (native)
at TelegramBot.request (/bot/node_modules/telegrambot/lib/telegrambot.js:75:53)
at TelegramBot.invoke (/bot/node_modules/telegrambot/lib/telegrambot.js:95:32)
at send (/bot/node_modules/hubot-telegram/src/telegram.coffee:143:9, <js>:165:28)
at Telegram.apiSend (/bot/node_modules/hubot-telegram/src/telegram.coffee:150:5, <js>:171:14)
at Telegram.send (/bot/node_modules/hubot-telegram/src/telegram.coffee:160:5, <js>:189:19)
at runAdapterSend (/bot/node_modules/hubot/src/response.coffee:82:34, <js>:87:50)
at allDone (/bot/node_modules/hubot/src/middleware.coffee:44:37, <js>:34:16)
at /bot/node_modules/async/lib/async.js:274:13
at Object.async.eachSeries (/bot/node_modules/async/lib/async.js:142:20)
at Object.async.reduce (/bot/node_modules/async/lib/async.js:268:15)
at /bot/node_modules/hubot/src/middleware.coffee:49:7, <js>:37:22
at _combinedTickCallback (internal/process/next_tick.js:67:7)
at process._tickCallback (internal/process/next_tick.js:98:9)
from hubot-telegram.
It's happening when we put any extra params to res.envelope.telegram
. Starting at line 72 (telegram.coffee), there is this method toString(object)
that is called only when there is any extra.
toString = (object) ->
result = {}
try
for key in Object.keys(object)
result[key] = toString(object[key])
catch e
result = "" + object;
return result
if extra?
extra = toString(extra)
...
Not sure if it should work the same as JSON.stringify(obj)
, but actually it's returning a huge recursive object. The telegrambot already parses this extra to string using JSON.stringify(obj)
(where the error occurs), so I think this code is not necessary anymore. I can submit a PR to remove this. Already tested here, and worked.
from hubot-telegram.
Oh ok, perfect if you send a PR I will test it and merge it right away...
Am Freitag, 29. Juli 2016 schrieb Manoel de A.L. Amaro :
It's happening when we put any extra params to res.envelope.telegram.
Starting at line 72
https://github.com/lukefx/hubot-telegram/blob/master/src/telegram.coffee#L72
(telegram.coffee), there is this method toString(object) that is called
only when there is any extra.toString = (object) -> result = {} try for key in Object.keys(object) result[key] = toString(object[key]) catch e result = "" + object; return result if extra? extra = toString(extra)
...
Not sure if it should work the same as JSON.stringify(obj), but actually
it's returning a huge recursive object. The telegrambot already parses this
extra to string using JSON.stringify(obj) (where the error occurs), so I
think this code is not necessary anymore. I can submit a PR to remove this.
Already tested here, and worked.—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#52 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AABwzsA04dQ110vSfcG1zW7F3dxD7b3rks5qaTMCgaJpZM4JQoJF
.
from hubot-telegram.
Nice catch, thanks
from hubot-telegram.
Related Issues (20)
- Receiving double messages when polling
- ERROR Error: HTTP status 504 returned. HOT 2
- ERROR TypeError: Cannot read property 'message_id' of undefined HOT 11
- bot no receiving messages from supergroup HOT 5
- API fields have been renamed HOT 2
- Remove bot name when using /command@bot_name HOT 1
- Slow connectivity causes duplicate messages HOT 2
- Newbie request
- error on help command (and workaround) HOT 11
- Expose reply_to_message from message
- Add `hubot-adapter` topic HOT 1
- / commands in supergroups not working HOT 2
- Proxy issues HOT 1
- CoffeeScript 2.x support HOT 2
- Read the response text of a message HOT 1
- Group Chat Slash Command With Mention HOT 1
- Interval Issue HOT 1
- Markdown with Bad Entities
- Error seeking help 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 hubot-telegram.