def direct_msg(self, user, msg):

        self.connect()

        if self.twitter_api != None:
            # Twitter doesn't like the same msg sent over and over, so add a timestamp
            msg = strftime("%Y-%m-%d %H:%M:%S: ") + msg

            self.logger.info("Sending twitter DM to %s: %s", user, msg)
            try:
                self.twitter_api.send_direct_message(user=user, text=truncate(msg, 140))
            except tweepy.error.TweepError as ex:
                self.logger.error("Unable to send Tweet: %s", ex)
Send direct message to specified Twitter user.
dataset/ETHPy150Open rllynch/pi_garage_alert/bin/pi_garage_alert.py/Twitter.direct_msg