TimMcCool / scratchattach

Scratch API wrapper with support for almost all site features, cloud requests framework and more
MIT License
176 stars 46 forks source link

AttributeError: 'Session' object has no attribute 'connect_scratch_cloud' #265

Open webbrowser11 opened 2 hours ago

webbrowser11 commented 2 hours ago

Traceback (most recent call last): File "c:\Users(username)\Downloads\SAuth.py", line 22, in cloud = session.connect_scratch_cloud("1090320725") # Connect to Scratch's cloud ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'Session' object has no attribute 'connect_scratch_cloud'. Did you mean: 'connect_tw_cloud'?]

this was correct in the docs, but not in my code.

webbrowser11 commented 2 hours ago

i need to finish this soon so, i need an answer soon

webbrowser11 commented 2 hours ago

(out of date)

webbrowser11 commented 59 minutes ago

if someone could look over the code i got now that'd be great

TheCommCraft commented 56 minutes ago

update your scratchattach

T_cat9000_2 @.***> schrieb am Sa., 2. Nov. 2024, 00:21:

if someone could look over the code i got now that'd be great

— Reply to this email directly, view it on GitHub https://github.com/TimMcCool/scratchattach/issues/265#issuecomment-2452710971, or unsubscribe https://github.com/notifications/unsubscribe-auth/ATCKMZS5SSBVWWH2HMLH3IDZ6QEIBAVCNFSM6AAAAABRBBAMIGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDINJSG4YTAOJXGE . You are receiving this because you are subscribed to this thread.Message ID: @.***>

webbrowser11 commented 53 minutes ago

okay how

TimMcCool commented 35 minutes ago

Run

pip install -U scratchattach

in your command prompt to update scratchattach

If you can't update it for whatever reason, use session.connect_cloud("project_id") instead

webbrowser11 commented 15 minutes ago

Alright that's solved and i might be dumb because idk what is happening here (am i missing something?):

# first auth section
events = cloud.events()
def on_set(activity): #Called when a cloud var is set
    activity.load_log_data()\

def Sector2(activity):
    if activity.username == username:
        GenerateKey()
        input(f"Please eneter this key into the input prompt on the project: {Key} ")

def Sector1(activity):
    input("Get on scratch and go to the project: https://scratch.mit.edu/projects/1090320725/")
    print("MAKE SURE TO KEEP THE PROJECT WINDOW OPEN")
    if activity.username == username:
        activity.username = None
        Sector2()
Sector1()
events.start()

error:

Traceback (most recent call last):
  File "c:\Users\(username)\Downloads\SAuth.py", line 45, in <module>
    Sector1()
TypeError: Sector1() missing 1 required positional argument: 'activity'