botapi

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2025 License: GPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Testtemplts map[string]map[string]MgItem = map[string]map[string]MgItem{
	"welcome": {"sin": {
		Msgtmpl:   "hello",
		ParseMode: "HTML",
	}},

	"configusage": {"sin": {
		Msgtmpl:   "hello",
		ParseMode: "HTML",
	}},

	constbot.TmpConfigInfo: {
		"sin": {ParseMode: "HTML", Msgtmpl: "සින්හලැන්"},

		"en": {
			ParseMode: "HTML",
			Msgtmpl: `
				<b>{{.Name}} </b> You have tatal {{.TotalQuota}}

				Config Info
				Config Name := {{.ConfigName}}
				Config Type := {{.ConfigType}}
				Config UUID := {{.ConfigUUID}}

				ConfigUpload := {{.ConfigUpload }}
				ConfigDownload := {{.ConfigDownload}}
				ConfigUploadtd := {{.ConfigUploadtd}}
				ConfigDownloadtd := {{.ConfigDownloadtd}}
				ConfigUsage := {{.ConfigUsage}}
				ConfigUsagetd := {{.ConfigUsagetd}}

				InName := {{.InName}}
				InType := {{.InType}}
				InPort := {{.InPort}}
				InAddr := {{.InAddr}}
				InInfo := {{.InInfo}}
				TranstPortType  := {{.TranstPortType}}
				TlsEnabled := {{.TlsEnabled}}

				TotalQuota := {{.TotalQuota}}


				
				OutName = {{.OutName}}
				OutType = {{.OutType}}
				OutInfo = {{.OutInfo}}

				Days to Reset Usage = {{.ResetDays}}

				


	`,
		},
	},

	constbot.TmpConQuota: {
		"en": {
			Msgtmpl:   "Send New quota for config {{.AvblQuota}}",
			ParseMode: "HTML",
		},
	},

	constbot.TmpCrAvblQuota: {
		"en": {
			Msgtmpl:   "You have available quota {{.Quota}}",
			ParseMode: "HTML",
		},
	},
	constbot.TmpCrAlreadyHave: {
		"en": {
			Msgtmpl:   "You already have {{.Count}}",
			ParseMode: "HTML",
		},
	},
	constbot.TmpStTotal: {
		"en": {
			Msgtmpl: `Your usage 

			✅
			
			tddwn {{.TDownload}}  
			tdup {{.TUpload}}  
			totalUp {{.MUpload}}  
			totaldown {{.MDownload}}  
			Alltime {{.Alltime}}
			Month {{.MonthAll}}
			
			If you want config-specific usage, click the buttons below.`,
			ParseMode: "HTML",
		},
	},
	constbot.TmpStcallback: {
		"en": {
			Msgtmpl: "Your usage tddwn {{.TDownload}}  tdup {{.TUpload}}  totalUp {{.MUpload}}  totaldown {{.MDownload}}",
		},
	},

	constbot.TmpcapQuota: {
		"en": {
			Msgtmpl:   "you'r cap will end {{.EndDate}} ",
			ParseMode: "HTML",
		},
	},

	constbot.TmpcapWarn: {
		"en": {
			Msgtmpl: `

			you have total {{.Leftquota}} which can be capped this cap automatically reset after 30 days and you left quota after capping  will shared amoung all user
			also you can't undo this cap you have to wait, if the user quota goes down than your cap also your connection will offline 
			
			`,
		},
	},

	constbot.Tmpcapreply: {
		"en": {
			Msgtmpl: `
			
			Good now send me quota you need to cap {{.LeftQuota}}
			
			`,
		},
	},

	constbot.TmpGifSend: {
		"en": {
			Msgtmpl: "send how much do you need to send you have {{.LeftQuota}}",
		},
	},

	constbot.TmpChatmemLeft: {
		"en": {
			Msgtmpl: "Good Bye If you changed your mind feel free to rejoin {{.Name}} ",
		},
	},

	constbot.TmpGroupWelcome: {
		"en": {
			Msgtmpl: "Hello How are welcome to group {{.Name}}",
		},
	},

	constbot.TmpWelcomeInbox: {
		"en": {
			Msgtmpl: "Welcome Message Template user who did not started bot yet joined ",
		},
	},
	constbot.TmpGrpComeback: {
		"en": {
			Msgtmpl: "Hello welcome back to our group You are still not in our channel if you want to use again service please rejoin channel  ",
		},
	},

	constbot.TmpHelpHome: {
		"en": {
			Msgtmpl: "Hello {{.Name}} Help page home",
		},
	},

	constbot.TmpAbout: {
		"en": {
			Msgtmpl: "Hello {{.Name}} About page",
		},
	},

	constbot.TmpregularVerified: {
		"en": {
			Includemed: true,
			Mediatype:  "photo",
			MediaId:    "AgACAgUAAxkBAAEvY5dnN5SVlrEmRFUSDBm1PWmfJUBrtwACF8IxG-qvuVVy0oe6c5lPTAEAAwIAA20AAzYE",
			Msgtmpl:    "Hello {{.Name}} Verified user started all time - {{.Alltime}}, month usage  {{.MUsage}} ",
		},
	},

	constbot.TmpConfiConfigure: {
		"en": {
			Includemed:  true,
			Mediatype:   "photo",
			MediaId:     "AgACAgUAAxkBAAEvY5dnN5SVlrEmRFUSDBm1PWmfJUBrtwACF8IxG-qvuVVy0oe6c5lPTAEAAwIAA20AAzYE",
			Msgtmpl:     "Hello Verified user started all time - , month usage   ",
			ContinueMed: false,
		},
	},

	constbot.TmpHelpInfoPage + "1": {
		"en": {
			Msgtmpl: "Hello {{.Name}} hello this is info page 1 ",
		},
	},

	constbot.TmpHelpInfoPage + "2": {

		"en": {
			Includemed:  true,
			Mediatype:   "photo",
			MediaId:     "AgACAgUAAxkBAAEvY5dnN5SVlrEmRFUSDBm1PWmfJUBrtwACF8IxG-qvuVVy0oe6c5lPTAEAAwIAA20AAzYE",
			Msgtmpl:     "Hello {{.Name}} this is help info page  2",
			ContinueMed: false,
		},
	},

	constbot.TmpHelpInfoPage + "3": {
		"en": {
			Includemed:  true,
			Mediatype:   "photo",
			MediaId:     "AgACAgUAAxkBAAEvZapnOFjKbTYqbIAgTIy0xf-VZQQ0PwACUcAxG8dwyVV7OMp6tw3cUwEAAwIAA3MAAzYE",
			Msgtmpl:     "Hello {{.Name}} this is help info page  3",
			ContinueMed: true,
		},
	},
	constbot.TmpHelpInfoPage + "4": {
		"en": {
			Msgtmpl: "Hello {{.Name}} this is help info page 4 ",
		},
	},

	constbot.TmpHelpCmPage + "1": {
		"en": {
			Msgtmpl: "Hello {{.Name}} hello this is command page 1 ",
		},
	},

	constbot.TmpHelpCmPage + "2": {
		"en": {
			Msgtmpl: "Hello {{.Name}} this is help command page 2 ",
		},
	},

	constbot.TmpHelpCmPage + "3": {
		"en": {
			Msgtmpl: "Hello {{.Name}} this is help command page 3 ",
		},
	},

	constbot.TmpRefHome: {
		"en": {
			Msgtmpl: "Hello {{.Name}} You have {{.Refred}} users, and {{.Verified}} verified user you should have verified user to claim the gift, ( verified user = use who is in both group and channel)  ",
		},
	},
	constbot.TmpRefshare: {
		"en": {
			Msgtmpl: "Hello Everyone I am {{.Name}} You can Join with {{.Botlink}}  ",

			Includemed: true,
			Mediatype:  "photo",
			MediaId:    "AgACAgUAAxkBAAEvZapnOFjKbTYqbIAgTIy0xf-VZQQ0PwACUcAxG8dwyVV7OMp6tw3cUwEAAwIAA3MAAzYE",
		},
	},

	constbot.TmpUserInfo: {
		"en": {
			Msgtmpl: `
				Name {{.Name}}
				Username	= @{{.Username}}
				TgId		= {{.TgId}}
				
				Dedicated {{.Dedicated}}
				TQuota       {{.TQuota}}
				LeftQuota    {{.LeftQuota}}
				ConfCount   {{.ConfCount}}
				TUsage       {{.TUsage}}
				GiftQuota    {{.GiftQuota}}
				Joined       {{.Joined}}
				CapEndin     {{.CapEndin}}
				Disendin    {{.Disendin}}
				UsageResetIn{{.UsageResetIn}}

				Iscapped       {{.Iscapped}}
				Isgifted       {{.Isgifted}}
				Isdisuser      {{.Isdisuser}}
				IsMonthLimited {{.IsMonthLimited}}
				JoinedPlace {{.JoinedPlace}}

				{{if .Iscapped}}
    			CapEndin = {{.CapEndin}}
				{{end}}

   			 	{{if .Isgifted}}
        		GiftEndIn = {{.GiftEndIn}}
    			{{end}}
			

			`,
		},
	},

	constbot.TmpDisGroup: {
		"en": {
			Msgtmpl: "Hello Everyone user{{.Name}} is distributed his quota everyone clap hiom and thanks he dedicated {{.Disquota}}, රටක් දියුනු වෙන්න මේ වගෙ එව්න් තමා ඕන  ",

			Includemed: true,
			Mediatype:  "photo",
			MediaId:    "AgACAgUAAxkBAAEvZapnOFjKbTYqbIAgTIy0xf-VZQQ0PwACUcAxG8dwyVV7OMp6tw3cUwEAAwIAA3MAAzYE",
		},
	},

	constbot.TmpCrInInfo: {
		"en": {
			Msgtmpl: `selected inbound info is here if you want excatly this seeting for your config conform also you can change the inbound later 
			
			InName {{.InName}}
			InType {{.InType}}
			InPort {{.InPort}}
			InAddr {{.InAddr}}
			InInfo {{.InInfo}}
			TranstPortType {{.TranstPortType}}
			TlsEnabled {{.TlsEnabled}}
			Domain 	{{.Domain}}
			PublicIp {{.PublicIp}}
			
			`,
		},
	},

	constbot.TmpCrSendUID: {
		"en": {
			Msgtmpl: `

			this is tempory config structure we will provide good way to generate configs as you need till then use this

			UUID {{.UUID}}
			Domain {{.Domain}}
			Transport {{.Transport}}
			ConfigName {{.ConfigName}}
			TlsEnabled {{.TlsEnabled}}
			Port {{.Port}}



			`,
		},
	},

	constbot.TmpInchange: {
		"en": {
			Msgtmpl: `

			Info about inbound that you are goung to change 

			InName {{.InName}}
			InType {{.InType}}
			InPort {{.InPort}}
			InAddr {{.InAddr}}
			InInfo {{.InInfo}}
			TranstPortType {{.TranstPortType}}
			TlsEnabled {{.TlsEnabled}}
			Domain 	{{.Domain}}
			PublicIp {{.PublicIp}}


			`,
		},
	},
	constbot.TmpOutchange: {
		"en": {
			Msgtmpl: `

			Selected Outbound info

			OutName {{.OutName}}
			OutType {{.OutType}}
			OutInfo {{.OutInfo}}
			Latency {{.Latency}}ms


			`,
		},
	},
}

