communicating with telegram bot

Discussions and Tech Support related to website data extraction, screen scraping and data mining using iMacros.
Forum rules
Before asking a question or reporting an issue:
1. Please review the list of FAQ's.
2. Use the search box (at the top of each forum page) to see if a similar problem or question has already been addressed.
3. Try searching the iMacros Wiki - it contains the complete iMacros reference as well as plenty of samples and tutorials.
4. We can respond much faster to your posts if you include the following information: CLICK HERE FOR IMPORTANT INFORMATION TO INCLUDE IN YOUR POST
Post Reply
Mr Designer
Posts: 4
Joined: Thu Jun 25, 2015 2:03 pm

communicating with telegram bot

Post by Mr Designer » Tue May 25, 2021 11:12 pm

hello
I am trying to make basic macros to communicate with a telegram bot
I success with everything but,
bot time to time communicate with "are you sure" and I should respond with "yes or no /or/ are you a robot or not" otherwise the process will fail
my point is, is it possible for imacros to communicate with the bot and check for a specific message and then decide to respond with a specific message?

like:

imacros writes: hello (and waits for a response): if the response back was the word "hello", then write.. example "How are you"...
if what wroten is not the word "hello" .. "then respond with some word else or wait 25 seconds and try again" etc..)

let me know if my point is clear or I should send images to help
Thanks

Code: Select all

imacros app- No browser extension
OS: Windows 10 - Imacros 2021.0.0.0 trial
Last edited by Mr Designer on Wed May 26, 2021 12:12 am, edited 3 times in total.
chivracq
Posts: 9749
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: is this possible? need help

Post by chivracq » Tue May 25, 2021 11:33 pm

Mr Designer wrote:
Tue May 25, 2021 11:12 pm
hello
I am trying to make basic macros to communicate with a telegram bot
I success with everything but,
bot time to time communicate with "are you sure" and I should respond with "yes or no /or/ are you a robot or not" otherwise the process will fail
my point is, is it possible for imacros to communicate with the bot and check for a specific message and then decide to respond with a specific message?

like:

imacros writes: hello (and waits for a response): if the response back was the word "hello", then write.. example "How are you"...
if what wroten is not the word "hello" .. "then respond with some word else or wait 25 seconds and try again" etc..)

-Using

Code: Select all

imacros software last version on windows 10
let me know if my point is clear or I should send images to help
Thanks

You may want to (re-)read the Forum Rules, they've changed a bit since 2015 that you joined the Forum, => your Thread Title is not compliant with the Forum Rules... :!:

If you post Screenshots, make sure to upload them "directly" to the Forum and not to use any external Pix Hosting Site... (also mentioned/explained in the Forum Rules...).

+ FCIM...! :mrgreen: (Read my Sig..., and also explained in the Forum Rules...)
=> No idea which Browser you are using with "iMacros Software", and "last version" doesn't mean much on a Tech Forum, simply mention the (exact) Version...
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE').
- I don't even read the Qt if that (required) Info is not mentioned...!
- Script & URL help a lot for more "educated" Help...
Mr Designer
Posts: 4
Joined: Thu Jun 25, 2015 2:03 pm

Re: communicating with telegram bot

Post by Mr Designer » Wed May 26, 2021 12:03 am

thanks for clarifying chivracq
sorry I too long didn't visit the community :green: I updated the title
you still here helping lad cheers!

Using:
imacros app- No browser extension
OS: Windows 10 - Imacros 2021.0.0.0
chivracq
Posts: 9749
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: communicating with telegram bot

Post by chivracq » Wed May 26, 2021 12:58 am

Mr Designer wrote:
Wed May 26, 2021 12:03 am
thanks for clarifying chivracq
sorry I too long didn't visit the community :green: I updated the title
you still here helping lad cheers!

Using:
imacros app- No browser extension
OS: Windows 10 - Imacros 2021.0.0.0

Oh, yep indeed, the "Quality" is much better now... :D

And hum, OK:

Code: Select all

OS: Windows 10 - Imacros 2021.0.0.0 trial
... You are indeed using the "last Version", iMB v2021.0 just got released last week, you are one of the first Users to use it...

Then OK, concerning the Functionality that you want, well, this is pretty "Advanced", but I guess you already have an "Idea" how to implement it, as you opened your Thread in the "correct" Sub-Forum (or I would have said stg about that, ah-ah...! :wink: ), then..., yep, you'll need to extract what Msg's get posted (and by "whom") in that 'TG' Chat/Group and depending on specific Keywords or Strings, "spit out" your Reply/Reaction, using 'EVAL()' in pure '.iim', or your "favorite" Programming Language if you are using the 'Scripting Interface'...

But you'll need to "build" quite some "Intelligence" in your Script, it's not very "easy", as your Script (or some part of it) needs to be looping constantly in a fairly high Frequency to check for new Msg's, conflicting a bit when you have to wait for 20 or 25 Sec, but the 'WAIT' Statements can be made Conditional and Incremental, and keep track of several Participants in the Chat, and adapt to the "Speed", and post "relevant" Msg's of course... This is quite an "ambitious" Project, ah-ah...! 8)

But, hum..., I won't "really" help any more "precisely", I don't help for Social Media and Comments (on Forums also) or Chatbots..., or you will very quickly end up with only Bots talking to each other, ah-ah...! :twisted:
(And you didn't post any Script either about what you've managed to implement already... :| )

You have a few Chatrooms on 'SOF' (Stackoverflow Forum) where (Test) Chatbots are allowed, maybe an Idea for you if you want to do some Testing, but it's "pretty messy"..., though sometimes superbly hilarious, ah-ah...! :P
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE').
- I don't even read the Qt if that (required) Info is not mentioned...!
- Script & URL help a lot for more "educated" Help...
Mr Designer
Posts: 4
Joined: Thu Jun 25, 2015 2:03 pm

Re: communicating with telegram bot

Post by Mr Designer » Wed May 26, 2021 1:33 am

thanks for the help chivracq
My idea is quite basic for what I have reached until now just record and click.

I just want imacros to read or just check the text if has a word or not.. and then take action whatever it is refresh page or respond, etc..
I think it's a quite sample

let's say:
1- Click in the box paste text "hello"
2- wait 10sc
3- - check the text if the text has the word ...
4- if it has then "refresh page" (I think this one is famous)
and nothing like check and go check back real-time my intention is not to make a smart bot that responds to a bot,
but only sample macros that take action after been told to read text
Post Reply