Skip to content

Commit

Permalink
Add some stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
PlaceReporter99 committed Apr 30, 2024
1 parent f3372af commit 170a458
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 5 deletions.
1 change: 1 addition & 0 deletions .github/workflows/chatupdate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ jobs:
env:
email: ${{ secrets.BOT_EMAIL }}
password: ${{ secrets.BOT_PASSWORD }}
pastebin: ${{ secrets.PASTEBIN_KEY }}
event: ${{ github.event_name }}
actor: ${{ github.actor }}
payload: ${{ toJSON(github.event) }}
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
sechat
deep_translator
flask
firebase_admin
firebase_admin
requests
10 changes: 6 additions & 4 deletions sendmsg.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,27 @@
import sys
import os

import requests
import sechat

EMAIL = os.environ["email"]
PASSWORD = os.environ["password"]
EVENT_NAME = os.environ["event"]
EVENT_USER = os.environ["actor"]
PAYLOAD = os.environ["payload"]
PASTEBIN_KEY = os.environ["pastebin"]

cleaned = re.sub(r"\[.*\]", "", EVENT_USER)
CLEANED = re.sub(r"\[.*\]", "", EVENT_USER)

bot = sechat.Bot()
bot.login(EMAIL, PASSWORD)
r = bot.joinRoom(152883)

def pastebin(text, key):
return requests.post("https://pastebin.com/api/api_post.php", data = {'api_dev_key': key, 'api_option': 'paste', 'api_paste_code': text, 'api_paste_private': '1'}).text

def indent(text):
return "\n".join(" " + x for x in text.split("\n"))


r.send(f'Event "{EVENT_NAME}" was triggered by [{cleaned}](https://github.com/{cleaned}).')
r.send('Payload:')
r.send(indent(PAYLOAD))
r.send(f'Event "{EVENT_NAME}" was triggered by [{CLEANED}](https://github.com/{CLEANED}). The [payload]({pastebin(PAYLOAD, PASTEBIN_KEY)}) is linked.')
5 changes: 5 additions & 0 deletions status.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,8 @@ I am playing golf with my Python. 🏌️🐍⛳
I am wondering why `[prog_rand]` is part of my code.
I am trying to catch the number 22. Yes, I caught it!
I am posting empty strings on ---Twitter--- X on behalf of The Empty String Photographer. ---Their twitter password is `empty_string`.---
Wait, there's a banana waiting for me?
When did I ever say I was a bot?
When you accidentally share your API key with the whole world:
What the heck are you doing @OakBot !?!
r.send(f'Event "{EVENT_NAME}" was triggered by [{CLEANED}](https://github.com/{CLEANED}). The [payload]({pastebin(PAYLOAD, PASTEBIN_KEY)}) is linked.')

0 comments on commit 170a458

Please sign in to comment.