Functions

func CreateMultiPartReq

func CreateMultiPartReq(ctx context.Context, method, url string, fields map[string]string, fileparts map[string]Filepart) (*http.Request, error)

func Createkeyboard

func Createkeyboard(keyboard *InlineKeyboardMarkup) ([]byte, error)

func TemplateInit

func TemplateInit(sender BotAPI, sudoadminID int64, logger *zap.Logger, templates []*MgItem) error

Types

type BotAPI

type BotAPI interface {
	Makerequest(ctx context.Context, method, endpoint string, body *BotReader) (*tgbotapi.APIResponse, error)
	SendRawReq(req *http.Request) (*tgbotapi.APIResponse, error)
	SendContext(ctx context.Context, msg *Msgcommon) (*tgbotapi.Message, error)
	AnswereCallbackCtx(ctx context.Context, Callbackanswere *Callbackanswere) error
	GetchatmemberCtx(ctx context.Context, Userid int64, Chatid int64) (*tgbotapi.ChatMember, bool, error)
	//Createkeyboard(keyboard *InlineKeyboardMarkup) ([]byte,error)
	Send(msg *Msgcommon) (*tgbotapi.Message, error)
	SendError(error, int64)
	DeleteMsg(ctx context.Context, msgid int64, chatid int64) error
	GetMgStore() *MessageStore
	SetWebhook(webhookurl, secret, ip_addr string, allowd_ob []string) error
	CreateFullUrl(endpoint string) string
	GetFile(file_Id string) (io.ReadCloser, error)
}

