Python 清除Tweepy中的所有提及

Python 清除Tweepy中的所有提及,python,twitter,tweepy,Python,Twitter,Tweepy,我正在使用tweepy创建一个twitter机器人。我面临的问题是,提及时间线并没有清除旧的提及,而且机器人仍然会向这些用户回复 import tweepy import os import requests from dotenv import load_dotenv auth = tweepy.OAuthHandler(consumer_key, consumer_secret) auth.set_access_token(acess_token, acess_secret) api =

我正在使用tweepy创建一个twitter机器人。我面临的问题是,提及时间线并没有清除旧的提及,而且机器人仍然会向这些用户回复

import tweepy
import os
import requests
from dotenv import load_dotenv


auth = tweepy.OAuthHandler(consumer_key, consumer_secret)
auth.set_access_token(acess_token, acess_secret)
api = tweepy.API(auth)

mentions = api.mentions_timeline(count=20)
for mention in mentions:
    print(mention.user.name)
api.mentions_timeline().clear() //<=I try to clear the mentions here 
导入tweepy
导入操作系统
导入请求
从dotenv导入加载\u dotenv
auth=tweepy.OAuthHandler(使用者密钥,使用者密钥)
授权设置访问令牌(访问令牌,访问密钥)
api=tweepy.api(auth)
提及=api。提及时间线(计数=20)
如有提及:
打印(提及.用户名)
api.提到时间线()清除()//