remove unneccessary/misplaced error check

This commit is contained in:
msk
2022-10-01 14:09:14 -07:00
parent ac23c63f78
commit 65b554f014
6 changed files with 14 additions and 19 deletions
+7 -11
View File
@@ -1,6 +1,7 @@
# NijiHolo EN/ID Bot
*Twitter bot that follows interactions between Nijisanji EN/ID and hololive EN/ID members.*
...because some folks are that desperate. Like me!
*Twitter bot that tracks interactions between Nijisanji EN/ID and hololive EN/ID members.*
![The project banner](images/banner.png)
**This project is intended to run [this account](https://twitter.com/NijiHolo_EN_ID).**
@@ -11,15 +12,8 @@ The bot will be runnable in three modes:
* may implement short-term catch-up function
* Command-line (`cmd`): an interactive mode for manual control (TBA; currently drops into Python interpretor)
## Roadmap
* ~~Read past tweets of members from both companies~~
* ~~Create screenshot of tweet~~
* ~~Track tweets in queue files~~
* ~~Post tweets along with screenshot of tweet~~
* Include screenshot of tweet being replied to?
* ~~Combine image with quote tweet~~
* ~~Don't tweet already-existing tweets (check our past quote tweets; might be saved in a file for quicker access)~~
* Track posted tweets in a history file
## Extra TODOs
* Include screenshot of tweet being replied to
## Notes
* Tweets should only occur if involved parties are cross-company
@@ -28,3 +22,5 @@ The bot will be runnable in three modes:
* Our tweets should include:
* involved names (w/o @) and the tweet (as a quote tweet)
* screenshot of the tweet (+ maybe image of tweet being replied to when applicable)
**This project was created for entertainment purposes. It is not to be used for malicious purposes.**

Before

Width:  |  Height:  |  Size: 117 KiB

After

Width:  |  Height:  |  Size: 117 KiB

+5 -7
View File
@@ -10,16 +10,14 @@ import api_secrets
import talent_lists as tl
def on_response(resp):
try:
ttweet = TalentTweet.create_from_v2api_response(resp)
except ValueError as e:
if "insufficient other parties" in str(e):
print('Tweet has no other parties, probably not a cross-company interaction.')
return
id = resp.data.id
ttweet = TalentTweet.create_from_v2api_response(resp)
if ttweet.is_cross_company():
print('Tweet is cross-company! Creating post...')
print(f'Tweet {id} is cross-company! Creating post...')
asyncio.run(TwAPI.instance.post_ttweet(ttweet))
else:
print(f'Tweet {id} is not cross-company.')
def run():
sc = tweepy.StreamingClient(api_secrets.bearer_token())
+2 -1
View File
@@ -1,4 +1,3 @@
import asyncio
import datetime
import traceback
@@ -48,6 +47,8 @@ class TwAPI:
try:
mentions.remove(reply_to)
except: pass
try:
mentions.remove(qrt)
except: pass