copied to smsbot.py