This commit is contained in:
DaoAdvocate
2023-04-15 23:24:05 +02:00
committed by Pi
parent cfba3d0a60
commit c30a621195
2 changed files with 12 additions and 3 deletions

View File

@@ -132,3 +132,13 @@ USE_BRIAN_TTS=False
ELEVENLABS_API_KEY=your-elevenlabs-api-key
ELEVENLABS_VOICE_1_ID=your-voice-id-1
ELEVENLABS_VOICE_2_ID=your-voice-id-2
################################################################################
### TWITTER API
################################################################################
TW_CONSUMER_KEY=
TW_CONSUMER_SECRET=
TW_ACCESS_TOKEN=
TW_ACCESS_TOKEN_SECRET=
TW_SEND_TWEETS=True

View File

@@ -5,7 +5,6 @@ from dotenv import load_dotenv
load_dotenv()
def send_tweet(tweet_text):
consumer_key = os.environ.get("TW_CONSUMER_KEY")
consumer_secret= os.environ.get("TW_CONSUMER_SECRET")
access_token= os.environ.get("TW_ACCESS_TOKEN")
@@ -21,5 +20,5 @@ def send_tweet(tweet_text):
try:
api.update_status(tweet_text)
print("Tweet sent successfully!")
except tweepy.TweepError as e:
print("Error sending tweet: {}".format(e.reason))
except tweepy.TweepyException as e:
print("Error sending tweet: {}".format(e.reason))