This is my code. I want to send 100 messages in Viber using Python code, and it gives this error: text_message: TextMessage = TextMessage(text=message, to=recipient) TypeError: TextMessage.init() got an unexpected keyword argument 'to'
i changed 'to' 'to receiver', it still doesn't work
''''''
import time
from **********
from *************************
from *******************************
viber = Api(BotConfiguration(
name='MyBot',
avatar='http://viber.com/avatar.jpg',
auth_token='*******************************'
))
message = "Hello"
recipient = "1234567890"
for i in range(100):
text_message = TextMessage(text=message, to=recipient)
viber.send_messages(text_message)
time.sleep(60)
TextMessage
only takes one argument:text
.The keywordargument
to
belongs to thesend_messages
method.example: