-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathComment on profile!
More file actions
22 lines (19 loc) · 902 Bytes
/
Comment on profile!
File metadata and controls
22 lines (19 loc) · 902 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import scratchattach as sa
SESSION_ID = "" # paste your full scratchsessionsid
USERNAME = "AYSemkiv" # exact username you want to comment on
# Try modern path first; fall back to legacy API if needed
try:
# Newer: login_by_id accepts username and returns a session with get_user
session = sa.login_by_id(SESSION_ID, username=USERNAME)
try:
user = session.get_user(USERNAME) # newer method
except AttributeError:
user = session.connect_user(USERNAME) # fallback for mid-era versions
except TypeError:
# Very old: Session() + set_session_id, then connect_user only
session = sa.Session()
session.set_session_id(SESSION_ID)
user = session.connect_user(USERNAME)
# Post the comment to your profile
user.post_comment("This is a test comment made possible by scratchattach!")
print(f"✅ Comment posted to @{USERNAME}'s profile.")