remove unneccessary/misplaced error check
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
# NijiHolo EN/ID Bot
|
# NijiHolo EN/ID Bot
|
||||||
*Twitter bot that follows interactions between Nijisanji EN/ID and hololive EN/ID members.*
|
*Twitter bot that tracks interactions between Nijisanji EN/ID and hololive EN/ID members.*
|
||||||
...because some folks are that desperate. Like me!
|
|
||||||
|

|
||||||
|
|
||||||
**This project is intended to run [this account](https://twitter.com/NijiHolo_EN_ID).**
|
**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
|
* may implement short-term catch-up function
|
||||||
* Command-line (`cmd`): an interactive mode for manual control (TBA; currently drops into Python interpretor)
|
* Command-line (`cmd`): an interactive mode for manual control (TBA; currently drops into Python interpretor)
|
||||||
|
|
||||||
## Roadmap
|
## Extra TODOs
|
||||||
* ~~Read past tweets of members from both companies~~
|
* Include screenshot of tweet being replied to
|
||||||
* ~~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
|
|
||||||
|
|
||||||
## Notes
|
## Notes
|
||||||
* Tweets should only occur if involved parties are cross-company
|
* 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:
|
* Our tweets should include:
|
||||||
* involved names (w/o @) and the tweet (as a quote tweet)
|
* involved names (w/o @) and the tweet (as a quote tweet)
|
||||||
* screenshot of the tweet (+ maybe image of tweet being replied to when applicable)
|
* 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 |
+4
-6
@@ -10,16 +10,14 @@ import api_secrets
|
|||||||
import talent_lists as tl
|
import talent_lists as tl
|
||||||
|
|
||||||
def on_response(resp):
|
def on_response(resp):
|
||||||
try:
|
id = resp.data.id
|
||||||
ttweet = TalentTweet.create_from_v2api_response(resp)
|
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
|
|
||||||
|
|
||||||
if ttweet.is_cross_company():
|
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))
|
asyncio.run(TwAPI.instance.post_ttweet(ttweet))
|
||||||
|
else:
|
||||||
|
print(f'Tweet {id} is not cross-company.')
|
||||||
|
|
||||||
def run():
|
def run():
|
||||||
sc = tweepy.StreamingClient(api_secrets.bearer_token())
|
sc = tweepy.StreamingClient(api_secrets.bearer_token())
|
||||||
|
|||||||
+2
-1
@@ -1,4 +1,3 @@
|
|||||||
import asyncio
|
|
||||||
import datetime
|
import datetime
|
||||||
import traceback
|
import traceback
|
||||||
|
|
||||||
@@ -48,6 +47,8 @@ class TwAPI:
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
mentions.remove(reply_to)
|
mentions.remove(reply_to)
|
||||||
|
except: pass
|
||||||
|
try:
|
||||||
mentions.remove(qrt)
|
mentions.remove(qrt)
|
||||||
except: pass
|
except: pass
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user