diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
new file mode 100644
index 0000000..477dd55
--- /dev/null
+++ b/.github/workflows/main.yml
@@ -0,0 +1,19 @@
+on:
+ push:
+ branches:
+ - main
+ workflow_dispatch:
+
+jobs:
+ build:
+ name: Build
+ runs-on: ubuntu-latest
+ steps:
+ - name: executing remote ssh commands using password
+ uses: appleboy/ssh-action@v0.1.7
+ with:
+ host: ${{ secrets.SSH_HOST }}
+ username: ${{ secrets.SSH_USER }}
+ password: ${{ secrets.SSH_PASSWORD }}
+ port: 22
+ script: "cd /etc/BotYam && git pull && docker-compose up -d --build"
diff --git a/docs/files/data.md b/docs/files/data.md
index 38ed835..3f0c5b2 100644
--- a/docs/files/data.md
+++ b/docs/files/data.md
@@ -16,7 +16,11 @@ The DB is used for storing everything in stores, as its credentials are currentl
The API tokens are stored in the API hash, used to communicate with Twitter API.
!!! warning "Twitter API License Changes"
- Currently, the bot is operating under the Twitter API Elevated Access.
On February 9th, new changes for the API access that has been announced will come into effect, and currently there isn't a guarantee that the bot will be up after the changes will be applied.
+ Currently, the bot is operating under the Twitter API Elevated Access.
+
+ On February 9th, new changes for the API access that has been announced will come into effect, and currently there isn't a guarantee that the bot will be up after the changes will be applied.
+
+
Please follow `@FromBotYam` for updates.
## The Data Structure
diff --git a/docs/files/index.md b/docs/files/index.md
index af71cbe..028567a 100644
--- a/docs/files/index.md
+++ b/docs/files/index.md
@@ -3,7 +3,11 @@
Welcome to the Bot Yam documentation, to ultimate source of knowledge when it comes about the bot, using the handle @FromBotYam.
!!! warning "Twitter API License Changes"
- Currently, the bot is operating under the Twitter API Elevated Access.
On February 9th, new changes for the API access that has been announced will come into effect, and currently there isn't a guarantee that the bot will be up after the changes will be applied.
+ Currently, the bot is operating under the Twitter API Elevated Access.
+
+ On February 9th, new changes for the API access that has been announced will come into effect, and currently there isn't a guarantee that the bot will be up after the changes will be applied.
+
+
Please follow `@FromBotYam` for updates.
Here you can have the syntax menu, but also read some information for nerds.
@@ -19,10 +23,11 @@ Here you can have the syntax menu, but also read some information for nerds.
### Credits
All jokes and videos are accumulated and edited by Lucy Joshua, except:
+
- "I'm From Bat Yam" - Aviv Yashar (@aviv_yashar)
- "Gebels" - Aviv Yashar (@aviv_yashar)
- "Vodka Redbull/Misadot" - Lindi (@lindi_orginal)
- "Misadot Re-enactment" - Kai Mairone (@KaiMairone)
### License
-The project is protected under the GNU GPLv3. For more information, visit the [license page](license.md).
Please read if you conside contributing.
\ No newline at end of file
+The project is protected under the GNU GPLv3. For more information, visit the [license page](license.md).
Please read if you conside contributing.
diff --git a/docs/files/usage.md b/docs/files/usage.md
index 665e744..a7a9067 100644
--- a/docs/files/usage.md
+++ b/docs/files/usage.md
@@ -19,6 +19,7 @@ Victims
If you're included in the victims list, a random number generator will decide if an automated response will be posted, with an additional message.
The victims currently are:
+
- Lucy Joshua (@LucyBscalE)
- Stav Raz (@StevenRaz5)
- Aviv Yashar (@aviv_yashar)
@@ -27,14 +28,17 @@ The victims currently are:
- Shauli Greenfeld (@shaulig)
- Nir Hauschner (@nir_hau)
-!! note "Join the victim list!"
- Wanna be a part of the list? Ask us in our DMs and you'll get there!
+
+!!! note "Join the victim list!"
+ Wanna be a part of the list? Ask us in our DMs and you'll get there!
The optional responses added to the post:
+
- "שלום קורבן"
- "אי אפשר לברוח מהחרא הזה אה"
- "מה קורה כפרה"
+
For example:
@@ -184,8 +188,12 @@ None ``` !!! note - Yep. That's right.אי אפשר לברוח מהחרא הזה אה
— אני מבוט-ים (@FromBotYam) February 4, 2023
ואחחחחח בפרק הקודם pic.twitter.com/1hudYy1Zyq
סרבאאאקקקקקקק pic.twitter.com/pnh4jveVRH
— אני מבוט-ים (@FromBotYam) January 31, 2023
\ No newline at end of file +חלאססססס pic.twitter.com/uwm7wovnBA
— אני מבוט-ים (@FromBotYam) January 31, 2023
diff --git a/src/BotYamPoster.py b/src/BotYamPoster.py index 8a2a9f7..1db3d4f 100644 --- a/src/BotYamPoster.py +++ b/src/BotYamPoster.py @@ -20,15 +20,30 @@ def post_reply(conn, victim_bank, tweet, words, reply_text_bank, postcounter): if any(word in tweet.data['text'] for word in words): reply_text = reply_text_bank[random.randint(0, (len(reply_text_bank)-1))] # Post reply - if tweet.data['author_id'] in victim_bank['author_id'] and not "@FromBotYam" in tweet.data['text']: - reply_text = victim_bank['reply'][random.randint(0,2)] + "\nו" + reply_text - res = conn.api.create_tweet( - text=reply_text, - in_reply_to_tweet_id=tweet["id"] - ) + try: + if tweet.data['author_id'] in victim_bank['author_id'] and not "@FromBotYam" in tweet.data['text']: + reply_text = victim_bank['reply'][random.randint(0,2)] + "\nו" + reply_text + res = conn.api.create_tweet( + text=reply_text, + in_reply_to_tweet_id=tweet["id"] + ) + except tweepy.errors.TwitterServerError as e: + print("ERROR: An error occured, we'll try again in a few minutes. The error: " + str(e)) + try: + if tweet.data['author_id'] in victim_bank['author_id'] and not "@FromBotYam" in tweet.data['text']: + reply_text = victim_bank['reply'][random.randint(0,2)] + "\nו" + reply_text + res = conn.api.create_tweet( + text=reply_text, + in_reply_to_tweet_id=tweet["id"] + ) + + response_data = f"RESPONDING: {res.data['text']}" + print(response_data) + except Exception as e: + print("ERROR: An exception occured. The error: " + str(e)) + except Exception as e: + print("ERROR: An exception occured. The error: " + str(e)) postcounter = postcounter + 1 - response_data = f"RESPONDING: {res.data['text']}" - print(response_data) return postcounter class BotYamPoster(tweepy.StreamingClient): diff --git a/src/main.py b/src/main.py index a83c6ca..897e8d4 100644 --- a/src/main.py +++ b/src/main.py @@ -5,7 +5,7 @@ from BotYamPoster import init_streamobject from connector import Connector def main(): - print("BOT-YAM - VERSION 3.0.1 >>>>") + print("BOT-YAM - VERSION 3.0.2 >>>>") conn = Connector() stream = init_streamobject(conn) print("Adding stream rules...")חלאססססס pic.twitter.com/uwm7wovnBA
— אני מבוט-ים (@FromBotYam) January 31, 2023