Problems with "/lastseen" command
Hello,
I have been using this python library to get the last seen hour of a contact. It had worked fine since November but recently it has been some errors.
When I use the /lastseen command I get a response only the first time and then It doesnt work for 5 minutes (more or less).
Has something changed? Can anyone help me?
Thank you (and sorry for my awful English level)
Nice to see spanish people ;) So, it prints only once the 'last seen' time, right? Post the error/debug you had, and ill try to make a fix
Hello, thanks for your answer.
It is not an error, It just prints the connection hour the first time I execute my script. If I stop it and then I play it again, Yowsup gets frozen (coz it doesnt print anything).
I have modified the "CmdClient.py" to get automatically the /lastseen and It worked so well but nowadays I'm having this trouble. That's why I'm asking for help if something has changed because it's strange.
--> #290
alegr3, Ya solucionaste tu problema? pasa un mail asi te escribo
De momento, sin haber cambiado nada, vuelve a funcionar. Eso sí, las horas de conexión son muy imprecisas...
Si quieres puedes contactarme en: [email protected]
валенок ушанка wazapp медведь балалайка yowsup водка зима whatsapp сибирь колыма lastseen
I'm sorry but I can't understand you @CODeRUS. Where are you from?
sigh ...
#!/usr/bin/python
import argparse, sys, os, csv
from Yowsup.Common.utilities import Utilities
from Yowsup.Common.debugger import Debugger
from Yowsup.Common.constants import Constants
from Yowsup.Contacts.contacts import WAContactsSyncRequest
from Yowsup.connectionmanager import YowsupConnectionManager
import threading,time, base64
########## DO NOT COMMIT THIS FILE WITH YOUR CREDENTIALS ###########
#.....................WhatsApp Account Config.......................
nickname = ""
username = ""
password = ""
id = ""
# Degug is False by default if you add -d you will set it to True
target = ["34123456789", "34987654321"]
#....................................................................
password = base64.b64decode(bytes(password.encode('utf-8')))
jid = range(len(target))
for x in range(0, len(target)):
jid[x] = "%[email protected]" % target[x]
Debugger.enabled = True if '-d' in sys.argv else False
def login(username, password):
print "[] Logging in as %s (%s)\n" % (nickname, username)
methodsInterface.call("auth_login", (username, password))
def send(jid, msg):
methodsInterface.call("message_send", (jid, msg))
def onAuthSuccess(username):
print("Authed!!\n\n")
methodsInterface.call("ready")
methodsInterface.call("presence_sendAvailableForChat", (nickname,))
methodsInterface.call("presence_sendAvailable")
for x in range(0, len(target)):
methodsInterface.call("presence_request", (jid[x],))
t = 5
i = 0
while i < t:
time.sleep(0.5)
i=i+1
def onAuthFailed(username, err):
print("Auth Failed!")
def onPresenceUpdated(jid, lastSeen):
print time.strftime("Ultima vez en linea hace: %H horas %M minutos", time.gmtime(lastSeen))
########################### BIND EVENTS #############################
connectionManager = YowsupConnectionManager()
signalsInterface = connectionManager.getSignalsInterface()
methodsInterface = connectionManager.getMethodsInterface()
connectionManager.setAutoPong(True)
signalsInterface.registerListener("auth_success", onAuthSuccess)
signalsInterface.registerListener("auth_fail", onAuthFailed)
signalsInterface.registerListener("presence_updated", onPresenceUpdated)
#####################################################################
login(username, password)