chaturbate

package module
v0.0.0-...-e215eeb Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 22, 2019 License: MIT Imports: 16 Imported by: 0

README

Chaturbate

GoDoc

Non-official Chaturbate API UNDER DEVELOPMENT

Chat

You can connect to room chat by using NewChat method.

Example :

chat, err := chaturbate.NewChat(context.Background(), "ROOM_NAME", option.WithoutAuthentication())

if err != nil {
    log.Fatal(err)
}

chat.OnMessage = func(author, message string) {
    fmt.Printf("[>] %s: %s\n", author, message)
}

chat.OnTip = func(author string, amount int) {
    fmt.Printf("[!] %s tipped %d\n", author, amount)
}

chat.OnNotice = func(notices []string) {
    for _, notice := range notices {
        fmt.Printf("[*] %s\n", notice)
    }
}

Available callbacks :

  • OnMessage func(author, message string)
  • OnTip func(author string, amount int)
  • OnNotice func(notices []string)
  • OnUserEntry func(user string)
  • OnUserLeave func(user string)
  • OnMute func()

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Chat

type Chat struct {
	OnMessage   func(author, message string)
	OnTip       func(author string, amount int)
	OnNotice    func(notices []string)
	OnUserEntry func(user string)
	OnUserLeave func(user string)
	OnMute      func()
	// contains filtered or unexported fields
}

func NewChat

func NewChat(ctx context.Context, room string, opts ...option.ClientOption) (*Chat, error)

func (*Chat) Close

func (c *Chat) Close() error

func (*Chat) Connect

func (c *Chat) Connect() error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL