Luminance

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

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

Go to latest
Published: Oct 14, 2024 License: MIT Imports: 4 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

A simple bot client

Luminance is a simple bot client for nin0's chat platform (https://guh.nin0.dev/). Check out the example in Examples/Example.go

Uses the MIT license. Go wild

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(username, key, websocket_uri string)

Types

type Bot

type Bot struct {
	Conn         *websocket.Conn
	Username     string `json:"username"`
	Key          string `json:"key"`
	WebsocketURI string `json:"websocket_uri"`
	CTX          context.Context
}

func (*Bot) Close

func (bot *Bot) Close()

func (*Bot) Initialize

func (bot *Bot) Initialize()

func (*Bot) OnMessage

func (bot *Bot) OnMessage(callback func(OnMessage))

func (*Bot) SendMessage

func (bot *Bot) SendMessage(content string)

type OnConnection

type OnConnection struct {
	OP       int      `json:"op"`
	Messages []string `json:"messages"`
}

type OnMessage

type OnMessage struct {
	Content  string `json:"content"`
	Username string `json:"username"`
}

type Package

type Package struct {
	Name    string `json:"name"`
	Author  string `json:"author"`
	Version string `json:"version"`
}

func GetPackage

func GetPackage() Package

type SendMessage

type SendMessage struct {
	Content  string `json:"content"`
	Username string `json:"username"`
	Key      string `json:"key"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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