[BUG] "object Object" when running /chatinfo in DMs #48

Closed
opened 2025-04-26 18:07:15 +00:00 by ihatenodejs · 3 comments
ihatenodejs commented 2025-04-26 18:07:15 +00:00 (Migrated from github.com)

Screenshot

Image

# Screenshot ![Image](https://github.com/user-attachments/assets/5511570c-70d9-4398-a1ca-a478814b1529)
lucmsilva651 commented 2025-04-27 14:07:30 +00:00 (Migrated from github.com)

@GiovaniFZ, since you said before you wanted to contribute more with the bot, feel free to fix this if you have time 😆

@GiovaniFZ, since you said before you wanted to contribute more with the bot, feel free to fix this if you have time 😆
GiovaniFZ commented 2025-04-28 19:08:11 +00:00 (Migrated from github.com)

ok

ok
ihatenodejs commented 2025-04-29 23:18:44 +00:00 (Migrated from github.com)

This is happening due to the text parsing. I think one of the error strings is messed up or something as it affects the other commands too when an error occurs. object Object is the error object (which would contain an error message) which should be injected into the string instead of the entire error object.

However, errors work differently depending on what part of the code it happens in, so something more advanced to catch and handle a variety of error types will be needed. I think TypeScript has been a great step in that process.

This is happening due to the text parsing. I think one of the error strings is messed up or something as it affects the other commands too when an error occurs. `object Object` is the error object (which would contain an error message) which should be injected into the string *instead* of the entire error object. However, errors work differently depending on what part of the code it happens in, so something more advanced to catch and handle a variety of error types will be needed. I think TypeScript has been a great step in that process.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: ABOCN/TelegramBot#48
No description provided.