Answer the question
In order to leave comments, you need to log in
To replenish the list of the bot just by sending him messages?
I have a bot that randomly sends a word / picture from a list
, so, is it possible to make it so
that when sending it to the bot in a personal message, for example:
"+ list and then some word."
in the script itself (or a separate file in which the list of all words will lie) was added the word that is in the message? I just don't understand how to implement it.
Let's read what the user wrote, take the text of this message and write it down, but:
1) - how do I write down exactly what is after the "+list" command (ie, through a space)? I can record his entire message, but I don’t really understand how to do it piece by piece (the most crutch that I came up with is to implement a separate request, and separately save, in other words, through two messages)
2) - what should I do if I need to add a picture?
bot sends pictures via
message=('123',
attachment = ('photo-000000000_000000000')
Answer the question
In order to leave comments, you need to log in
1) You need to parse the string
2) Get a link to the photo by its id, download it. Documentation for VK api to help
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question