Answer the question
In order to leave comments, you need to log in
Why does the script only work with 1 name?
When adding 1 more name to the name line, the script stops working, why?
text_4 = event.obj['text'].split(' ', maxsplit=1)
if text_4[0] == "Арт" or text_4[0] == "арт" and text_4[1] == arts.name:
id = random.randint(arts.id_1, arts.id_2)
vk.method("messages.send",
{
"chat_id": event.object.peer_id - 2000000000,
"attachment": "photo-" + f'{arts.art}' + f'{id}',
"random_id": random.randint(1, 2147483647)
})
name = "Нами"
if name == "Нами":
id_1 = 103
id_2 = 126
art = "193643776_457239"
Answer the question
In order to leave comments, you need to log in
I suspect that the problem is that when you add, you are trying to compare NOT already:
if text_4[0] == "Арт" or text_4[0] == "арт" and text_4[1] == 'Нами'
if text_4[0] == "Арт" or text_4[0] == "арт" and text_4[1] == ' Нами, Нами2'
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question