TopHat

package
v0.0.0-...-3b0fe13 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2022 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CleanBlanks

func CleanBlanks(text string) string

func CleanText

func CleanText(text string) string

Types

type Author

type Author struct {
	Name    string `json:"name"`
	IconUrl string `json:"icon_url"`
}

type Embeds

type Embeds struct {
	Title     string    `json:"title"`
	URL       string    `json:"url"`
	Color     int       `json:"color"`
	Timestamp string    `json:"timestamp"`
	Thumbnail Thumbnail `json:"thumbnail"`
	Image     Image     `json:"image"`
	Fields    []Fields  `json:"fields"`
	Author    Author    `json:"author"`
	Footer    Footer    `json:"footer"`
}

type Fields

type Fields struct {
	Name   string `json:"name"`
	Value  string `json:"value"`
	Inline bool   `json:"inline"`
}
type Footer struct {
	Text    string `json:"text"`
	IconURL string `json:"icon_url"`
}

type Image

type Image struct {
	URL string `json:"url"`
}

type SettingsInfo

type SettingsInfo struct {
	SessionID string `json:"sessionID"`
}

type Thumbnail

type Thumbnail struct {
	URL string `json:"url"`
}

type TopHatInfo

type TopHatInfo struct {
	Webhook    string
	CourseID   int
	PublicCode string
	Omit       map[interface{}]struct{}
	Client     *http.Client
	Now        time.Time
}

func (*TopHatInfo) GrabClasses

func (th *TopHatInfo) GrabClasses() (string, error)

func (*TopHatInfo) Login

func (th *TopHatInfo) Login() error

func (*TopHatInfo) Monitor

func (th *TopHatInfo) Monitor() error

func (*TopHatInfo) SendWebhook

func (th *TopHatInfo) SendWebhook(title, t string, items map[string]string, image string) error

type Webhook

type Webhook struct {
	Username  string   `json:"username"`
	AvatarURL string   `json:"avatar_url"`
	Embeds    []Embeds `json:"embeds"`
}

Jump to

Keyboard shortcuts

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