예제 #1
0
def send_direct_message(to_userid):
    auth.set_access_token(access_token, access_token_secret)
    api = tweepy.API(auth,
                     wait_on_rate_limit=True,
                     wait_on_rate_limit_notify=True)
    first_name = get_username(to_userid).split(' ')[0]
    dm_text = generate_dm_text(first_name)
    api.send_direct_message(to_userid, text=dm_text)
예제 #2
0
def send_direct_message(to_userid):
    auth.set_access_token(access_token, access_token_secret)
    api = tweepy.API(auth)
    #first_name = get_username(to_userid).split(' ')[0]
    #for "FULL NAME"
    first_name = get_username(to_userid)
    dm_text = generate_dm_text(first_name)
    api.send_direct_message(to_userid, text=dm_text)