Skip to content

Commit cf14ecd

Browse files
committed
Already sent tweet bugfix
1 parent 99ac169 commit cf14ecd

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/watcher.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,11 @@ def is_this_tweet_sent(self, text: str) -> bool:
5757

5858
def post_left_units_tweet(self, time: int, unit: str, units: str):
5959
tweet = self.create_text(time, units if time > 1 else unit)
60-
self.api_helper.post_tweet(tweet)
61-
log(f"-> Tweet Sent: \"{tweet}\"")
60+
if not self.is_this_tweet_sent(tweet):
61+
self.api_helper.post_tweet(tweet)
62+
log(f"-> Tweet Sent: \"{tweet}\"")
63+
else:
64+
log(f"-> Tweet Already Exists: \"{tweet}\"")
6265

6366
def post_watch_ended_tweet(self):
6467
self.api_helper.post_tweet(WATCH_END_TEXT)

0 commit comments

Comments
 (0)