K
K
Kirill Bely2020-10-12 19:07:07
PHP
Kirill Bely, 2020-10-12 19:07:07

Regardless of my message, the bot would write the template first. How?

Let's say this is some kind of bot that communicates with you only in private messages and using what method can you make it so that, regardless of the user's message, the bot first displays a template like "Alexander handsome really" and only after this template the bot would start reading commands and answer hello, etc.

Probably a lot of water, I'll tell you with an example:

(User): Hello bot
(Bot): Alexander handsome really
(User): Hello bot
(Bot): Hello, how are you?

For more details please, if not difficult. I'm just a teapot. Thanks for understanding.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
DevMan, 2016-02-18
@taleh_b

ideone.com/vZu3nF
ideone.com/f1k5BQ

O
Oleg, 2020-10-12
@chupchik_chupachupsa

As an option to get started.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question