This repersents the Client you can use to interact with kick.
Parameters
**options: Any
Options that can be passed
Options
whitelisted: bool = False
If you have been api whitelisted. If set to True, the bypass script will not be used.
bypass_port: int = 9090
The port the bypass script is running on. Defaults to 9090
bypass_host: str = “http://localhost”
The host of the bypass script.
Attributes
user: ClientUser | None
The user you are logged in as. It is None
until Client.login
is called.
Fetches a user from the API.
Parameters
name: str
The user’s slug or username
Raises
HTTPException
Fetching Failed
NotFound
No user with the username/slug exists
Returns
User
The user object associated with the streamer
Gets a chatroom out of a cache that contains chatrooms that you are connected to.
Parameters
chatroom_id: int
The chatroom’s id
Returns
Chatroom | None
Either the chatroom, or None
Gets a partial chatter instance by the streamer and chatter names provided.
Parameters
streamer_name: str
The streamer’s username or slug
chatter_name: str
The chatter’s username or slug
Returns
PartialChatter
The partial chatter
Gets a partial user instance by the username and id provided.
Parameters
username: str
The user’s name
id: int
The user’s id
Returns
PartialUser
The partial user
Lets you set an event outside of a subclass.
Authenticates yourself, and fills Client.user
Unlike Client.start
, this does not start the websocket
Parameters
credentials: Credentials
The credentials to authenticate yourself with
Starts the websocket so you can receive events
And authenticate yourself if credentials are provided.
Parameters
credentials: Optional[Credentials]
The credentials to authenticate yourself with, if any
Authenticates yourself, and fills Client.user
Unlike Client.start
, this does not start the websocket
Parameters
credentials: Credentials
The credentials to authenticate yourself with
Starts the websocket so you can receive events
And authenticate yourself if credentials are provided.
Client.run
automatically calls utils.setup_logging
with the provided kwargs, and calls Client.start
.
Parameters
credentials: Optional[Credentials]
The credentials to authenticate yourself with, if any
Closes the HTTPClient, no requests can be made after this.
on_ready is an event that can be overriden with the Client.event
decorator or with a subclass.
This is called after the client has started the websocket and is receiving events.
on_ready is an event that can be overriden with the Client.event
decorator or with a subclass.
This is called when a message is received over the websocket
Parameters
message: Message
The message that was received
on_livestream_start is an event that can be overriden with the Client.event
decorator or with a subclass.
This is called when a user that is being watched starts streaming
Parameters
livestream: PartialLivestream
The livestream
on_livestream_start is an event that can be overriden with the Client.event
decorator or with a subclass.
This is called when someone starts following a streamer that is being watched.
Parameters
streamer: User
The streamer
on_livestream_start is an event that can be overriden with the Client.event
decorator or with a subclass.
This is called when someone stops following a streamer that is being watched.
Parameters
streamer: PartialLivestream
The streamer
on_payload_receive is an event that can be overriden with the Client.event
decorator or with a subclass.
This is called when an event is received from the websocket.
Parameters
event: str
The payload’s event
payload: dict
The payload
This holds credentials that can be used to authenticate yourself with kick.
Parameters
username: Optional[str]
The username to login with. Can not be used with the email
arg
email: Optional[str]
The email to login with. Can not be used with the username
arg
password: str
The account’s password
one_time_password: Optional[str]
The 2FA code to login with
Attributes
username: Optional[str]
The username to login with. Can not be used with the email
arg
email: Optional[str]
The email to login with. Can not be used with the username
arg
password: str
The account’s password
one_time_password: Optional[str]
The 2FA code to login with
A class which repersents a kick asset.
Attributes
url: str
The asset’s url
Fetches the asset from kick
Raises
HTTPException
Fetching the asset failed
NotFound
Asset no longer exists
Returns
bytes
The asset’s bytes
Saves the asset into a file-like object
Parameters
fp: str | bytes | os.PathLike[Any] | BufferedIOBase
The file-like object for the asset to be written to.
If a filepath is given, then a file will be created instead.
seek_begin: bool
Whether to seek to the beginning of the file after saving is
successfully done.
Raises
HTTPException
Fetching the asset failed
NotFound
Asset no longer exists
Returns
int
The amount of bytes written
A dataclass which represents a badge from a chatroon.
Attributes
type: str
The type of badge
text: str
The badge’s text
count: int
How many of that badge they have
active: bool
If the chatter actively has the badge
A dataclass which represents a subscriber badge from a channel.
Attributes
id: int
The badge’s id
channel_id: int
The id of the channel the chatter is subscribed too
months: int
How many months they have been subscribed to the chatter
image: Asset
The badge’s image
A dataclass which represents one of kick’s main categories
Attributes
id: int
The categorie’s ID
name: str
The categorie’s name
slug: str
The categorie’s slug
icon: Asset
The categorie’s icon
A dataclass which represents one of kick’s sub categories
Attributes
id: int
The categorie’s ID?
category_id: str
The categorie’s ID?
slug: str
The categorie’s slug
name: str
The categorie’s name
tags: list[str]
A list of the categorie’s tags
description: str | None
The categorie’s description, if any
parent: ParentCategory
The categorie’s parent category.
A dataclass that represents a kick chatroom.
Attributes
id: int
The chatroom’s id
streamer: User
The user who this chatroom belongs to
Connects to the chatroom, making it so you can now listen for the messages.
Disconnects to the chatroom, making it so you can no longer listen for the messages.
Sends a message in the chatroom
Parameters
content: str
The message’s content
Raises
NotFound
Streamer or chatter not found
HTTPException
Sending the message failed
Forbidden
You are unauthorized from sending the message
Fetches a chatroom’s chatter
Parameters
chatter_name: str
The chatter’s username
Raises
NotFound
Streamer or chatter not found
HTTPException
Fetching the chatter failed
Returns
Chatter
The chatter
Fetches the chatroom’s bans
Raises
NotFound
Streamer Not Found
HTTPException
Fetching the bans failed
Returns
AsyncIterator[BanEntry]
Yields all of the ban entries
Fetches the chatroom’s banned words
Raises
NotFound
Streamer Not Found
HTTPException
Fetching the words failed
Returns
list[str]
A list of the banned words
Fetches the chatroom’s rules
Raises
NotFound
Streamer Not Found
HTTPException
Fetching the rules failed
Returns
str
The rules
Gets a poll from the chatroom
Raises
NotFound
There is no poll in the current chatroom or Streamer Not Found
HTTPException
Fetching the poll failed
Returns
Poll
The poll
Fetches the emotes from the current chatroom.
Parameters
include_global: bool = False
Whether to include global emotes or not
Raises
NotFound
Streamer Not Found
HTTPException
Fetching the bans failed
Returns
AsyncIterator[Emote]
Yields each emote. Starting with from the chatroom, then global
A dataclass that represents a kick chatroom.
Attributes
id: int
The chatroom’s id
chatable_type: str
The chatroom’s type
created_at: datetime.datetime
When the chatroom was created
updated_at: datetime.datetime
When the chatroom was last updated
chat_mode: ChatroomChatMode
The mode the chatroom is in
slowmode: bool
Whether slowmode is enabled
followers_mode: bool
Whether followers_mode is enabled
subscribers_mode: bool
Whether subscribers_mode is enabled
emotes_mode: bool
Whether emotes_mode is enabled
slow_mode: bool
Whether slow_mode is enabled
message_interval: int
Interval at which messages can be sent when slow_mode is enabled
following_min_duration: int
Unknown on what this is
streamer: User
The user who this chatroom belongs to
Connects to the chatroom, making it so you can now listen for the messages.
Disconnects to the chatroom, making it so you can no longer listen for the messages.
Sends a message in the chatroom
Parameters
content: str
The message’s content
Raises
NotFound
Streamer or chatter not found
HTTPException
Sending the message failed
Forbidden
You are unauthorized from sending the message
Fetches a chatroom’s chatter
Parameters
chatter_name: str
The chatter’s username
Raises
NotFound
Streamer or chatter not found
HTTPException
Fetching the chatter failed
Returns
Chatter
The chatter
Fetches the chatroom’s bans
Raises
NotFound
Streamer Not Found
HTTPException
Fetching the bans failed
Returns
AsyncIterator[BanEntry]
Yields all of the ban entries
Fetches the chatroom’s banned words
Raises
NotFound
Streamer Not Found
HTTPException
Fetching the words failed
Returns
list[str]
A list of the banned words
Fetches the chatroom’s rules
Raises
NotFound
Streamer Not Found
HTTPException
Fetching the rules failed
Returns
str
The rules
Gets a poll from the chatroom
Raises
NotFound
There is no poll in the current chatroom or Streamer Not Found
HTTPException
Fetching the poll failed
Returns
Poll
The poll
Fetches the emotes from the current chatroom.
Parameters
include_global: bool = False
Whether to include global emotes or not
Raises
NotFound
Streamer Not Found
HTTPException
Fetching the bans failed
Returns
AsyncIterator[Emote]
Yields each emote. Starting with from the chatroom, then global
A dataclass which represents a ban entry on kick.
This includes timeouts.
Attributes
reason: str
The reason for the ban/timeout
is_permanent: bool
Whether the ban is permanent. True == ban, false == timeout
user: PartialUser
The user the action was towards
banned_by: PartialUser
The responsible mod
expires_at: datetime.datetime | None
when the timeout expires at. None for a ban
banned_at: datetime.datetime
When the action happened
chatroom: Chatroom
The chatroom the action happened in
Unbans the chatter from the chatroom.
Raises
NotFound
Streamer or chatter not found
HTTPException
Unbanning the chatter failed
Forbidden
You are unauthorized from unbanning the chatter
A dataclass which represents a User on kick
Attributes
id: int
The user’s id
channel_id: int
The user’s channel id
username: str
The user’s name
state: str
The state the user has said they live in
socials: Socials
The socials the user has said they have
country: str
The country the user has said they live in
playback_url: str
The user’s playback url
slug: str
The user’s slug
vod_enabled: bool
If the user has vods enabled
is_banned: bool
If the user is banned
subscription_enabled: bool
If the user has subscriptions enabled
follower_count: int
The amount of followers the user has
subscriber_badges: list[SubscriberBadge
]
A list of subscriber badges the user has
online_banner: Asset
| None
the banner that gets displayed when the user is live
offline_banner: Asset
| None
the banner that gets displayed when the user is offline
is_muted: bool
If the user is muted
is_verified: bool
If the user is verified
avatar: Asset
The user’s avatar
can_host: bool
If the user can host
bio: str
The user’s bio
agreed_to_terms: bool
if the user has agreed to kick’s TOS
email_verified_at: datetime.datetime
When the user verified their user
livestream: Livestream
| None
The user’s livestream
chatroom: Chatroom
The user’s chatroom
recent_categories: list[Category
]
The categories the user has recently gone live in
[[User.fetch_videos]]
[[User.fetch_gift_leaderboard]]
Watches a user to see if they go online.
Stops watching the user
This dataclass represents a partial user on kick
Attributes
id: int
The user’s id
username: str
The user’s name
A dataclass which respresents a chatter on kick
Attributes
chatroom: Chatroom
The chatroom the chatter is in
id: int
The chatter’s id
username: str
The chatter’s username
slug: str
The chatter’ slug
avatar: Asset
| None
The chatter’s avatar, if any
is_staff: bool
If the chatter is a staff member in the chatroom
is_owner: bool
If the chatter is the chatroom owner
is_mod: bool
If the chatter is a mod in the chatroom
badges: list[ChatBadge
]
The chat badges the chatter has
following_since: datetime.datetime | None
when the chatter started following the streamer
Permanently bans a user from a chatroom.
Parameters
reason: str
The reason for the ban
Raises
HTTPException
Banning the user failed
Forbidden
You are unauthorized from banning the user
NotFound
Streamer or user not found
Unbans the chatter from the chatroom
Raises
HTTPException
Unbanning the user failed
Forbidden
You are unauthorized from unbanning the user
NotFound
Streamer or user not found
Times out a user for a given amount of time.
Parameters
duration: int
The amount of seconds for the timeout to be
reason: str
The reason for the timeout
Raises
HTTPException
timing out the user failed
Forbidden
You are unauthorized from timing out the user
NotFound
Streamer or user not found
untimeout’s the chatter
Raises
HTTPException
untimeouting the user failed
Forbidden
You are unauthorized from untimeouting the user
NotFound
Streamer or user not found
This represents a partial user.
Attributes
streamer_name: str
The streamer’s name
username: str
The chatter’s username
Fetches a user object for the chatter
Raises
HTTPException
Fetching the user failed
NotFound
User not found
Returns
User
The user
Permanently bans a user from a chatroom.
Parameters
reason: str
The reason for the ban
Raises
HTTPException
Banning the user failed
Forbidden
You are unauthorized from banning the user
NotFound
Streamer or user not found
Unbans the chatter from the chatroom
Raises
HTTPException
Unbanning the user failed
Forbidden
You are unauthorized from unbanning the user
NotFound
Streamer or user not found
Times out a user for a given amount of time.
Parameters
duration: int
The amount of seconds for the timeout to be
reason: str
The reason for the timeout
Raises
HTTPException
timing out the user failed
Forbidden
You are unauthorized from timing out the user
NotFound
Streamer or user not found
untimeout’s the chatter
Raises
HTTPException
untimeouting the user failed
Forbidden
You are unauthorized from untimeouting the user
NotFound
Streamer or user not found
Represents the author of a message on kick
Attributes
id: int
The author’s id
slug: str
The author’s slug
username: str
The author’s username
color: str
The authors… color?
badges: list
Unknown
Fetches a user object for the author
Raises
HTTPException
Fetching the user failed
NotFound
User Not Found
Returns
User
The user
Represents a message sent on kick
Attributes
id: str
the message’s id
is_reply: bool
If the message is replying to any message
references: PartialMessage
| None
If the message is replying to a message, a PartialMessage
object is returned. Otherwise None
chatroom_id: int
The id of the chatroom the message was sent in
chatroom: Chatroom
| None
The chatroom the message was sent in.
content: str
The message’s content
created_at: datetime.datetime
When the message was sent
author: Author
The message’s author
This represents a partial message. Mainly used as the message someone is replying too.
Attributes
id: str
The message’s id
content: str
The message’s content
author: PartialUser
The message’s author
A dataclass which represents an emote on kick.
Attributes
id: int
The emote’s id
is_global: bool
If the emote is a global emote, or from a channel
channel_id: int | None
returns the channel_id the emote is from, or None if global
name: str
The emote’s name
subscribers_only: bool
If you have to be a subscriber of the channel to use it. False for global emotes
source: Asset
An asset which contains the emote’s source.
An enum containing possble chatroom chat mode values.
Attributes
public: ChatroomChatMode
The public value
privet: ChatroomChatMode
The privet value
This dataclass represents a gift leaderboard entry.
Attributes
user_id: int
The id of the user with this entry
quantity: int
The amount of subs this person has gifted
username: str
The user’s username
This is a dataclass which reprsents the gift leaderboard for a kick streamer.
Attributes
streamer: User
The streamer that the leaderboard is for
this_week: list[GiftLeaderboardEntry
]
The gift leaderboard for the current week
this_month: list[GiftLeaderboardEntry
]
The gift leaderboard for the current month
all_time: list[GiftLeaderboardEntry
]
The gift leaderboard for all time
A dataclass which represents a partial livestream on kick.
Attributes
id: int
The livestream’s id
channel_id: int
The livestream’s channel id
title: str
The livestream’s title
created_at: datetime.datetime
When the livestream started
streamer: User
| None
The livestream’s streaner
A dataclass which represents a livestream on kick.
Attributes
id: int
probably the livestream’s id
slug: str
The streamer’s slug
username: str
The streamer’s username
channel_id: int
probably the streamer’s id or the chatroom id
created_at: datetime.datetime
When the livestream started
title: str
The livestream’s title
is_live: bool
If the livestream is currently live
thumbnail: Asset
| None
Returns the livestream’s thumbnail if it has one
duration: int
Probably how long the livestream is/was in seconds
language: str
The language the livestream is in
is_mature: bool
If the livestream is marked as 18+
viewer_count: int
The amount of people currently watching
tags: list[str]
Tags applied to the livestream
url: str
The livestream’s url
embed_url: str
The livestream’s player/embed url
categories: list[Category
]
The categories the livestream is in
This dataclass represents a chatroom Poll
’s option on kick.
Attributes
chatroom: Chatroom
The chatroom the poll is in
id: int
The option’s id
label: str
The option’s label
votes: int
The amount of votes the option has
Votes for this option in the poll
Raises
NotFound
There is no poll in the current chatroom
HTTPException
Deleting the poll failed
This dataclass represents a poll in a chatroom on kick.
Attributes
chatroom: Chatroom
The chatroom the poll is in
title: str
The poll’s title
options: list[PollOption
]
The poll’s options
duration: int
How long the poll will last in seconds
result_display_duration: int
How long the poll will display the results in seconds
has_voted: bool
if you’ve voted yet
ends_at: datetime.datetime
When the poll ends at
Deletes the current poll from the chatroom
Raises
Forbidden
You are unauthorized to delete the poll
NotFound
There is no poll in the current chatroom
HTTPException
Deleting the poll failed
This dataclass represents a video on kick
Attributes
id: int
The video’s id
slug: str
the video’s slug
channel_id: int
Probably the id of the channel the video is from
created_at: datetime.datetime
When the video was created
updated_at: datetime.datetime
When the video was last updated
title: str
The video’s title
live_stream_id: int
The id of the live stream the video is from
thumbnail: Asset
| None
The video’s thumbnail
duration: int
How long the video is in seconds
language: str
The language the video is in
is_mature: bool
If the video is marked as 18+
viewer_count: int
How many people have seen the video
categories: list[Category
]
The categories the video is in
The socials a user on kick has added to their profile
Attributes
instagram: str
Their instagram
youtube: str
Their youtube
twitter: str
Their twitter
discord: str
Their discord
tiktok: str
Their tiktok
facebook: str
Their facebook
This error is used when there is an error with the bypass script.
This error is used when there is an error with kick.
This error is used when there is an error with logging in.
This error is used when an error is ran into when making a request to kick.
Attributes
status_code: int
The HTTP code
This error is used when kick returns a 403 status code.
Attributes
status_code: int = 403
The HTTP code
This error is used when kick returns a 404 status code.
Attributes
status_code: int = 404
The HTTP code
This error is used when kick returns a a 500 status code, or doesn’t connect.
Attributes
status_code: int = 500
The HTTP code