gd-utils
gd-utils copied to clipboard
Support multiple commands in a single telegram message.
Support multiple commands in a single telegram message, one command per line.
Backstory: getting tried of organizing bookmarks with spamming /bm
(and the mixed chat layout for future reference).
😄Nice tought, however this might cause some problem...
For example:
https://github.com/iwestlin/gd-utils/blob/55eaafbd88cd6527db230ac7542d8f8ed8bc23a3/src/router.js#L106
Should change to
if (text.startsWith('/help')) {
send_help(chat_id)
continue
}
And so do other lines with return
...
Sometimes user might forward multiple lines message from other tg channels, god know what's gonna happen...It's unpredictable.
In my option, multiple line commands seems cool, but it's against the rule of keep things simple(aka do one thing at a time...)
If you want edit multiple bookmark record at one time, you could use bookmark.js
, run ./bookmark.js -h
for help.
Be notice, it will not overwrite alias
, see https://github.com/iwestlin/gd-utils/issues/120#issuecomment-661673803 for more info.
True, I wasn't aware of the return messages, which can be tricky...
And yeah, user inputs are always unpredictable, and we have no control, especially with the folder-id parsing feature, which doesn't have the /
format.
Multi-line execution is appealing to me because I can maintain bookmarks in a single message, and every time any bookmark gets updated, I can modify that message and forward it to this bot, without the need to copy those line by line. Other than that, I haven't realized a useful scenario (maybe copying a list of shared folders, but it's much better with a shell script), to be honest.
bookmark.js
is one nice solution (other than alias feature), but access to telegram is much easier than SSH, especially on mobile.
With all that been said, thank you for this awesome project! It's already making people's life much easier:)