type BotReader

type BotReader struct {
	RealOb any
	// contains filtered or unexported fields
}

func CreateReder

func CreateReder(botob any) *BotReader

func (*BotReader) Close

func (m *BotReader) Close() error

func (*BotReader) Len added in v1.2.0

func (m *BotReader) Len() int

func (*BotReader) Read

func (m *BotReader) Read(p []byte) (int, error)

type Botapi

type Botapi struct {
	Client *http.Client
	// contains filtered or unexported fields
}

func NewBot

func NewBot(ctx context.Context, token, mainurl string, mgstore *MessageStore) *Botapi

func (*Botapi) AnswereCallbackCtx

func (b *Botapi) AnswereCallbackCtx(ctx context.Context, Callbackanswere *Callbackanswere) error

func (*Botapi) AnswereInlineQuary

func (b *Botapi) AnswereInlineQuary(ctx context.Context) error

func (*Botapi) CreateFullUrl

func (b *Botapi) CreateFullUrl(endpoint string) string

func (*Botapi) DeleteMsg

func (b *Botapi) DeleteMsg(ctx context.Context, msgid int64, chatid int64) error

func (*Botapi) GetFile

func (b *Botapi) GetFile(filed_id string) (io.ReadCloser, error)

func (*Botapi) GetMgStore

