support

package
v0.0.0-...-c30703a Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Config configT

Config is a config interface.

View Source
var ConfigPath = "./config.json"
View Source
var FactoCordVersion string
View Source
var Factorio factorioState
View Source
var GuildID string
View Source
var ModFileRegexp = regexp.MustCompile("([A-Za-z0-9_\\- ]+)_(\\d+\\.\\d+\\.\\d+)(\\.zip)?")
View Source
var MyLastMessage bool

Functions

func AnyTwo

func AnyTwo(o []interface{}, f func(interface{}, interface{}) bool) bool

func ChunkedMessageSend

func ChunkedMessageSend(s *discordgo.Session, message string)

func CompareOp

func CompareOp(cmp int, op string) bool

func Critical

func Critical(err error, message string)

Critical checks error != nil, logs the error and closes the app

func DeleteEmptyStrings

func DeleteEmptyStrings(s []string) []string

func DirExists

func DirExists(filename string) bool

DirExists checks if a directory exists and is not a file

func DownloadProgressUpdater

func DownloadProgressUpdater(s *discordgo.Session, p *ProgressUpdate)

func Exit

func Exit(ExitCode int)

Exit exits the application.

func FactorioVersion

func FactorioVersion() (string, error)

func FileExists

func FileExists(filename string) bool

FileExists checks if a file exists and is not a directory

func FormatNamed

func FormatNamed(format, name, value string) string

func FormatUsage

func FormatUsage(s string) string

func IsUnique

func IsUnique(s []string) bool

func Panik

func Panik(err error, message string)

Panik checks error != nil and logs the error without exiting the app P.S. it's a meme

func PluralS

func PluralS(x int) string

func QuoteSpace

func QuoteSpace(s string) string

func QuoteSplit

func QuoteSplit(s string, quote string) ([]string, bool)

func SendTo

func SendTo(s *discordgo.Session, message string, channelID string)

func SetTyping

func SetTyping(s *discordgo.Session)

func SplitAfter

func SplitAfter(s, sub string) (string, string)

func SplitAt

func SplitAt(s string, index int) (string, string)

func SplitBefore

func SplitBefore(s, sub string) (string, string)

func SplitDivide

func SplitDivide(s, sub string) (string, string)

func Unique

func Unique(strs []string) []string

func UniqueFunc

func UniqueFunc(objs []interface{}, f func(interface{}, interface{}) bool) []interface{}

Types

type CommandDoc

type CommandDoc struct {
	Name        string
	Usage       string
	Doc         string
	Subcommands []CommandDoc
}

type FactorioLogWatcher

type FactorioLogWatcher struct {
	ProcessFunc func(string)
	// contains filtered or unexported fields
}

func (FactorioLogWatcher) Flush

func (t FactorioLogWatcher) Flush()

func (FactorioLogWatcher) Write

func (t FactorioLogWatcher) Write(p []byte) (n int, err error)

type MessageControlT

type MessageControlT struct {
	*discordgo.Message
	TimeSent time.Time
	Metadata string
}
var LastMessage *MessageControlT

func MessageControl

func MessageControl(m *discordgo.Message) *MessageControlT

func Send

func Send(s *discordgo.Session, message string) *MessageControlT

func SendComplex

func SendComplex(s *discordgo.Session, message *discordgo.MessageSend) *MessageControlT

func SendFormat

func SendFormat(s *discordgo.Session, message string) *MessageControlT

func SendMessage

func SendMessage(s *discordgo.Session, message string) *MessageControlT

func SendOptional

func SendOptional(s *discordgo.Session, message string) *MessageControlT

func (*MessageControlT) Delete

func (m *MessageControlT) Delete(s *discordgo.Session)

func (*MessageControlT) DeleteIfPassedLess

func (m *MessageControlT) DeleteIfPassedLess(s *discordgo.Session, t time.Duration)

func (*MessageControlT) Edit

type ProgressUpdate

type ProgressUpdate struct {
	*WriteCounter
	Message                   *MessageControlT
	Start, Progress, Finished string
}

type SemanticVersionT

type SemanticVersionT struct {
	Full  string
	Split []uint
}

func SemanticVersion

func SemanticVersion(s string) (*SemanticVersionT, *error)

func SemanticVersionPanic

func SemanticVersionPanic(s string) *SemanticVersionT

func (*SemanticVersionT) Compare

func (v *SemanticVersionT) Compare(v2 *SemanticVersionT) int

func (*SemanticVersionT) Equal

func (v *SemanticVersionT) Equal(v2 *SemanticVersionT) bool

func (*SemanticVersionT) NewerThan

func (v *SemanticVersionT) NewerThan(v2 *SemanticVersionT) bool

type TextListT

type TextListT struct {
	Heading     string
	List        []string
	Indentation string
	None        string
	Error       string
}

func DefaultTextList

func DefaultTextList(heading string) TextListT

func (*TextListT) AddToLast

func (l *TextListT) AddToLast(s string)

func (*TextListT) Append

func (l *TextListT) Append(s string)

func (*TextListT) FormatHeaderWithLength

func (l *TextListT) FormatHeaderWithLength()

func (*TextListT) IsEmpty

func (l *TextListT) IsEmpty() bool

func (*TextListT) Len

func (l *TextListT) Len() int

func (*TextListT) NotEmpty

func (l *TextListT) NotEmpty() bool

func (*TextListT) Render

func (l *TextListT) Render() string

func (*TextListT) RenderNotEmpty

func (l *TextListT) RenderNotEmpty() string

func (*TextListT) RenderWithoutHeading

func (l *TextListT) RenderWithoutHeading() string

type WriteCounter

type WriteCounter struct {
	Total       uint64
	Transferred uint64
	Error       bool
}

func (*WriteCounter) Percent

func (wc *WriteCounter) Percent() float32

func (*WriteCounter) Write

func (wc *WriteCounter) Write(p []byte) (int, error)

Jump to

Keyboard shortcuts

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