-
Notifications
You must be signed in to change notification settings - Fork 314
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
Added functions for chatDescription #210
base: master
Are you sure you want to change the base?
Conversation
cb-lock
commented
Nov 3, 2020
- Added methods for setting/getting the chat description
- Enlarged the maxMessageLength to support common message lengths
- Added methods for setting/getting the chat description - Enlarged the maxMessageLength to support common message lengths
Hello and thank you creating this wonderful library! I would like to contribute some functions that I found missing for my use case. Please let me know if there are any issues with adopting these changes. I am happy to help and contribute! |
src/UniversalTelegramBot.h
Outdated
@@ -125,7 +129,7 @@ class UniversalTelegramBot { | |||
unsigned int waitForResponse = 1500; | |||
int _lastError; | |||
int last_sent_message_id = 0; | |||
int maxMessageLength = 1500; | |||
int maxMessageLength = 10500; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm concerned about the impact this will have on memory, does it need to be so large?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, this is certainly a point of discussion and this is probably application dependent. I created a chat bot using the 1500 length setting and found that it did not work at all because messages were incomplete rendering the reply useless. In effect he bot got stuck doing nothing so that I thought my code was bad. Debugging into it gave me the hint to modify the message size.
I suggest making this an obvious parameter for the library by moving it to private and adding at least a set method to make clear it is meant for application management. In addition, it could become a parameter of the contructor if you don't mind.
If you want to go ahead with this change, I can offer to make the necessary modification.
Thanks for the PR. As mentioned in the above comment, I'm concerned about how large the message size is and what impact that will have. Also new features like this will require some examples to demo how to use it |
Ok, I will add an example. |