func (b *Botapi) GetMgStore() *MessageStore

func (*Botapi) GetchatmemberCtx

func (b *Botapi) GetchatmemberCtx(ctx context.Context, Userid int64, Chatid int64) (*tgbotapi.ChatMember, bool, error)

func (*Botapi) Makerequest

func (b *Botapi) Makerequest(reqctx context.Context, method, endpoint string, body *BotReader) (*tgbotapi.APIResponse, error)

Endpoint should be without slash "/"

func (*Botapi) Send

func (b *Botapi) Send(msg *Msgcommon) (*tgbotapi.Message, error)

func (*Botapi) SendContext

func (b *Botapi) SendContext(ctx context.Context, msg *Msgcommon) (*tgbotapi.Message, error)

func (*Botapi) SendError

func (b *Botapi) SendError(err error, UserID int64)

func (*Botapi) SendRawReq

func (b *Botapi) SendRawReq(req *http.Request) (*tgbotapi.APIResponse, error)

func (*Botapi) SetWebhook

func (b *Botapi) SetWebhook(webhookurl, secret, ip_addr string, allo_updates []string) error

type Buttons

type Buttons struct {
	InlineKeyboard [][]InlineKeyboardButton `json:"inline_keyboard"`
	// contains filtered or unexported fields
}

func NewButtons

func NewButtons(btmatrix []int16) *Buttons

Create button Schema Examle if you give []int16{2, 1, 3,}, when you call Addbuttons button will add to this ass the map Ex :-

   btn
btn,  btn

btn btn btn

func (*Buttons) AddBack

func (b *Buttons) AddBack(newline bool)

func (*Buttons) AddBtcommon

func (b *Buttons) AddBtcommon(btn string)

func (*Buttons) AddClose

func (b *Buttons) AddClose(newline bool)

should call after adding all neccery buttons

func (*Buttons) AddCloseBack

func (b *Buttons) AddCloseBack()

Should Called After adding allbuttons

func (*Buttons) AddUrlbutton

func (b *Buttons) AddUrlbutton(name, url string)

func (*Buttons) Addbutton

func (b *Buttons) Addbutton(btnname, data, url string)

func (*Buttons) Addcancle

func (b *Buttons) Addcancle()

func (*Buttons) Getkeyboard

func (b *Buttons) Getkeyboard() Keyboard

func (*Buttons) ID

func (b *Buttons) ID() int64

func (*Buttons) Marshell

func (b *Buttons) Marshell() (json.RawMessage, error)

func (*Buttons) PassButtons

func (b *Buttons) PassButtons(count int16)

func (*Buttons) Passline

func (b *Buttons) Passline()

func (*Buttons) Reset

func (b *Buttons) Reset(btmatrix []int16)

type Callbackanswere

type Callbackanswere struct {
	Callback_query_id string `json:"callback_query_id"`
	Show_alert        bool   `json:"show_alert,omitempty"`
	Cache_time        int16  `json:"cache_time,omitempty"`
	Text              string `json:"text,omitempty"`
}

type Callbackdata

type Callbackdata struct {
	Uniqid int64  `json:"uid"`
	Data   string `json:"data"`
}

