Manage Feature

Manage Client

class ManageClient(channel_id: str, client: Client)

Represent a client that provides broadcast management functionality.

async add_prohibit_word(word: str) ProhibitWord | None

Add a prohibit word at chat.

Parameters:

word (str) – A word to prohibit.

Returns:

Returns the generated prohibit word.

Return type:

Optional[ProhibitWord]

async add_restrict(user: str | PartialUser) PartialUser

Add an user to restrict activity.

Parameters:

user (str | ParticleUser) – A user object to add restrict activity. Instead, it can be user id or nickname.

Returns:

Returns an object containning activity-restricted users.

Return type:

ParticleUser

async add_role(user: str | PartialUser, role: UserRole) PartialUser

Add a broadcast permission to user.

Parameters:
  • user (str | ParticleUser) – A user object to add role. Instead, it can be user id or nickname.

  • role (UserRole) – A enumeration class containing broadcast role. It can only set the role to UserRole.chat_manager, UserRole.settlement_manager, or UserRole.channel_manager. Giving any other role will cause a TypeError exception.

Returns:

Returns an user with added role.

Return type:

ParticleUser

async chat_activity_count(user: str | PartialUser) ChatActivityCount

Get chat activity count of user.

Parameters:

user (str | ParticleUser) – A user object to get chat activity count. Instead, it can be user id.

Returns:

  • ChatActivityCount – Returns a chat activity count object contains the count of temporary activity restrictions,

  • the count of activity restrictions, and the count of chats.

async close()

Closes the connection to chzzk.

async edit_prohibit_word(prohibit_word: ProhibitWord | int, word: str) ProhibitWord | None

Modify a prohibit word.

Parameters:
  • prohibit_word (ProhibitWord | int) – The prohibit word object to modify. Instead, it can be prohibit word id.

  • word (str) – A new word to prohibit.

Returns:

Returns the modified prohibit word.

Return type:

Optional[ProhibitWord]

async followers(page: int = 0, size: int = 50, sort_type: SortType = SortType.recent) ManageResult[ManageFollower]

Get followers of channel.

Parameters:
  • page (Optional[int]) – The number of page, by default 0

  • size (Optional[int]) – The number of followers to import at once, by default 50

  • sort_type (Optional[SortType]) – A sort order, by default SortType.recent

Returns:

Returns a ManageResult containing the follower info.

Return type:

ManageResult[ManageFollower]

async get_chat_rule() str

Get chat rule of broadcast.

Returns:

Returns a chat rule.

Return type:

str

async get_prohbit_word(word: str) ProhibitWord | None

Get prohibit word with word. When word does not contain prohibit word, returns None.

Parameters:

word (str) – A word to find prohibit word.

Returns:

When word contains prohibit words, return ProhibitWord object.

Return type:

Optional[ProhibitWord]

async get_prohibit_words() List[ProhibitWord]

Get prohibit words in chat.

Returns:

Returns the prohibit words.

Return type:

List[ProhibitWord]

property is_closed: bool

Indicates if the session is closed.

async live_replay(page: int = 0, size: int = 50) ManageResult[ManageVideo]

Get streamming replay video of channel.

Parameters:
  • page (Optional[int]) – The number of page, by default 0

  • size (Optional[int]) – The number of streamming replay video to import at once, by default 50

Returns:

Returns a ManageResult containing the streamming replay video.

Return type:

ManageResult[ManageVideo]

async remove_prohibit_word(prohibit_word: ProhibitWord | int) None

Remove a prohibit word.

Parameters:

prohibit_word (ProhibitWord | int) – The prohibit word object to remove. Instead, it can be prohibit word id.

async remove_prohibit_words() None

Remove all prohibit words.

async remove_restrict(user: str | PartialUser) None

Remove an user to restrict activity.

Parameters:

user (str | ParticleUser) – A user object to remove restrict activity. Instead, it can be user id or nickname.

Returns:

Returns an user whose activity is unrestricted.

Return type:

ParticleUser

async remove_role(user: str | PartialUser) None

Remove a broadcast permission to user.

Parameters:

user (str | ParticleUser) – A user object to remove role. Instead, it can be user id or nickname.

async restrict(page: int = 0, size: int = 50, nickname: str | None = None) ManageResult[UnrestrictRequest]

