Merge branch 'main' of https://github.com/notBscalE/BotYam into main
This commit is contained in:
commit
7a2290158b
6 changed files with 67 additions and 16 deletions
19
.github/workflows/main.yml
vendored
Normal file
19
.github/workflows/main.yml
vendored
Normal file
|
|
@ -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"
|
||||||
|
|
@ -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.
|
The API tokens are stored in the API hash, used to communicate with Twitter API.
|
||||||
|
|
||||||
!!! warning "Twitter API License Changes"
|
!!! warning "Twitter API License Changes"
|
||||||
Currently, the bot is operating under the Twitter API Elevated Access.<br>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.<br>
|
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.
|
Please follow `@FromBotYam` for updates.
|
||||||
|
|
||||||
## The Data Structure
|
## The Data Structure
|
||||||
|
|
|
||||||
|
|
@ -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.
|
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"
|
!!! warning "Twitter API License Changes"
|
||||||
Currently, the bot is operating under the Twitter API Elevated Access.<br>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.<br>
|
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.
|
Please follow `@FromBotYam` for updates.
|
||||||
|
|
||||||
Here you can have the syntax menu, but also read some information for nerds.
|
Here you can have the syntax menu, but also read some information for nerds.
|
||||||
|
|
@ -19,6 +23,7 @@ Here you can have the syntax menu, but also read some information for nerds.
|
||||||
|
|
||||||
### Credits
|
### Credits
|
||||||
All jokes and videos are accumulated and edited by Lucy Joshua, except:
|
All jokes and videos are accumulated and edited by Lucy Joshua, except:
|
||||||
|
|
||||||
- "I'm From Bat Yam" - Aviv Yashar (@aviv_yashar)
|
- "I'm From Bat Yam" - Aviv Yashar (@aviv_yashar)
|
||||||
- "Gebels" - Aviv Yashar (@aviv_yashar)
|
- "Gebels" - Aviv Yashar (@aviv_yashar)
|
||||||
- "Vodka Redbull/Misadot" - Lindi (@lindi_orginal)
|
- "Vodka Redbull/Misadot" - Lindi (@lindi_orginal)
|
||||||
|
|
|
||||||
|
|
@ -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.
|
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:
|
The victims currently are:
|
||||||
|
|
||||||
- Lucy Joshua (@LucyBscalE)
|
- Lucy Joshua (@LucyBscalE)
|
||||||
- Stav Raz (@StevenRaz5)
|
- Stav Raz (@StevenRaz5)
|
||||||
- Aviv Yashar (@aviv_yashar)
|
- Aviv Yashar (@aviv_yashar)
|
||||||
|
|
@ -27,14 +28,17 @@ The victims currently are:
|
||||||
- Shauli Greenfeld (@shaulig)
|
- Shauli Greenfeld (@shaulig)
|
||||||
- Nir Hauschner (@nir_hau)
|
- Nir Hauschner (@nir_hau)
|
||||||
|
|
||||||
!! note "Join the victim list!"
|
|
||||||
|
!!! note "Join the victim list!"
|
||||||
Wanna be a part of the list? Ask us in our DMs and you'll get there!
|
Wanna be a part of the list? Ask us in our DMs and you'll get there!
|
||||||
|
|
||||||
The optional responses added to the post:
|
The optional responses added to the post:
|
||||||
|
|
||||||
- "שלום קורבן"
|
- "שלום קורבן"
|
||||||
- "אי אפשר לברוח מהחרא הזה אה"
|
- "אי אפשר לברוח מהחרא הזה אה"
|
||||||
- "מה קורה כפרה"
|
- "מה קורה כפרה"
|
||||||
|
|
||||||
|
|
||||||
For example:
|
For example:
|
||||||
|
|
||||||
<blockquote class="twitter-tweet"><p lang="iw" dir="rtl">אי אפשר לברוח מהחרא הזה אה<br>ואחחחחח בפרק הקודם <a href="https://t.co/1hudYy1Zyq">pic.twitter.com/1hudYy1Zyq</a></p>— אני מבוט-ים (@FromBotYam) <a href="https://twitter.com/FromBotYam/status/1621689770031157250?ref_src=twsrc%5Etfw">February 4, 2023</a></blockquote> <script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
|
<blockquote class="twitter-tweet"><p lang="iw" dir="rtl">אי אפשר לברוח מהחרא הזה אה<br>ואחחחחח בפרק הקודם <a href="https://t.co/1hudYy1Zyq">pic.twitter.com/1hudYy1Zyq</a></p>— אני מבוט-ים (@FromBotYam) <a href="https://twitter.com/FromBotYam/status/1621689770031157250?ref_src=twsrc%5Etfw">February 4, 2023</a></blockquote> <script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
|
||||||
|
|
@ -184,7 +188,11 @@ None
|
||||||
```
|
```
|
||||||
|
|
||||||
!!! note
|
!!! note
|
||||||
Yep. That's right.<br>If you'll tag `@FromBotYam` with nothing on, you'll get the tilt gag.<br>You have been warned.
|
Yep. That's right.
|
||||||
|
|
||||||
|
If you'll tag `@FromBotYam` with nothing on, you'll get the tilt gag.
|
||||||
|
|
||||||
|
You have been warned.
|
||||||
|
|
||||||
**The possible replies**:
|
**The possible replies**:
|
||||||
<blockquote class="twitter-tweet" data-conversation="none"><p lang="iw" dir="rtl">סרבאאאקקקקקקק <a href="https://t.co/pnh4jveVRH">pic.twitter.com/pnh4jveVRH</a></p>— אני מבוט-ים (@FromBotYam) <a href="https://twitter.com/FromBotYam/status/1620403511102930945?ref_src=twsrc%5Etfw">January 31, 2023</a></blockquote> <script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script> <br>
|
<blockquote class="twitter-tweet" data-conversation="none"><p lang="iw" dir="rtl">סרבאאאקקקקקקק <a href="https://t.co/pnh4jveVRH">pic.twitter.com/pnh4jveVRH</a></p>— אני מבוט-ים (@FromBotYam) <a href="https://twitter.com/FromBotYam/status/1620403511102930945?ref_src=twsrc%5Etfw">January 31, 2023</a></blockquote> <script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script> <br>
|
||||||
|
|
|
||||||
|
|
@ -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):
|
if any(word in tweet.data['text'] for word in words):
|
||||||
reply_text = reply_text_bank[random.randint(0, (len(reply_text_bank)-1))]
|
reply_text = reply_text_bank[random.randint(0, (len(reply_text_bank)-1))]
|
||||||
# Post reply
|
# Post reply
|
||||||
|
try:
|
||||||
if tweet.data['author_id'] in victim_bank['author_id'] and not "@FromBotYam" in tweet.data['text']:
|
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
|
reply_text = victim_bank['reply'][random.randint(0,2)] + "\nו" + reply_text
|
||||||
res = conn.api.create_tweet(
|
res = conn.api.create_tweet(
|
||||||
text=reply_text,
|
text=reply_text,
|
||||||
in_reply_to_tweet_id=tweet["id"]
|
in_reply_to_tweet_id=tweet["id"]
|
||||||
)
|
)
|
||||||
postcounter = postcounter + 1
|
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']}"
|
response_data = f"RESPONDING: {res.data['text']}"
|
||||||
print(response_data)
|
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
|
||||||
return postcounter
|
return postcounter
|
||||||
|
|
||||||
class BotYamPoster(tweepy.StreamingClient):
|
class BotYamPoster(tweepy.StreamingClient):
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ from BotYamPoster import init_streamobject
|
||||||
from connector import Connector
|
from connector import Connector
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
print("BOT-YAM - VERSION 3.0.1 >>>>")
|
print("BOT-YAM - VERSION 3.0.2 >>>>")
|
||||||
conn = Connector()
|
conn = Connector()
|
||||||
stream = init_streamobject(conn)
|
stream = init_streamobject(conn)
|
||||||
print("Adding stream rules...")
|
print("Adding stream rules...")
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue