frost.client.events package

Submodules

frost.client.events.cogs module

class frost.client.events.cogs.Auth

Bases: frost.ext.cog.Cog

Deals with user authentication. route='authentication'

post_login() → None

Deals with the response received from the server after a login attempt.

Parameters

data (Dict[str, Any]) – Data received from the server

post_register() → None

Deals with the response received from the server after a registration attempt.

Parameters

data (Dict[str, Any]) – Data received from the server

route = 'authentication'
class frost.client.events.cogs.Msgs

Bases: frost.ext.cog.Cog

Deals with user messages. route='messages'

new() → None

Deals with new user messages and stores them in frost.client.events.events.Messages.

Parameters

data (Dict[str, Any]) – Data received from the server

post_new() → None

Stores the response status of a send message attempt.

Parameters

data (Dict[str, Any]) – Data received from the server

post_room() → None

Deals with the post response from requesting all messages in a specific room. Messages are stored in frost.client.events.events.Messages.

Parameters

data (Dict[str, Any]) – Data received from the server

route = 'messages'
class frost.client.events.cogs.Rooms

Bases: frost.ext.cog.Cog

Deals with room within a server. route='rooms'

new_room_member() → None

Adds a member to a specific room when they join.

Parameters

data (Dict[str, Any]) – Data received from the server

post_all_joined() → None

Deals with the post response from a request for all joined rooms.

Parameters

data (Dict[str, Any]) – Data received from the server

post_create() → None

Deals with the post response from a room creation request.

Parameters

data (Dict[str, Any]) – Data received from the server

post_invite_code() → None

Deals with the post response from a room invite code request.

Parameters

data (Dict[str, Any]) – Data received from the server

post_join() → None

Deals with the post response from a join room request.

Parameters

data (Dict[str, Any]) – Data received from the server

post_leave() → None

Deals with the post response from a leave room request.

Parameters

data (Dict[str, Any]) – Data received from the server

post_members() → None

Deals with the post response from a request for all members in a room.

Parameters

data (Dict[str, Any]) – Data received from the server

remove_room_member() → None

Removes a member from a specific room when they leave.

Parameters

data (Dict[str, Any]) – Data received from the server

route = 'rooms'

frost.client.events.events module

class frost.client.events.events.EventStatus

Bases: object

Stores the current status of all events.

create_room = None
get_invite_code = None
get_joined_rooms = None
get_room_members = None
get_room_msgs = None
classmethod get_status(item: str) → Optional[int]

Returns the current status of the specified item and resets it to None after.

Returns

The current event status

Return type

Optional[int]

join_room = None
leave_room = None
login = None
register = None
send_msg = None
class frost.client.events.events.Messages

Bases: object

All messages will be stored in this class.

classmethod add_new_msgs(msgs: Dict[int, Dict[str, Dict[str, Union[str, Dict[str, str]]]]]) → None

Save new messages, grouped by room.

Parameters

msgs (Dict[int, Dict[str, Dict[str, Union[str, Dict[str, str]]]]]) – The messages to save

all = {}

All messages stored.

classmethod clear() → None

Clears cls.all and cls.__new.

classmethod get_new_msgs() → Dict[int, Dict[str, Dict[str, Union[str, Dict[str, str]]]]]

Returns new, unread messages.

Returns

The new messages

Return type

Dict[int, Dict[str, Dict[str, Union[str, Dict[str, str]]]]]

Module contents

class frost.client.events.Auth

Bases: frost.ext.cog.Cog

Deals with user authentication. route='authentication'

post_login() → None

Deals with the response received from the server after a login attempt.

Parameters

data (Dict[str, Any]) – Data received from the server

post_register() → None

Deals with the response received from the server after a registration attempt.

Parameters

data (Dict[str, Any]) – Data received from the server

route = 'authentication'
class frost.client.events.Msgs

Bases: frost.ext.cog.Cog

Deals with user messages. route='messages'

new() → None

Deals with new user messages and stores them in frost.client.events.events.Messages.

Parameters

data (Dict[str, Any]) – Data received from the server

post_new() → None

Stores the response status of a send message attempt.

Parameters

data (Dict[str, Any]) – Data received from the server

post_room() → None

Deals with the post response from requesting all messages in a specific room. Messages are stored in frost.client.events.events.Messages.

Parameters

data (Dict[str, Any]) – Data received from the server

route = 'messages'
class frost.client.events.Rooms

Bases: frost.ext.cog.Cog

Deals with room within a server. route='rooms'

new_room_member() → None

Adds a member to a specific room when they join.

Parameters

data (Dict[str, Any]) – Data received from the server

post_all_joined() → None

Deals with the post response from a request for all joined rooms.

Parameters

data (Dict[str, Any]) – Data received from the server

post_create() → None

Deals with the post response from a room creation request.

Parameters

data (Dict[str, Any]) – Data received from the server

post_invite_code() → None

Deals with the post response from a room invite code request.

Parameters

data (Dict[str, Any]) – Data received from the server

post_join() → None

Deals with the post response from a join room request.

Parameters

data (Dict[str, Any]) – Data received from the server

post_leave() → None

Deals with the post response from a leave room request.

Parameters

data (Dict[str, Any]) – Data received from the server

post_members() → None

Deals with the post response from a request for all members in a room.

Parameters

data (Dict[str, Any]) – Data received from the server

remove_room_member() → None

Removes a member from a specific room when they leave.

Parameters

data (Dict[str, Any]) – Data received from the server

route = 'rooms'
class frost.client.events.Messages

Bases: object

All messages will be stored in this class.

classmethod add_new_msgs(msgs: Dict[int, Dict[str, Dict[str, Union[str, Dict[str, str]]]]]) → None

Save new messages, grouped by room.

Parameters

msgs (Dict[int, Dict[str, Dict[str, Union[str, Dict[str, str]]]]]) – The messages to save

all = {}

All messages stored.

classmethod clear() → None

Clears cls.all and cls.__new.

classmethod get_new_msgs() → Dict[int, Dict[str, Dict[str, Union[str, Dict[str, str]]]]]

Returns new, unread messages.

Returns

The new messages

Return type

Dict[int, Dict[str, Dict[str, Union[str, Dict[str, str]]]]]

class frost.client.events.EventStatus

Bases: object

Stores the current status of all events.

create_room = None
get_invite_code = None
get_joined_rooms = None
get_room_members = None
get_room_msgs = None
classmethod get_status(item: str) → Optional[int]

Returns the current status of the specified item and resets it to None after.

Returns

The current event status

Return type

Optional[int]

join_room = None
leave_room = None
login = None
register = None
send_msg = None