chat

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: May 31, 2023 License: AGPL-3.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ExportTypeTime string = "time"
	ExportTypeID   string = "id"
	ExportTypeLast string = "last"
)
View Source
const (
	DialogGroup   = "group"
	DialogPrivate = "private"
	DialogChannel = "channel"
	DialogUnknown = "unknown"
)

External designation, different from Telegram mtproto

Variables

This section is empty.

Functions

func Export added in v0.5.0

func Export(ctx context.Context, opts *ExportOptions) error

func List

func List(ctx context.Context, opts ListOptions) error

Types

type Dialog added in v0.9.1

type Dialog struct {
	ID          int64   `json:"id" comment:"ID of dialog"`
	Type        string  `json:"type" comment:"Type of dialog. Can be 'user', 'channel' or 'group'"`
	VisibleName string  `json:"visible_name,omitempty" comment:"Title of channel and group, first and last name of user. If empty, output '-'"`
	Username    string  `json:"username,omitempty" comment:"Username of dialog. If empty, output '-'"`
	Topics      []Topic `json:"topics,omitempty" comment:"Topics of dialog. If not set, output '-'"`
}

type ExportOptions added in v0.7.0

type ExportOptions struct {
	Type        string
	Chat        string
	Thread      int // topic id in forum, message id in group
	Input       []int
	Output      string
	Filter      string
	OnlyMedia   bool
	WithContent bool
	Raw         bool
	All         bool
}

type ListOptions added in v0.9.0

type ListOptions struct {
	Output string
	Filter string
}

type Message added in v0.9.1

type Message struct {
	ID   int    `json:"id"`
	Type string `json:"type"`
	File string `json:"file"`
	Date int    `json:"date,omitempty"`
	Text string `json:"text,omitempty"`
}

type Output added in v0.9.0

type Output string
var (
	OutputTable Output = "table"
	OutputJSON  Output = "json"
)

type Topic added in v0.9.1

type Topic struct {
	ID    int    `json:"id" comment:"ID of topic"`
	Title string `json:"title" comment:"Title of topic"`
}

Jump to

Keyboard shortcuts

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