joaoricardo000 / whatsapp-bot-seed

A small python framework to create a whatsapp bot, with regex-callback message routing.
727 stars 245 forks source link

how can i send multiple messages while using time.sleep within one def? #42

Closed x23piracy closed 8 years ago

x23piracy commented 8 years ago

Hi,

how can i send multiple messages within a def?

return Text....(
time.sleep(xx)
return Text....(

does not work only the first return will be send.

Regards X23

joaoricardo000 commented 8 years ago

Hi, to do this, use the interface_layer.

Ex:

self.interface_layer.toLower(TextMessageProtocolEntity("Message...", to=message.getFrom()))

no need to return anything then.

x23piracy commented 8 years ago

Hi,

works, thank you.

Regards X23

rahulroshan96 commented 8 years ago

@x23piracy @joaoricardo000 How you have implemented multiple message? Can you show me the code ?

ghost commented 8 years ago

@rahulroshan96 self.interface_layer.toLower(TextMessageProtocolEntity("Message...", to=message.getFrom()))

rahulroshan96 commented 8 years ago

@montemarcaldera what about the callback function? It give error that interface is not defined and callback function give error? Can you show me the code ?

ghost commented 8 years ago

@rahulroshan96 Take a look to views/super_views.py