-
Notifications
You must be signed in to change notification settings - Fork 0
/
telegram.go
94 lines (92 loc) · 5.18 KB
/
telegram.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
package telegram
import (
"gopkg.in/telebot.v3"
"io"
)
type Telegram interface {
AdminsOf(chat *telebot.Chat) ([]telebot.ChatMember, error)
Ban(chat *telebot.Chat, member *telebot.ChatMember, revokeMessages ...bool) error
BanSenderChat(chat *telebot.Chat, sender telebot.Recipient) error
DefaultRights(forChannels bool) (*telebot.Rights, error)
Len(chat *telebot.Chat) (int, error)
Promote(chat *telebot.Chat, member *telebot.ChatMember) error
Restrict(chat *telebot.Chat, member *telebot.ChatMember) error
SetAdminTitle(chat *telebot.Chat, user *telebot.User, title string) error
SetDefaultRights(rights telebot.Rights, forChannels bool) error
Unban(chat *telebot.Chat, user *telebot.User, forBanned ...bool) error
UnbanSenderChat(chat *telebot.Chat, sender telebot.Recipient) error
Raw(method string, payload interface{}) ([]byte, error)
Accept(query *telebot.PreCheckoutQuery, errorMessage ...string) error
Answer(query *telebot.Query, resp *telebot.QueryResponse) error
AnswerWebApp(query *telebot.Query, r telebot.Result) (*telebot.WebAppMessage, error)
ChatByID(id int64) (*telebot.Chat, error)
ChatByUsername(name string) (*telebot.Chat, error)
ChatMemberOf(chat, user telebot.Recipient) (*telebot.ChatMember, error)
Close() (bool, error)
Copy(to telebot.Recipient, msg telebot.Editable, options ...interface{}) (*telebot.Message, error)
Delete(msg telebot.Editable) error
Download(file *telebot.File, localFilename string) error
Edit(msg telebot.Editable, what interface{}, opts ...interface{}) (*telebot.Message, error)
EditCaption(msg telebot.Editable, caption string, opts ...interface{}) (*telebot.Message, error)
EditMedia(msg telebot.Editable, media telebot.Inputtable, opts ...interface{}) (*telebot.Message, error)
EditReplyMarkup(msg telebot.Editable, markup *telebot.ReplyMarkup) (*telebot.Message, error)
File(file *telebot.File) (io.ReadCloser, error)
FileByID(fileID string) (telebot.File, error)
Forward(to telebot.Recipient, msg telebot.Editable, opts ...interface{}) (*telebot.Message, error)
Group(name string) Group
Handle(endpoint interface{}, h telebot.HandlerFunc, m ...telebot.MiddlewareFunc)
Leave(chat *telebot.Chat) error
Logout() (bool, error)
MenuButton(chat *telebot.User) (*telebot.MenuButton, error)
NewContext(u telebot.Update) telebot.Context
NewMarkup() *telebot.ReplyMarkup
Notify(to telebot.Recipient, action telebot.ChatAction) error
OnError(err error, c telebot.Context)
Pin(msg telebot.Editable, opts ...interface{}) error
ProfilePhotosOf(user *telebot.User) ([]telebot.Photo, error)
Reply(to *telebot.Message, what interface{}, opts ...interface{}) (*telebot.Message, error)
Respond(c *telebot.Callback, resp ...*telebot.CallbackResponse) error
Send(to telebot.Recipient, what interface{}, opts ...interface{}) (*telebot.Message, error)
SendAlbum(to telebot.Recipient, a telebot.Album, opts ...interface{}) ([]telebot.Message, error)
SetMenuButton(chat *telebot.User, mb interface{}) error
Ship(query *telebot.ShippingQuery, what ...interface{}) error
Start()
Stop()
StopLiveLocation(msg telebot.Editable, opts ...interface{}) (*telebot.Message, error)
StopPoll(msg telebot.Editable, opts ...interface{}) (*telebot.Poll, error)
Unpin(chat *telebot.Chat, messageID ...int) error
UnpinAll(chat *telebot.Chat) error
Use(middleware ...telebot.MiddlewareFunc)
ApproveJoinRequest(chat telebot.Recipient, user *telebot.User) error
CreateInviteLink(chat telebot.Recipient, link *telebot.ChatInviteLink) (*telebot.ChatInviteLink, error)
DeclineJoinRequest(chat telebot.Recipient, user *telebot.User) error
DeleteGroupPhoto(chat *telebot.Chat) error
DeleteGroupStickerSet(chat *telebot.Chat) error
EditInviteLink(chat telebot.Recipient, link *telebot.ChatInviteLink) (*telebot.ChatInviteLink, error)
InviteLink(chat *telebot.Chat) (string, error)
RevokeInviteLink(chat telebot.Recipient, link string) (*telebot.ChatInviteLink, error)
SetGroupDescription(chat *telebot.Chat, description string) error
SetGroupPermissions(chat *telebot.Chat, perms telebot.Rights) error
SetGroupPhoto(chat *telebot.Chat, p *telebot.Photo) error
SetGroupStickerSet(chat *telebot.Chat, setName string) error
SetGroupTitle(chat *telebot.Chat, title string) error
Commands(opts ...interface{}) ([]telebot.Command, error)
DeleteCommands(opts ...interface{}) error
SetCommands(opts ...interface{}) error
GameScores(user telebot.Recipient, msg telebot.Editable) ([]telebot.GameHighScore, error)
SetGameScore(user telebot.Recipient, msg telebot.Editable, score telebot.GameHighScore) (*telebot.Message, error)
CreateInvoiceLink(i telebot.Invoice) (string, error)
AddSticker(to telebot.Recipient, s telebot.StickerSet) error
CreateStickerSet(to telebot.Recipient, s telebot.StickerSet) error
CustomEmojiStickers(ids []string) ([]telebot.Sticker, error)
DeleteSticker(sticker string) error
SetStickerPosition(sticker string, position int) error
SetStickerSetThumb(to telebot.Recipient, s telebot.StickerSet) error
StickerSet(name string) (*telebot.StickerSet, error)
UploadSticker(to telebot.Recipient, png *telebot.File) (*telebot.File, error)
ProcessUpdate(u telebot.Update)
RemoveWebhook(dropPending ...bool) error
SetWebhook(w *telebot.Webhook) error
Webhook() (*telebot.Webhook, error)
Me() *telebot.User
}