incomingevents

package
v0.0.0-...-01babda Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DownloadFileResponse

type DownloadFileResponse struct {
	Event

	Id           int64 `json:"id"`
	Size         int64 `json:"size"`
	ExpectedSize int64 `json:"expected_size"`
	Local        struct {
		Type                   string `json:"@type"`
		Path                   string `json:"path"`
		CanBeDownloaded        bool   `json:"can_be_downloaded"`
		CanBeDeleted           bool   `json:"can_be_deleted"`
		IsDownloadingActive    bool   `json:"is_downloading_active"`
		IsDownloadingCompleted bool   `json:"is_downloading_completed"`
		DownloadOffset         int64  `json:"download_offset"`
		DownloadedPrefixSize   int64  `json:"downloaded_prefix_size"`
		DownloadedSize         int64  `json:"downloaded_size"`
	} `json:"local"`
	Remote struct {
		Type                 string `json:"@type"`
		Id                   string `json:"id"`
		UniqueId             string `json:"unique_id"`
		IsUploadingActive    bool   `json:"is_uploading_active"`
		IsUploadingCompleted bool   `json:"is_uploading_completed"`
		UploadedSize         int64  `json:"uploaded_size"`
	} `json:"remote"`
}

type ErrorEvent

type ErrorEvent struct {
	Generic

	Code    int64           `json:"code"`
	Message json.RawMessage `json:"message"`
}

func ErrorFromBytes

func ErrorFromBytes(b []byte) (ErrorEvent, error)

type Event

type Event struct {
	Generic

	Code    int64           `json:"code,omitempty"`
	Message json.RawMessage `json:"message,omitempty"`

	UpdateFile         *DownloadFileResponse        `json:"file,omitempty"`
	State              *entities.ConnectionState    `json:"state,omitempty"`
	AuthorizationState *entities.AuthorizationState `json:"authorization_state,omitempty"`

	Raw []byte `json:"-"`
}

func FromBytes

func FromBytes(b []byte) (Event, error)

type Generic

type Generic struct {
	Type      string `json:"@type"`
	RequestID string `json:"@extra,omitempty"`
}

func GenericFromBytes

func GenericFromBytes(b []byte) (Generic, error)

type GetChatHistoryResponse

type GetChatHistoryResponse struct {
	Event

	TotalCount int64              `json:"total_count"`
	Messages   []entities.Message `json:"messages"`
}

type GetChatResponse

