utils

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ModeDef         = tele.ModeDefault
	ModeFile string = "File"
	ModeHTML        = tele.ModeHTML
	ModeMD          = tele.ModeMarkdown
	ModeMD2         = tele.ModeMarkdownV2
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AdminInfo added in v0.0.11

type AdminInfo struct {
	User   User   `json:"user"`
	Status string `json:"status"`
	AdminPerm
}

type AdminPerm added in v0.0.11

type AdminPerm struct {
	CanBeEdited         bool `json:"can_be_edited"`
	CanManageChat       bool `json:"can_manage_chat"`
	CanChangeInfo       bool `json:"can_change_info"`
	CanDeleteMessages   bool `json:"can_delete_messages"`
	CanInviteUsers      bool `json:"can_invite_users"`
	CanRestrictMembers  bool `json:"can_restrict_members"`
	CanPinMessages      bool `json:"can_pin_messages"`
	CanManageTopics     bool `json:"can_manage_topics"`
	CanPromoteMembers   bool `json:"can_promote_members"`
	CanManageVideoChats bool `json:"can_manage_video_chats"`
	IsAnonymous         bool `json:"is_anonymous"`
	CanManageVoiceChats bool `json:"can_manage_voice_chats"`
}

type Use added in v0.0.11

type Use struct {
	Ctx             tele.Context
	ChatId          int64
	AutoDeleteTimer time.Duration
	AutoDelete      bool
	ShowAlert       bool
	FileMode        bool
	Btn             *tele.ReplyMarkup
	SendOptions     *tele.SendOptions
	Err             error
}

func New

func New() *Use

func (*Use) Alert added in v0.0.11

func (n *Use) Alert(text string) error

Pop-ups

func (*Use) Delete added in v0.0.11

func (n *Use) Delete(message int) error

Delete Message

func (*Use) GetAdminList added in v0.0.11

func (n *Use) GetAdminList() (map[int64]AdminInfo, error)

Get the list of group administrators

func (*Use) Send added in v0.0.11

func (n *Use) Send(msg any) (*tele.Message, error)

Send Message

func (*Use) SetAutoDelete added in v0.0.11

func (n *Use) SetAutoDelete(t time.Duration) *Use

func (*Use) SetBtn added in v0.0.11

func (n *Use) SetBtn(btn *tele.ReplyMarkup) *Use

func (*Use) SetChatID added in v0.0.11

func (n *Use) SetChatID(c int64) *Use

func (*Use) SetContext added in v0.0.11

func (n *Use) SetContext(c tele.Context) *Use

func (*Use) SetModes added in v0.0.11

func (n *Use) SetModes(s any) *Use

func (*Use) SetShowAlert added in v0.0.11

func (n *Use) SetShowAlert() *Use

func (*Use) SetWebPreview added in v0.0.11

func (n *Use) SetWebPreview() *Use

type User added in v0.0.11

type User struct {
	ID        int64  `json:"id"`
	IsBot     bool   `json:"is_bot"`
	IsPremium bool   `json:"is_premium"`
	Language  string `json:"language_code"`
	FirstName string `json:"first_name"`
	LastName  string `json:"last_name"`
	Username  string `json:"username"`
}

Jump to

Keyboard shortcuts

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