MADE RUST TRANSFER ARGS TO PYTHON LETS GOOOOOOOOOOOOOOOOOOOOOOO

This commit is contained in:
2025-02-07 17:40:16 +01:00
parent 8186e4e75f
commit 9425c2cccc
7 changed files with 23 additions and 20 deletions
+6 -1
View File
@@ -2,9 +2,11 @@ from io import TextIOWrapper
from praw import models
import praw
import os
from macros import *
class Bot:
args: list[str] = ["NO_RUST", "--dev", "--py"]
password: str = os.environ.get("ASSISTANT_R_PASS")
secret: str = os.environ.get("ASSISTANT_R_TOKEN")
@@ -22,4 +24,7 @@ class Bot:
)
sr: models.Subreddit = r.subreddit("bytedicetesting") #r.subreddit("boykisser")
data_f: TextIOWrapper = None
data: dict = {}
data: dict = {}
def set_args(self, args: list[str]):
self.args = args
+6 -1
View File
@@ -1,14 +1,19 @@
import sys
from macros import *
import bot as botPy
import data
from macros import *
def main():
sys.stdout.reconfigure(encoding="utf-8")
bot = botPy.Bot()
try: bot.set_args(args)
except NameError:
py_print("No command args found from Rust. Don't worry though, we have backup in place.")
py_print("ARGS:", str(bot.args[1:]))
py_print("Reading data...")
data.read_data(bot)
View File