type GetChatResponse struct {
	Event

	Id   int64 `json:"id"`
	Type struct {
		Type         string `json:"@type"`
		SupergroupId int    `json:"supergroup_id"`
		IsChannel    bool   `json:"is_channel"`
	} `json:"type"`
	Title       string `json:"title"`
	Permissions struct {
		Type                  string `json:"@type"`
		CanSendMessages       bool   `json:"can_send_messages"`
		CanSendMediaMessages  bool   `json:"can_send_media_messages"`
		CanSendPolls          bool   `json:"can_send_polls"`
		CanSendOtherMessages  bool   `json:"can_send_other_messages"`
		CanAddWebPagePreviews bool   `json:"can_add_web_page_previews"`
		CanChangeInfo         bool   `json:"can_change_info"`
		CanInviteUsers        bool   `json:"can_invite_users"`
		CanPinMessages        bool   `json:"can_pin_messages"`
		CanManageTopics       bool   `json:"can_manage_topics"`
	} `json:"permissions"`
	LastMessage struct {
		Type     string `json:"@type"`
		Id       int    `json:"id"`
		SenderId struct {
			Type   string `json:"@type"`
			UserId int64  `json:"user_id"`
		} `json:"sender_id"`
		ChatId                    int64 `json:"chat_id"`
		IsOutgoing                bool  `json:"is_outgoing"`
		IsPinned                  bool  `json:"is_pinned"`
		CanBeEdited               bool  `json:"can_be_edited"`
		CanBeForwarded            bool  `json:"can_be_forwarded"`
		CanBeSaved                bool  `json:"can_be_saved"`
		CanBeDeletedOnlyForSelf   bool  `json:"can_be_deleted_only_for_self"`
		CanBeDeletedForAllUsers   bool  `json:"can_be_deleted_for_all_users"`
		CanGetAddedReactions      bool  `json:"can_get_added_reactions"`
		CanGetStatistics          bool  `json:"can_get_statistics"`
		CanGetMessageThread       bool  `json:"can_get_message_thread"`
		CanGetViewers             bool  `json:"can_get_viewers"`
		CanGetMediaTimestampLinks bool  `json:"can_get_media_timestamp_links"`
		CanReportReactions        bool  `json:"can_report_reactions"`
		HasTimestampedMedia       bool  `json:"has_timestamped_media"`
		IsChannelPost             bool  `json:"is_channel_post"`
		IsTopicMessage            bool  `json:"is_topic_message"`
		ContainsUnreadMention     bool  `json:"contains_unread_mention"`
		Date                      int   `json:"date"`
		EditDate                  int   `json:"edit_date"`
		InteractionInfo           struct {
			Type         string `json:"@type"`
			ViewCount    int    `json:"view_count"`
			ForwardCount int    `json:"forward_count"`
			ReplyInfo    struct {
				Type                    string        `json:"@type"`
				ReplyCount              int           `json:"reply_count"`
				RecentReplierIds        []interface{} `json:"recent_replier_ids"`
				LastReadInboxMessageId  int           `json:"last_read_inbox_message_id"`
				LastReadOutboxMessageId int           `json:"last_read_outbox_message_id"`
				LastMessageId           int           `json:"last_message_id"`
			} `json:"reply_info"`
			Reactions []interface{} `json:"reactions"`
		} `json:"interaction_info"`
		UnreadReactions   []interface{} `json:"unread_reactions"`
		ReplyInChatId     int           `json:"reply_in_chat_id"`
		ReplyToMessageId  int           `json:"reply_to_message_id"`
		MessageThreadId   int           `json:"message_thread_id"`
		Ttl               int           `json:"ttl"`
		TtlExpiresIn      float64       `json:"ttl_expires_in"`
		ViaBotUserId      int           `json:"via_bot_user_id"`
		AuthorSignature   string        `json:"author_signature"`
		MediaAlbumId      string        `json:"media_album_id"`
		RestrictionReason string        `json:"restriction_reason"`
		Content           struct {
			Type  string `json:"@type"`
			Video struct {
				Type              string `json:"@type"`
				Duration          int    `json:"duration"`
				Width             int    `json:"width"`
				Height            int    `json:"height"`
				FileName          string `json:"file_name"`
				MimeType          string `json:"mime_type"`
				HasStickers       bool   `json:"has_stickers"`
				SupportsStreaming bool   `json:"supports_streaming"`
				Minithumbnail     struct {
					Type   string `json:"@type"`
					Width  int    `json:"width"`
					Height int    `json:"height"`
					Data   string `json:"data"`
				} `json:"minithumbnail"`
				Thumbnail struct {
					Type   string `json:"@type"`
					Format struct {
						Type string `json:"@type"`
					} `json:"format"`
					Width  int `json:"width"`
					Height int `json:"height"`
					File   struct {
						Type         string `json:"@type"`
						Id           int    `json:"id"`
						Size         int    `json:"size"`
						ExpectedSize int    `json:"expected_size"`
						Local        struct {
							Type                   string `json:"@type"`
							Path                   string `json:"path"`
							CanBeDownloaded        bool   `json:"can_be_downloaded"`
							CanBeDeleted           bool   `json:"can_be_deleted"`
							IsDownloadingActive    bool   `json:"is_downloading_active"`
							IsDownloadingCompleted bool   `json:"is_downloading_completed"`
							DownloadOffset         int    `json:"download_offset"`
							DownloadedPrefixSize   int    `json:"downloaded_prefix_size"`
							DownloadedSize         int    `json:"downloaded_size"`
						} `json:"local"`
						Remote struct {
							Type                 string `json:"@type"`
							Id                   string `json:"id"`
							UniqueId             string `json:"unique_id"`
							IsUploadingActive    bool   `json:"is_uploading_active"`
							IsUploadingCompleted bool   `json:"is_uploading_completed"`
							UploadedSize         int    `json:"uploaded_size"`
						} `json:"remote"`
					} `json:"file"`
				} `json:"thumbnail"`
				Video struct {
					Type         string `json:"@type"`
					Id           int    `json:"id"`
					Size         int    `json:"size"`
					ExpectedSize int    `json:"expected_size"`
					Local        struct {
						Type                   string `json:"@type"`
						Path                   string `json:"path"`
						CanBeDownloaded        bool   `json:"can_be_downloaded"`
						CanBeDeleted           bool   `json:"can_be_deleted"`
						IsDownloadingActive    bool   `json:"is_downloading_active"`
						IsDownloadingCompleted bool   `json:"is_downloading_completed"`
						DownloadOffset         int    `json:"download_offset"`
						DownloadedPrefixSize   int    `json:"downloaded_prefix_size"`
						DownloadedSize         int    `json:"downloaded_size"`
					} `json:"local"`
					Remote struct {
						Type                 string `json:"@type"`
						Id                   string `json:"id"`
						UniqueId             string `json:"unique_id"`
						IsUploadingActive    bool   `json:"is_uploading_active"`
						IsUploadingCompleted bool   `json:"is_uploading_completed"`
						UploadedSize         int    `json:"uploaded_size"`
					} `json:"remote"`
				} `json:"video"`
			} `json:"video"`
			Caption struct {
				Type     string        `json:"@type"`
				Text     string        `json:"text"`
				Entities []interface{} `json:"entities"`
			} `json:"caption"`
			IsSecret bool `json:"is_secret"`
		} `json:"content"`
	} `json:"last_message"`
	Positions                  []interface{} `json:"positions"`
	HasProtectedContent        bool          `json:"has_protected_content"`
	IsMarkedAsUnread           bool          `json:"is_marked_as_unread"`
	IsBlocked                  bool          `json:"is_blocked"`
	HasScheduledMessages       bool          `json:"has_scheduled_messages"`
	CanBeDeletedOnlyForSelf    bool          `json:"can_be_deleted_only_for_self"`
	CanBeDeletedForAllUsers    bool          `json:"can_be_deleted_for_all_users"`
	CanBeReported              bool          `json:"can_be_reported"`
	DefaultDisableNotification bool          `json:"default_disable_notification"`
	UnreadCount                int           `json:"unread_count"`
	LastReadInboxMessageId     int           `json:"last_read_inbox_message_id"`
	LastReadOutboxMessageId    int           `json:"last_read_outbox_message_id"`
	UnreadMentionCount         int           `json:"unread_mention_count"`
	UnreadReactionCount        int           `json:"unread_reaction_count"`
	ActionBar                  struct {
		Type         string `json:"@type"`
		CanUnarchive bool   `json:"can_unarchive"`
	} `json:"action_bar"`
	NotificationSettings struct {
		Type                                        string `json:"@type"`
		UseDefaultMuteFor                           bool   `json:"use_default_mute_for"`
		MuteFor                                     int    `json:"mute_for"`
		UseDefaultSound                             bool   `json:"use_default_sound"`
		SoundId                                     string `json:"sound_id"`
		UseDefaultShowPreview                       bool   `json:"use_default_show_preview"`
		ShowPreview                                 bool   `json:"show_preview"`
		UseDefaultDisablePinnedMessageNotifications bool   `json:"use_default_disable_pinned_message_notifications"`
		DisablePinnedMessageNotifications           bool   `json:"disable_pinned_message_notifications"`
		UseDefaultDisableMentionNotifications       bool   `json:"use_default_disable_mention_notifications"`
		DisableMentionNotifications                 bool   `json:"disable_mention_notifications"`
	} `json:"notification_settings"`
	AvailableReactions struct {
		Type string `json:"@type"`
	} `json:"available_reactions"`
	MessageTtl int    `json:"message_ttl"`
	ThemeName  string `json:"theme_name"`
	VideoChat  struct {
		Type            string `json:"@type"`
		GroupCallId     int    `json:"group_call_id"`
		HasParticipants bool   `json:"has_participants"`
	} `json:"video_chat"`
	ReplyMarkupMessageId int    `json:"reply_markup_message_id"`
	ClientData           string `json:"client_data"`
	Extra                string `json:"@extra"`
}

