-
Notifications
You must be signed in to change notification settings - Fork 124
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 send_html_topic_message and send_normal_topic_message... #198
base: master
Are you sure you want to change the base?
Added send_html_topic_message and send_normal_topic_message... #198
Conversation
…h example commands in mycommands.sh, feel free to adjust and change it, repo owners! I just had a billion commands setup on my server and couldn't just easily write it all in some other bot framework so I had to figure it out. Hope this helps someone!
looks good on first impression, but I'll add your Changes manually to not cripple mycommands unnecessarily thanks alot |
Hey no problem thanks for getting to it so fast I'm happy about that !
…On Mon, Mar 20, 2023, 5:24 AM Kay Marquardt ***@***.***> wrote:
looks good on first impression, but I'll add your Changes manually to not
cripple mycommands unnecessarily
thanks alot
—
Reply to this email directly, view it on GitHub
<#198 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ARQCVODYCGW74DQIRSIKR2DW5AO5PANCNFSM6AAAAAAWAX3XDA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Also I totally agree keep it uniform with the rest of the code and do your thing with the docs and whatnot I just wanted it to stick out as if the git diff wouldn't have been obvious lol , hard to ditch those shell scripting habits ! Where I always write stuff like: I just now noticed that the description for this bot says it uses the magic of sed, can confirm: sed is Magic. Used to look like it was made up on the spot as some elaborate inside joke/prank against me and well now I love it, makes managing the thousands of folders and files on my server so much more convenient and less messy. I had learned tg python bot this past week but I still prefer bash bot, it's just more straight forward and easily digestible. So I'm super glad to help and awesome job on the repo! It's essential ! |
Hey @gnadelwartz i had a quick question for you, when you implement it, when the bot is in a thread when summoned itr should be able to obtain the thread ID right? I was going to work on that right now but its probably a lot easier than I am imagining it to be. So that we can send messages in threadsa where it is called etc. |
I was super wrong about that btw, its a lot more difficult to understand than i thought it would be, im pretty sure its going down in bashbot.sh where it uses chat_id, since threads are a neighboring parameter of chat_id but man im totally lost with the way you mad lads built this, i can tell its systematically brilliant but thteres so many caveats, when you have to disable that many shell check warnings hoo boy youre in for a time. |
Im not shure what you are refering to by thread? do you mean
|
I mean the topics system its calling them "threads", in the json received in reply context in the API its message_thread_id:, I want to be able to retrieve this so it can reply to users. |
Its where you also get the user that is sending the chat, and the message ID, so we just need to pull that from the same spot so it can be used,I'm just having a hard time finding the code where you do so |
OK, understood. As I've not seen real data sent by telegram for subthreads I can provide a general explanation only, it should work like with USER[ID] insert something like this in process _message() process_message() {
[....]
THREAD[ID]="${UPD["result,${num},message,thread,id"]}"
# UPD=JSON Array, num=message count (mostly 0), remaining string is the json field to get information from
# e.g. ${UPD["result,0,message,thread,id"]} -> "thread,id" is a guess only, real string depends on JSON sent by telegram
Note: add THREAD and any other new global array to declaration in line 360 in bashbot.sh: bashbot.sh
....
declare -Ax UPD ... THREAD
.... |
Literally just found this comment after already figuring this all out and doing it myself -_- but I did have it under pre-process message rather than process message, so I added it there too, and it looks like this, btw, when looking at the proper json data:
|
any reason this is still unmerged? AFAIK it works well? This is pretty much all that the bash bot needs to stay current, IMO, the only feature I was sorely missing, at least. |
Actually one thing it should really have - but it's hard for me to understand the code in this repo because bash is fuckin complicated, but it should have the ability to store the message thread from a reply or some such and then use it. |
Along with some example commands in mycommands.sh, feel free to adjust and change it, repo owners! I just had a billion commands setup on my server and couldn't just easily write it all in some other bot framework so I had to figure it out. Hope this helps someone!
I was bummed when I didn't see this in the PRs so I decided to take matters into my own hands, at least I hope I did, they work for me but I'm sure there's something I missed as I didn't take the time to fully parse all the code in normal_message. Hope this helps someone!
P.S. - IDK why it is saying I removed those 262 lines unless the new stuff just caused alignment issues. But in case I did accidentally wipe something, that was not my intention, intention is just to ADD the new code for topics and remove 0 lines. Thanks.