bot

package
v0.0.0-...-03f39fd Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2020 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bot

type Bot struct {
	YouTubeApiKey    string
	DiscordApiKey    string
	DiscordChannelId string
	YouTubeChannels  []string
	DeltaMinutes     int
}

func NewBot

func NewBot() *Bot

func (*Bot) Run

func (b *Bot) Run()

type ChannelItem

type ChannelItem struct {
	Id string `json:"id"`
}

type DiscordClient

type DiscordClient struct {
	// contains filtered or unexported fields
}

func NewDiscordClient

func NewDiscordClient(token, channelId string) (*DiscordClient, error)

func (*DiscordClient) PostVideo

func (dc *DiscordClient) PostVideo(v Postable) error

func (*DiscordClient) PostVideos

func (dc *DiscordClient) PostVideos(vs []Postable) error

type Item

type Item struct {
	ItemId  ItemId  `json:"id"`
	Snippet Snippet `json:"snippet"`
}

func (Item) Id

func (i Item) Id() string

func (Item) Title

func (i Item) Title() string

type ItemId

type ItemId struct {
	VideoId string `json:"videoId"`
}

type Postable

type Postable interface {
	Title() string
	Id() string
}

type Snippet

type Snippet struct {
	Title       string `json:"title"`
	PublishedAt string `json:"publishedAt"`
}

type YouTubeChannelResponse

type YouTubeChannelResponse struct {
	Items []ChannelItem `json:"items"`
}

type YouTubeClient

type YouTubeClient struct {
	// contains filtered or unexported fields
}

func NewYouTubeClient

func NewYouTubeClient(apiKey string) (*YouTubeClient, error)

func (*YouTubeClient) ListRecentVideosForUsernames

func (c *YouTubeClient) ListRecentVideosForUsernames(usernames []string, delta time.Duration) ([]Item, error)

type YouTubeSearchResponse

type YouTubeSearchResponse struct {
	Items []Item `json:"items"`
}

Jump to

Keyboard shortcuts

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