Documentation ¶
Index ¶
- Constants
- Variables
- func GetAccountCharacters(account, ticket string) ([]string, error)
- func GetTicket(account, password string) (string, error)
- func SortChannelsByTitle(channels []Channel)
- type CIU
- type Channel
- type CharacterData
- type Client
- func (c *Client) Close() error
- func (c *Client) Disconnect() error
- func (c *Client) Identify(account, password, character string) error
- func (c *Client) NewIDN(account, ticket, character string) *IDN
- func (c *Client) ReadMessage() ([]byte, error)
- func (c *Client) SendCmd(cmd CmdEncoder) error
- func (c *Client) SendMSG(msg *MSG) error
- func (c *Client) SendORS() error
- func (c *Client) SendPRI(pri *PRI) error
- func (c *Client) SetChatMax(max int)
- func (c *Client) SetPrivMax(max int)
- type CmdDecoder
- type CmdEncoder
- type Command
- type CustomKink
- type CustomKinks
- type ERR
- type ErrorResponse
- type FLN
- type ICH
- type IDN
- type Infotags
- type JCH
- type Kinks
- type LCH
- type LIS
- type MSG
- type MappingList
- type NLN
- type ORS
- type PIN
- type PRD
- type PRDType
- type PRI
- type PRO
- type RawMessage
- type Role
- type STA
- type Status
- type VAR
Constants ¶
const ( PRDStart PRDType = "start" PRDEnd = "end" PRDInfo = "info" PRDSelect = "select" )
const ( RoleFullDom = "Always dominant" RoleSomeDom = "Usually dominant" RoleSwitch = "Switch" RoleSomeSub = "Usually submissive" RoleFullSub = "Always submissive" )
const ( StatusOnline = "online" StatusLooking = "looking" StatusBusy = "busy" StatusDND = "dnd" StatusIdle = "idle" StatusAway = "away" )
Variables ¶
var ( // ErrMsgTooLong is returned if there is an attempt to send a message // through MSG or PRI that exceeds the server's variables (chat_max and // priv_max respectively). The message is never send to the server. If the // message was sent, the server would reply with an ERR. ErrMsgTooLong = errors.New("message too long") )
var ErrUnknownCmd = errors.New("unknown command")
Functions ¶
func GetAccountCharacters ¶ added in v1.3.0
func SortChannelsByTitle ¶ added in v1.1.0
func SortChannelsByTitle(channels []Channel)
Types ¶
type CIU ¶ added in v1.5.0
type CIU struct { Sender string `json:"sender"` Title string `json:"title"` Name string `json:"name"` }
CIU is a server command.
Invites a user to a channel.
Syntax
>> CIU { "sender":string,"title":string,"name":string }
type Channel ¶
type Channel struct { Name string `json:"name"` Title string `json:"title"` Characters int `json:"characters"` }
func FindChannel ¶ added in v1.1.0
type CharacterData ¶ added in v1.1.1
type CharacterData struct { ID int64 `json:"id"` Name string `json:"name"` Description string `json:"description"` Views int `json:"views"` CustomsFirst bool `json:"customs_first"` CustomTitle string `json:"custom_title"` CreatedAt int64 `json:"created_at"` UpdatedAt int64 `json:"updated_at"` Kinks Kinks `json:"kinks"` CustomKinks CustomKinks `json:"custom_kinks"` }
func GetCharacterData ¶ added in v1.1.1
func GetCharacterData(name, account, ticket string) (*CharacterData, error)
func (CharacterData) HasFaveCustomKink ¶ added in v1.3.1
func (d CharacterData) HasFaveCustomKink(kinks ...string) bool
func (CharacterData) HasFaveKink ¶ added in v1.3.1
func (d CharacterData) HasFaveKink(kinksMap map[string]string, kink string) bool
func (CharacterData) HumanInfotags ¶ added in v1.3.0
func (d CharacterData) HumanInfotags(ml *MappingList) map[string]string
func (CharacterData) HumanKinks ¶ added in v1.3.1
func (d CharacterData) HumanKinks(kinks map[string]string) map[string]string
type Client ¶
func (*Client) Disconnect ¶
func (*Client) ReadMessage ¶
func (*Client) SendCmd ¶ added in v1.5.1
func (c *Client) SendCmd(cmd CmdEncoder) error
func (*Client) SetChatMax ¶ added in v1.3.0
func (*Client) SetPrivMax ¶ added in v1.3.0
type CmdDecoder ¶
type CmdEncoder ¶
type CustomKink ¶ added in v1.3.1
type CustomKinks ¶ added in v1.3.1
type CustomKinks []*CustomKink
func (CustomKinks) MarshalJSON ¶ added in v1.3.1
func (kn CustomKinks) MarshalJSON() ([]byte, error)
func (*CustomKinks) UnmarshalJSON ¶ added in v1.3.1
func (kn *CustomKinks) UnmarshalJSON(data []byte) error
type ERR ¶ added in v1.3.0
ERR is a server command.
Indicates that the given error has occurred.
Syntax
>> ERR { "number": int, "message": string }
Raw sample
ERR {"message": "You have already joined this channel.", "number": 28}
type ErrorResponse ¶ added in v1.3.0
func (ErrorResponse) Body ¶ added in v1.3.0
func (e ErrorResponse) Body() []byte
func (ErrorResponse) Error ¶ added in v1.3.0
func (e ErrorResponse) Error() string
type FLN ¶ added in v1.3.0
type FLN struct {
Character string `json:"character"`
}
FLN is a server command.
Sent by the server to inform the client a given character went offline.
Syntax
>> FLN { "character": string }
Raw sample
FLN {"character":"Hexxy"}
Notes/Warnings
Should be treated as a global LCH for this character.
type ICH ¶ added in v1.3.0
type IDN ¶
type Infotags ¶ added in v1.3.0
func (Infotags) MarshalJSON ¶ added in v1.3.0
func (*Infotags) UnmarshalJSON ¶ added in v1.3.0
type JCH ¶
type JCH struct { Channel string `json:"channel"` Title string `json:"title,omitempty"` Character struct { Identity string `json:"identity"` } `json:"character,omitempty"` }
JCH is a server and client command.
Server ¶
Indicates the given user has joined the given channel. This may also be the client's character.
Syntax
>> JCH { "channel": string, "character": object, "title": string }
Raw sample
JCH {"character": {"identity": "Hexxy"}, "channel": "Frontpage", "title": "Frontpage"}
Notes/Warnings
As with all commands that refer to a specific channel, official/public channels use the name, but unofficial/private/open private rooms use the channel ID, which can be gotten from ORS.
Client ¶
Send a channel join request.
Syntax
<< JCH { "channel": string }
Raw sample
JCH {"channel": "Frontpage"}
Notes/Warnings
As with all commands that refer to a specific channel, official/public channels use the name, but unofficial/private/open private rooms use the channel ID, which can be gotten from ORS.
type Kinks ¶ added in v1.3.1
func (Kinks) MarshalJSON ¶ added in v1.3.1
func (*Kinks) UnmarshalJSON ¶ added in v1.3.1
type LCH ¶ added in v1.3.0
LCH is a server command.
An indicator that the given character has left the channel. This may also be the client's character.
Syntax
>> LCH { "channel": string, "character": character }
type LIS ¶ added in v1.3.0
type LIS struct {
Characters [][]string `json:"characters"`
}
LIS is a server command.
Sends an array of all the online characters and their gender, status, and status message.
Syntax
>> LIS { characters: [object] }
Raw sample
LIS {"characters": [["Alexandrea", "Female", "online", ""], ["Fa Mulan", "Female", "busy", "Away, check out my new alt Aya Kinjou!"], ["Adorkable Lexi", "Female", "online", ""], ["Melfice Cyrum", "Male", "online", ""], ["Jenasys Stryphe", "Female", "online", ""], ["Cassie Hazel", "Herm", "looking", ""], ["Jun Watarase", "Male", "looking", "cute femmy boi looking for a dominate partner"],["Motley Ferret", "Male", "online", ""], ["Tashi", "Male", "online", ""], ["Viol", "Cunt-boy", "looking", ""], ["Dorjan Kazyanenko", "Male", "looking", ""], ["Asaki", "Female", "online", ""]]}
Because of the large amount of data, this command is often sent out in batches of several LIS commands. Since you got a CON before LIS, you'll know when it has sent them all.
The characters object has a syntax of ["Name", "Gender", "Status", "Status Message"].
type MSG ¶
type MappingList ¶ added in v1.3.0
type MappingList struct { Kinks []struct { ID string `json:"id"` Name string `json:"name"` Description string `json:"description"` GroupID string `json:"group_id"` } `json:"kinks"` KinkGroups []struct { ID string `json:"id"` Name string `json:"name"` } `json:"kink_groups"` ID string `json:"id"` Name string `json:"name"` Type string `json:"type"` List string `json:"list"` GroupID string `json:"group_id"` } `json:"infotags"` InfotagGroups []struct { ID string `json:"id"` Name string `json:"name"` } `json:"infotag_groups"` Listitems []struct { ID string `json:"id"` Name string `json:"name"` Value string `json:"value"` } `json:"listitems"` Error string `json:"error"` }
func GetMappingList ¶ added in v1.3.0
func GetMappingList() (*MappingList, error)
func (MappingList) InfotagsMap ¶ added in v1.3.0
func (ml MappingList) InfotagsMap() map[string]string
func (MappingList) KinksMap ¶ added in v1.3.1
func (ml MappingList) KinksMap() map[string]string
func (MappingList) ListitemsMap ¶ added in v1.3.0
func (ml MappingList) ListitemsMap() map[string]string
type NLN ¶ added in v1.3.0
type NLN struct { Identity string `json:"identity"` Gender string `json:"gender"` Status Status `json:"status"` }
NLN is a server command.
A user connected.
Syntax
>> NLN { "identity": string, "gender": enum, "status": enum }
Raw sample
NLN {"status": "online", "gender": "Male", "identity": "Hexxy"}
Parameters ¶
Identity: character name of the user connecting.
Gender: a valid gender string.
Status: a valid status, though since it is when signing on, the only possibility is online.