func (*Callbackdata) Fill

func (c *Callbackdata) Fill(data string) error

Deprecated Use V2

func (*Callbackdata) FillV2

func (c *Callbackdata) FillV2(data string) error

func (*Callbackdata) String

func (c *Callbackdata) String() string

Deprecated Use V2

func (*Callbackdata) StringV2

func (c *Callbackdata) StringV2() string

type CommonUsage

type CommonUsage struct {
	AddtionalQuota  string
	CalculatedQuota string
	MUsage          string
	Alltime         string
}

type CommonUser

type CommonUser struct {
	Name     string
	Username string
	TgId     int64
}

common input types All of type below are for template render

type Filepart

type Filepart struct {
	Reader io.Reader
	Name   string
}

type Filesend

type Filesend io.Reader

type Htmlstring

type Htmlstring string

type Infocontext

type Infocontext struct {
	ChatId  int64 `json:"chat_id,omitempty"`
	User_id int64 `json:"user_id,omitempty"`
}

type InlineKeyboardButton

type InlineKeyboardButton struct {
	Text         string `json:"text,omitempty"`
	CallbackData string `json:"callback_data,omitempty"` // For button actions
	URL          string `json:"url,omitempty"`           // For opening a URL
}

InlineKeyboardButton represents a button in the inline keyboard

type InlineKeyboardMarkup

type InlineKeyboardMarkup struct {
	InlineKeyboard [][]InlineKeyboardButton `json:"inline_keyboard"`
}

type InputMedia

type InputMedia struct {
	Type      string `json:"type"`
	Media     string `json:"media"`
	Caption   string `json:"caption,omitempty"`
	ParseMode string `json:"parse_mode,omitempty"`
}

use only for editmeadia

func (*InputMedia) Marshal

func (i *InputMedia) Marshal() json.RawMessage

type Keyboard

type Keyboard struct {
	Inline_keyboard [][]InlineKeyboardButton `json:"inline_keyboard,omitempty"`
}

type Meadiacommon

type Meadiacommon struct {
	//sending newly media
	Photo       any    `json:"photo,omitempty"`
	Video       any    `json:"video,omitempty"`
	Caption     string `json:"caption,omitempty"`
	Has_spoiler bool   `json:"has_spoiler,omitempty"`

	//this field for editing meadia
	Media *InputMedia `json:"media,omitempty"`
}

type Message

type Message struct {
	Msg                string
	ParseMode          string
	Includemed         bool
	MedType            string
	MediaId            string
	ContinueMed        bool
	Disabled           bool
	SkipText           bool
	Continue_Skip_Text bool
	SuperContinue      bool

	MeadiaSkip bool
}

io.Writer for excution

func (*Message) String

func (m *Message) String() string

func (*Message) Write

func (m *Message) Write(p []byte) (n int, err error)

type MessageStore

type MessageStore struct {
	Templates map[string]*MgItem
	// contains filtered or unexported fields
}

func NewMessageStore

func NewMessageStore(path string) (*MessageStore, error)

func (*MessageStore) GetMessage

func (m *MessageStore) GetMessage(name, lang string, obj any) (*Message, error)

func (*MessageStore) GetPath

func (m *MessageStore) GetPath() string

func (*MessageStore) Init

func (m *MessageStore) Init(sender BotAPI, sudoadminID int64, logger *zap.Logger) error

this verify that all media can sendble

func (*MessageStore) MsgWithouerro

func (m *MessageStore) MsgWithouerro(name, lang string, obj any) string

type MgItem

type MgItem struct {
	Msgtmpl    string `json:"msg_template" yaml:"msg_template"`
	ParseMode  string `json:"parse_mode" yaml:"parse_mode" `
	Includemed bool   `json:"include_media" yaml:"include_media"`
	Mediatype  string `json:"media_type" yaml:"media_type"`
	MediaId    string `json:"media_id" yaml:"media_id" `

	ContinueMed        bool   `json:"continue_media" yaml:"continue_media"`
	Disabled           bool   `json:"disabled" yaml:"disabled"`
	SkipText           bool   `json:"skip_text" yaml:"skip_text"`
	Continue_Skip_Text bool   `json:"contin_skip_text" yaml:"contin_skip_text"`
	SuperContinue      bool   `json:"supercontinue" yaml:"supercontinue"`
	AltMediaUrl        string `json:"alt_med_url" yaml:"alt_med_url"`
	AltMediaPath       string `json:"alt_med_path" yaml:"alt_med_path"`

	MeadiaSkip bool `json:"media_skip" yaml:"media_skip"`
	// contains filtered or unexported fields
}