type GetChatsResponse

type GetChatsResponse struct {
	Event

	ChatIDs    []int64 `json:"chat_ids,omitempty"`
	TotalCount int32   `json:"total_count"`
}

type GetMe

type GetMe struct {
	Event

	*entities.User `json:"user"`
}

type GetMessageResponse

type GetMessageResponse entities.Message

type GetRemoteFile

type GetRemoteFile struct {
	Event

	*entities.File `json:"file"`
}

type Proxy

type Proxy struct {
	Event
	ID           int32                  `json:"id"`             // Unique identifier of the proxy
	Server       string                 `json:"server"`         // Proxy server IP address
	Port         int32                  `json:"port"`           // Proxy server port
	LastUsedDate int32                  `json:"last_used_date"` // Point in time (Unix timestamp) when the proxy was last used; 0 if never
	IsEnabled    bool                   `json:"is_enabled"`     // True, if the proxy is enabled now
	Type         entities.ProxyTypeEnum `json:"type"`           // Type of the proxy
}

type ReadFilePart

type ReadFilePart struct {
	Event

	Data []byte `json:"data"`
}

type SendMessage

type SendMessage struct {
	Event

	AuthorSignature           string  `json:"author_signature"`
	AutoDeleteIn              float64 `json:"auto_delete_in"`
	CanBeDeletedForAllUsers   bool    `json:"can_be_deleted_for_all_users"`
	CanBeDeletedOnlyForSelf   bool    `json:"can_be_deleted_only_for_self"`
	CanBeEdited               bool    `json:"can_be_edited"`
	CanBeForwarded            bool    `json:"can_be_forwarded"`
	CanBeSaved                bool    `json:"can_be_saved"`
	CanGetAddedReactions      bool    `json:"can_get_added_reactions"`
	CanGetMediaTimestampLinks bool    `json:"can_get_media_timestamp_links"`
	CanGetMessageThread       bool    `json:"can_get_message_thread"`
	CanGetStatistics          bool    `json:"can_get_statistics"`
	CanGetViewers             bool    `json:"can_get_viewers"`
	CanReportReactions        bool    `json:"can_report_reactions"`
	ChatId                    int64   `json:"chat_id"`
	ContainsUnreadMention     bool    `json:"contains_unread_mention"`
	Content                   struct {
		Type string `json:"@type"`
		Text struct {
			Type     string        `json:"@type"`
			Entities []interface{} `json:"entities"`
			Text     string        `json:"text"`
		} `json:"text"`
	} `json:"content"`
	Date                int64   `json:"date"`
	EditDate            int64   `json:"edit_date"`
	HasTimestampedMedia bool    `json:"has_timestamped_media"`
	Id                  int64   `json:"id"`
	IsChannelPost       bool    `json:"is_channel_post"`
	IsOutgoing          bool    `json:"is_outgoing"`
	IsPinned            bool    `json:"is_pinned"`
	IsTopicMessage      bool    `json:"is_topic_message"`
	MediaAlbumId        string  `json:"media_album_id"`
	MessageThreadId     int64   `json:"message_thread_id"`
	ReplyInChatId       int64   `json:"reply_in_chat_id"`
	ReplyToMessageId    int64   `json:"reply_to_message_id"`
	RestrictionReason   string  `json:"restriction_reason"`
	SelfDestructIn      float64 `json:"self_destruct_in"`
	SelfDestructTime    int64   `json:"self_destruct_time"`
	SenderId            struct {
		Type   string `json:"@type"`
		UserId int64  `json:"user_id"`
	} `json:"sender_id"`
	SendingState struct {
		Type      string `json:"@type"`
		SendingId int64  `json:"sending_id"`
	} `json:"sending_state"`
	UnreadReactions []interface{} `json:"unread_reactions"`
	ViaBotUserId    int64         `json:"via_bot_user_id"`
}

Jump to

Keyboard shortcuts

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