app

package
v0.0.0-...-6f2d7bc Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Attach

type Attach map[string]interface{}

type BytesUploader

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

func NewBytesUploader

func NewBytesUploader(name string, b []byte) *BytesUploader

func (*BytesUploader) Name

func (b *BytesUploader) Name() string

func (*BytesUploader) Reader

func (b *BytesUploader) Reader() (io.Reader, error)

func (*BytesUploader) Size

func (b *BytesUploader) Size() int64

type Handler

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

func NewHandler

func NewHandler(bot *telegram.Bot, logic *Logic, cfg *conf.Struct) *Handler

func (*Handler) Handle

func (h *Handler) Handle(upd *telegram.Update)

type Logic

type Logic struct{}

func NewLogic

func NewLogic() *Logic

type Profile

type Profile struct {
	Type       string `json:"type"`
	ID         int    `json:"id"`
	FirstName  string `json:"first_name"`
	LastName   string `json:"last_name"`
	Sex        int    `json:"sex"`
	ScreenName string `json:"screen_name"`
	Photo50    string `json:"photo_50"`
	Photo100   string `json:"photo_100"`
	Online     int    `json:"online"`
}

type Sender

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

func NewSender

func NewSender(bot *telegram.Bot, chatID string) *Sender

func (*Sender) Pin

func (s *Sender) Pin(msg *telegram.Message) error

func (*Sender) Send

func (s *Sender) Send(text string) (*telegram.Message, error)

Send sends message to the channel

func (*Sender) SendPhoto

func (s *Sender) SendPhoto(name string, b []byte) error

type TopicItem

type TopicItem struct {
	ID          int
	FromID      int       `json:"from_id"` // user id
	Date        int       // unix time
	Time        time.Time `json:"-"`
	Text        string
	Attachments []Attach

	AwesomeText string `json:"-"`
}

type TopicResponse

type TopicResponse struct {
	Count    int
	Items    []TopicItem
	Profiles []Profile
}

type VkClient

type VkClient struct {
	*vk.Client
}

func NewVkClient

func NewVkClient(cli *vk.Client) VkClient

func (VkClient) ReadTopic

func (v VkClient) ReadTopic(req vk.RequestParams) (TopicResponse, error)

type Watcher

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

func NewWatcher

func NewWatcher(cli VkClient, groupID, topicID string, sender *Sender, dur time.Duration, start *int, messagePin bool) *Watcher

func (*Watcher) Start

func (w *Watcher) Start()

Jump to

Keyboard shortcuts

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