util

package
v0.0.0-...-b6eb173 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2018 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CaseInsensitiveContains

func CaseInsensitiveContains(s, substr string) bool

func DeSerializeFromFile

func DeSerializeFromFile(path string, object interface{}) error

Decode Gob file

func DecodeJson

func DecodeJson(url string, f func(io.ReadCloser) bool) (bool, error)

func MatchAnyURL

func MatchAnyURL(s string) bool

Various match functions. Does what they say on the tin

func MatchGitCommit

func MatchGitCommit(s string) bool

func RandomFromArray

func RandomFromArray(array []string) string

func SaveImage

func SaveImage(url string) (string, error)

func SendPhoto

func SendPhoto(url string, message telebot.Message, bot *telebot.Bot) error

func SerializeToFile

func SerializeToFile(path string, object interface{}) error

Encode via Gob to file

func StripPluginCommand

func StripPluginCommand(str string, prefix string, plugin string) string

func UrlExt

func UrlExt(url string) string

Types

type Config

type Config struct {
	Token          string
	CommandPrefix  string
	RedditUser     string
	RedditPassword string
	BrainFile      string
	Administrators map[string]bool
}

Configuration needed for plugins and bot

func LoadConfig

func LoadConfig(f string) (Config, error)

func (*Config) IsAdmin

func (c *Config) IsAdmin(user string) bool

Jump to

Keyboard shortcuts

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