handler

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewTwitterClient

func NewTwitterClient(consumerKey, consumerSecret, apiKey, apiSecret string) *twitter.Client

NewTwitterClient will construct a twitter client which will be registered to TweetHandler

Types

type Handler

type Handler interface {
	// Tweet Function Interface
	Tweet(s *discordgo.Session, m *discordgo.MessageCreate) (bool, string, error)

	// Stream Function Interface
	Stream(s *discordgo.Session, m *discordgo.MessageCreate) (string, error)

	// StopStream Function Interface
	StopStream(s *discordgo.Session, m *discordgo.MessageCreate) (string, error)

	// ListStream Function Interface
	ListStream(m *discordgo.MessageCreate) (string, error)

	// Recover Function Interface
	Recover(s *discordgo.Session) error

	// OpenStreamConnection will open a streaming session to twitter
	OpenStreamConnection(s *discordgo.Session) error

	// RetrieveUser will retrieve user information from twitter
	RetrieveUser(username string) (*twitter.User, error)
}

Handler Interface

func NewTweetHandler

func NewTweetHandler(client *twitter.Client, repository repository.Repository) Handler

NewTweetHandler will construct a handler to call the Choose method

Jump to

Keyboard shortcuts

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