func (*MgItem) ChangeField

func (m *MgItem) ChangeField(field, value string) error

type Msgcommon

type Msgcommon struct {
	*Infocontext
	Message_thread_id int64    `json:"message_thread_id,omitempty"`
	Text              string   `json:"text,omitempty"`
	Parse_mode        string   `json:"parse_mode,omitempty"`
	Reply_markup      Keyboard `json:"reply_markup,omitempty"`
	Message_id        int64    `json:"message_id,omitempty"`

	//meadia
	*Meadiacommon
	Endpoint string `json:"-"`
}

func (*Msgcommon) SetMedType

func (m *Msgcommon) SetMedType(medtype string, medid string)

type Msgsession

type Msgsession struct {
	ChatID    int64
	MessageID int

	Lasscallbackid int64
	Prime          int64 //Deorecated
	// contains filtered or unexported fields
}

This object Is not concurrent safe use it only in one go routine

func NewMsgsession

func NewMsgsession(upxctx context.Context, api BotAPI, userid int64, chatid int64, lang string) *Msgsession

func (*Msgsession) Addreply

func (m *Msgsession) Addreply(id int)

func (*Msgsession) AddreplyNoDelete

func (m *Msgsession) AddreplyNoDelete(id int)

After adding reply, current mg will not delete and resend

func (*Msgsession) Callbackanswere

func (m *Msgsession) Callbackanswere(quoaryid, text string, alert bool) error

func (*Msgsession) CopyMessageRawTo

func (m *Msgsession) CopyMessageRawTo(to, mgid, fromchat int64) error

func (*Msgsession) CopyMessageTo

func (m *Msgsession) CopyMessageTo(to int64, mgid int64) error

func (*Msgsession) DeleteAllMsg

func (m *Msgsession) DeleteAllMsg() error

func (*Msgsession) DeleteLast

func (m *Msgsession) DeleteLast()

func (*Msgsession) DeleteReplys

func (m *Msgsession) DeleteReplys() error

func (*Msgsession) Edit

func (m *Msgsession) Edit(msg any, buttons *Buttons, name string) (*tgbotapi.Message, error)

Many types supported by this method msg parameter can be Upmessage, struct with template name, or string

func (*Msgsession) EditNewcontext

func (m *Msgsession) EditNewcontext(ctx context.Context, msg any, buttons *Buttons, name string) (*tgbotapi.Message, error)

func (*Msgsession) EditText

func (m *Msgsession) EditText(msg string, buttons *Buttons) (*tgbotapi.Message, error)

func (*Msgsession) ForwardMgTo

func (m *Msgsession) ForwardMgTo(to int64, mgid, fromchat int64) error

func (*Msgsession) RemoveBtns

func (m *Msgsession) RemoveBtns() error

remove all btns from last sent msg this functiuon does not gurntee anything

func (*Msgsession) SendAlert

func (m *Msgsession) SendAlert(msg any, buttons *Buttons) (*tgbotapi.Message, error)

Will send a compleatly new msg not relvent edititn msgs will automatically remove with delete all

func (*Msgsession) SendExtranal

func (m *Msgsession) SendExtranal(msg any, buttons *Buttons, name string, nodel bool) (*tgbotapi.Message, error)

func (*Msgsession) SendNew

func (m *Msgsession) SendNew(msg any, buttons *Buttons, name string) (*tgbotapi.Message, error)

Send New message and set it as last message

func (*Msgsession) SendTmpl

func (m *Msgsession) SendTmpl(name string, obj any, btns *Buttons) (*tgbotapi.Message, error)

Deprecated

func (*Msgsession) SetNewcontext

func (m *Msgsession) SetNewcontext(ctx context.Context)

func (*Msgsession) SetPrimeLast

func (m *Msgsession) SetPrimeLast()

type UpMessage

type UpMessage struct {
	DestinatioID int64
	Template     any
	TemplateName string
	Buttons      *Buttons
	Lang         string
}

this struct used to send the msg to watman's mg que also support by botapi's Message session, when use with msg session no need to provide destination & langs

type UsageAll

type UsageAll struct {
}

Jump to

Keyboard shortcuts

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