Get activitiy restricted user of channel.

Parameters:
  • page (Optional[int]) – The number of page, by default 0

  • size (Optional[int]) – The number of activity restricted user to import at once, by default 50

  • nickname (Optional[str]) – Lookup by the activity restricted user’s nickname, by default None

Returns:

Returns a ManageResult containing the restricted user info.

Return type:

ManageResult[RestrictUser]

async set_chat_rule(word: str) None

Set chat rule of broadcast.

Parameters:

word (str) – A new chat rule to set up.

async stream() Stream

Get a stream key required for streamming.

Returns:

Return a stream key for streamming.

Return type:

Stream

async subcribers(page: int = 0, size: int = 50, sort_type: SortType = SortType.recent, publish_period: Literal[1, 3, 6] | None = None, tier: SubscriberTier | None = None, nickname: str | None = None) ManageResult[ManageSubcriber]

Get subcribers of channel.

Parameters:
  • page (Optional[int]) – The number of page, by default 0

  • size (Optional[int]) – The number of subscribers to import at once, by default 50

  • sort_type (Optional[SortType]) – A sort order, by default SortType.recent

  • publish_period (Optional[Literal[1, 3, 6]]) – Lookup by the subscriber’s publish period, by default None

  • tier (Optional[SubscriberTier]) – Lookup by the subscriber’s tier, by default None.

  • nickname (Optional[str]) – Lookup by the subscriber’s nickname, by default None

Returns:

Returns a ManageResult containing the subscriber info.

Return type:

ManageResult[ManageSubcriber]

async unrestrict_requests(page: int = 0, size: int = 50, nickname: str | None = None) ManageResult[UnrestrictRequest]

Get unrestrict activity requests of channel.

Parameters:
  • page (Optional[int]) – The number of page, by default 0

  • size (Optional[int]) – The number of unrestrict activity requests to import at once, by default 50

  • nickname (Optional[str]) – Lookup by the unrestrict activity requests with user’s nickname, by default None

Returns:

Returns a ManageResult containing the unrestrict requests.

Return type:

ManageResult[UnrestrictRequest]

async videos(page: int = 0, size: int = 50) ManageResult[ManageVideo]

Get uploaded video of channel.

Parameters:
  • page (Optional[int]) – The number of page, by default 0

  • size (Optional[int]) – The number of video to import at once, by default 50

Returns:

Returns a ManageResult containing the video.

Return type:

ManageResult[ManageVideo]

Enumerations

class SortType
longer = 'LONGER'
recent = 'RECENT'
class SubscriberTier
tier1 = 'TIER_1'
tier2 = 'TIER_2'

Chat Activity Count

class ChatActivityCount
chat_message_count: int
restrict: bool
restrict_count: int
temporary_restrict: bool
temporary_restrict_count: int

Search Result

class ManageResult
data: List[T]
page: int
size: int
total_count: int
total_pages: int
class ManageSubcriber
created_date: datetime
nickname: str | None
profile_image_url: str | None
publish_period: int
tier: str
total_month: int
twitch_month: int | None
user_id_hash: str | None
verified_mark: bool
class ManageFollower
channel_following: FollowingInfo
following: FollowingInfo
user: PartialUser
class RestrictUser
created_date: datetime
execute_nickname: str
nickname: str
async remove_restrict()

Remove this user to restrict activity.

seq: int
user_id_hash: str
class ManageVideo
comment_count: int
created_date: Annotated[datetime, BeforeValidator(func=special_date_parsing_validator)]
deleted: bool
exposure: bool
exposure_button: str
like_count: int
live_accumulate_count: int
live_id: int | None
live_open_date: Annotated[datetime | None, BeforeValidator(func=special_date_parsing_validator)]
live_unique_view_count: int
manual_publishable: bool
publish: bool
publish_type: str
read_count: int
vod_status: str
class FollowingInfo
follow_date: datetime | None
following: bool
notification: bool

Prohibit Word

class ProhibitWord
created_date: datetime
async edit(word: str)

Modify this prohibit word.

Parameters:

word (str) – A new word to prohibit.

nickname: str
prohibit_word: str
prohibit_word_no: int
async remove()

Remove this prohibit word.

Stream

class Stream
stream_key: str
stream_seq: int
stream_url: str