StudioComment¶
Properties¶
id : int
¶
The ID of the comment.
parent_id : int | None
¶
If the comment is a reply, this is the ID of its parent comment. Otherwise, it is None
.
commentee_id : int | None
¶
If the comment is a reply, this is the user ID of the author of the parent comment. Otherwise, it is None
.
content : str
¶
The content of the comment.
reply_count : int
¶
The number of replies the comment has. If the comment is a reply, this is simply 0
.
author : str
¶
The username of the author of the comment.
author_id : int
¶
The user ID of the author of the comment.
created_timestamp : str
¶
An ISO 8601 timestamp representing the date the comment was created.
Example:
import datetime
def iso_to_readable(iso):
timezone = datetime.datetime.now(datetime.timezone.utc).astimezone().tzinfo
date = datetime.datetime.fromisoformat(iso.replace("Z", "+00:00"))
date.astimezone(timezone)
return date.strftime("%Y-%m-%d %I:%M %p")
print(session.get_studio(14).get_comments()[0].created_timestamp)
# 2022-08-04 10:47 AM
last_modified_timestamp : str
¶
An ISO 8601 timestamp representing the date the comment was last modified.
Note
I have no idea what the hell this means.
visible : bool
¶
A boolean value representing whether the comment has been deleted or not.
studio : Studio
¶
The studio that the comment is on, as a Studio object.
Methods¶
delete()
¶
Deletes the comment. You must be logged in, the author of the comment, and a manager of the studio that the comment is on for this to not throw an error.
Example:
studio = session.get_studio(193293231031)
for comment in studio.get_comments(all=True):
if "scratch" in comment.content:
comment.delete()
report()
¶
Reports the comment. You must be logged in for this to not throw an error.
reply(content)
{ #reply data-toc-label="reply"¶
}
Replies to the comment. You must be logged in for this to not throw an error. Returns the reply once it is posted as a StudioComment.
PARAMETERS
- content (
str
) - The content of your reply.
RETURNS - StudioComment
Example:
comment = session.get_studio(14).get_comments()[0]
comment.reply("Go away")
get_replies(all=False, limit=20, offset=0)
¶
Gets a list of replies to the comment. Returns an array of StudioComment objects.
PARAMETERS
- all (
Optional[bool]
) - Whether to retrieve every single reply or justlimit
replies. - limit (
Optional[int]
) - How many replies to retrieve ifall
isFalse
. - offset (
Optional[int]
) - The offset of the replies from the newest ones - i.e. an offset of 20 would give you the next 20 replies after the first 20.
RETURNS - list[StudioComment]