client

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var TelegramChatTypeMap = map[string]TelegramChatType{
	"channel": Channel,
	"group":   Group,
}

Functions

This section is empty.

Types

type Chattable

type Chattable interface {
	Value() map[string]string
	Method() string
}

type Client

type Client interface {
	Send(c Chattable) (Response, error)
	Reply(c Chattable, identifier string) (Response, error)
}

func NewTelegramClient

func NewTelegramClient(token, credential string, chatType TelegramChatType) (Client, error)

func NewTwitterClient

func NewTwitterClient(apiKey, apiKeySecret, accessToken, accessTokenSecret string) (Client, error)

type ImageUrl

type ImageUrl struct {
	ImageUrl string
}

func (ImageUrl) Method

func (i ImageUrl) Method() string

func (ImageUrl) Value

func (i ImageUrl) Value() map[string]string

type Response

type Response struct {
	Identifier string
}

type TelegramChatType

type TelegramChatType int64
const (
	Channel TelegramChatType = 0
	Group   TelegramChatType = 1
)

func ParseTelegramChatType

func ParseTelegramChatType(str string) (TelegramChatType, bool)

type TelegramClient

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

func (TelegramClient) Reply

func (client TelegramClient) Reply(c Chattable, identifier string) (Response, error)

func (TelegramClient) Send

func (t TelegramClient) Send(c Chattable) (Response, error)

type Text

type Text struct {
	Text string
}

func (Text) Method

func (t Text) Method() string

func (Text) Value

func (t Text) Value() map[string]string

type TextAndImageUrl

type TextAndImageUrl struct {
	Text     string
	ImageUrl string
}

func (TextAndImageUrl) Method

func (tiu TextAndImageUrl) Method() string

func (TextAndImageUrl) Value

func (tiu TextAndImageUrl) Value() map[string]string

type TwitterClient

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

func (TwitterClient) Reply

func (t TwitterClient) Reply(c Chattable, identifier string) (Response, error)

func (TwitterClient) Send

func (t TwitterClient) Send(c Chattable) (Response, error)

Jump to

Keyboard shortcuts

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