Skip to content

Commit 0e4faf8

Browse files
Fixed long tweet errors
1 parent 57f3105 commit 0e4faf8

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

src/cogs/loops/reddit.py

-2
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,6 @@ async def wsb(self, reddit: asyncpraw.Reddit) -> None:
123123

124124
# Add images to the embed
125125
img_url = []
126-
video = False
127126
if not submission.is_self:
128127
url = submission.url
129128
if (
@@ -142,7 +141,6 @@ async def wsb(self, reddit: asyncpraw.Reddit) -> None:
142141

143142
title = "📸🖼️ " + title
144143
elif "v.redd.it" in url:
145-
video = True
146144
title = "🎥 " + title
147145
if "images" in submission.preview:
148146
img_url.append(

src/util/parse_tweet.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import re
2-
import json
31
import datetime
2+
import json
3+
import re
44
from typing import List
55

66
# > Local imports
@@ -84,7 +84,7 @@ def parse_tweet(tweet: dict, update_tweet_id: bool = False):
8484
)
8585
return
8686
# For long tweets
87-
elif "note_tweet" in tweet.keys():
87+
if "note_tweet" in tweet:
8888
is_long_tweet = True
8989
tweet_text = tweet["note_tweet"]["note_tweet_results"]["result"]["text"]
9090
tweet_entities = tweet["note_tweet"]["note_tweet_results"]["result"][

0 commit comments

Comments
 (0)