react

package
v0.0.0-...-84ff7b8 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2018 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package react returns a random reaction parsed from a json file, see example json file for structure

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Match

func Match(s string) bool

Match tests to see if a string matches a listed string

func Respond

func Respond(s string) (string, error)

Respond returns a random response from the first reaction to match the generated regex

Types

type Item

type Item struct {
	Text string
	Resp []string
}

Item is the match text and possible responses for a reacion

type React

type React struct {
	Items []Item
}

React contains reactions from a reactions.json file

var (
	// Reactions is the struct that the reactions.json file is parsed into
	Reactions React
)

Jump to

Keyboard shortcuts

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