gwitch

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

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

Go to latest
Published: Apr 24, 2016 License: GPL-2.0 Imports: 6 Imported by: 1

README

Gwitch

A upcoming framework to connect yourself to Twitch chat!

Why?

This is an replacement but morely an improvement to my previous bot that was horribly coded and wasn't even in a framework. I've attempted many times to create something better but I had data loss and times where I've not been in the right mind set to create something better. Finally I was able to create this. It's simpiler, easier to maintain, and best of all: a framework.

Example of usage

Chat Data

METHOD - States if it were a JOIN/MESSAGE/etc

Username - States the referenced users name

Message - States the message received if MESSAGE was the METHOD

TODO

  • Twitch custom commands
  • Others to come

Resources

* https://github.com/justintv/Twitch-API/blob/master/IRC.md

License: GPLv2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Data

type Data struct {
	Method   string
	Username string
	Message  string
}

Data containing Method, Username, and Message

type TwitchChat

type TwitchChat struct {
	Username string
	OAuth    string
	Channel  string
	Conn     net.Conn
	RawData  string
}

TwitchChat containing Username, OAuth, Channel, Conn, and RawData necessary for connection

func New

func New(user string, oauth string, channel string, conn net.Conn) (UI *TwitchChat)

New Gwitch instance

func (*TwitchChat) Close

func (chat *TwitchChat) Close() (err error)

Close the connection

func (*TwitchChat) Connect

func (chat *TwitchChat) Connect() (err error)

Connect to the Twitch IRC servers

func (*TwitchChat) RawRead

func (chat *TwitchChat) RawRead() (data string)

RawRead reads raw data from conn from TwitchChat

func (*TwitchChat) ReadData

func (chat *TwitchChat) ReadData() (data *Data)

ReadData directly from RawData, interprets if is join, part, message, op, and de-op

func (*TwitchChat) SendMessage

func (chat *TwitchChat) SendMessage(data string) (err error)

SendMessage sends message to chat using SendRawData

func (*TwitchChat) SendRawData

func (chat *TwitchChat) SendRawData(data string) (err error)

SendRawData send raw data to the Twitch server

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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