WIP v0.5.0
This commit is contained in:
41
tgapi/methods.go
Normal file
41
tgapi/methods.go
Normal file
@@ -0,0 +1,41 @@
|
||||
package tgapi
|
||||
|
||||
type ParseMode string
|
||||
|
||||
const (
|
||||
ParseMDV2 ParseMode = "MarkdownV2"
|
||||
ParseHTML ParseMode = "HTML"
|
||||
ParseMD ParseMode = "Markdown"
|
||||
)
|
||||
|
||||
type EmptyParams struct{}
|
||||
|
||||
var NoParams = EmptyParams{}
|
||||
|
||||
type UpdateParams struct {
|
||||
Offset int `json:"offset"`
|
||||
Timeout int `json:"timeout"`
|
||||
AllowedUpdates []string `json:"allowed_updates"`
|
||||
}
|
||||
|
||||
func (api *Api) GetMe() (User, error) {
|
||||
req := NewRequest[User, EmptyParams]("getMe", NoParams)
|
||||
return req.Do(api)
|
||||
}
|
||||
func (api *Api) LogOut() (bool, error) {
|
||||
req := NewRequest[bool, EmptyParams]("logOut", NoParams)
|
||||
return req.Do(api)
|
||||
}
|
||||
func (api *Api) Close() (bool, error) {
|
||||
req := NewRequest[bool, EmptyParams]("close", NoParams)
|
||||
return req.Do(api)
|
||||
}
|
||||
|
||||
type GetFileP struct {
|
||||
FileId string `json:"file_id"`
|
||||
}
|
||||
|
||||
func (api *Api) GetFile(params GetFileP) (File, error) {
|
||||
req := NewRequest[File]("getFile", params)
|
||||
return req.Do(api)
|
||||
}
|
||||
Reference in New Issue
Block a user