-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathapi_extended.go
294 lines (210 loc) · 11.5 KB
/
api_extended.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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
package tgo
// ParseMode is a type that represents the parse mode of a message.
// eg. Markdown, HTML, etc.
type ParseMode string
const (
// does not parse the message
ParseModeNone ParseMode = ""
// parses the message as Markdown
ParseModeMarkdown ParseMode = "Markdown"
// parses the message as Markdown but using telegram's V2 markdown
ParseModeMarkdownV2 ParseMode = "MarkdownV2"
// parses the message as HTML
ParseModeHTML ParseMode = "HTML"
)
// Username implements a string ChatID.
type Username string
// IsChatID does nothing but implements ChatID interface.
func (Username) IsChatID() {}
// ID implements a int64 ChatID.
type ID int64
// IsChatID does nothing but implements ChatID interface.
func (ID) IsChatID() {}
// GetChatID implements Sendable's GetChatID method.
func (x *SendAnimation) GetChatID() ChatID { return x.ChatId }
// GetChatID implements Sendable's GetChatID method.
func (x *SendAudio) GetChatID() ChatID { return x.ChatId }
// GetChatID implements Sendable's GetChatID method.
func (x *SendContact) GetChatID() ChatID { return x.ChatId }
// GetChatID implements Sendable's GetChatID method.
func (x *SendDice) GetChatID() ChatID { return x.ChatId }
// GetChatID implements Sendable's GetChatID method.
func (x *SendDocument) GetChatID() ChatID { return x.ChatId }
// GetChatID implements Sendable's GetChatID method.
func (x *SendGame) GetChatID() ChatID { return ID(x.ChatId) }
// GetChatID implements Sendable's GetChatID method.
func (x *SendInvoice) GetChatID() ChatID { return x.ChatId }
// GetChatID implements Sendable's GetChatID method.
func (x *SendLocation) GetChatID() ChatID { return x.ChatId }
// GetChatID implements Sendable's GetChatID method.
func (x *SendMessage) GetChatID() ChatID { return x.ChatId }
// GetChatID implements Sendable's GetChatID method.
func (x *SendPhoto) GetChatID() ChatID { return x.ChatId }
// GetChatID implements Sendable's GetChatID method.
func (x *SendPoll) GetChatID() ChatID { return x.ChatId }
// GetChatID implements Sendable's GetChatID method.
func (x *SendSticker) GetChatID() ChatID { return x.ChatId }
// GetChatID implements Sendable's GetChatID method.
func (x *SendVenue) GetChatID() ChatID { return x.ChatId }
// GetChatID implements Sendable's GetChatID method.
func (x *SendVideo) GetChatID() ChatID { return x.ChatId }
// GetChatID implements Sendable's GetChatID method.
func (x *SendVideoNote) GetChatID() ChatID { return x.ChatId }
// GetChatID implements Sendable's GetChatID method.
func (x *SendVoice) GetChatID() ChatID { return x.ChatId }
// SetChatID implements Sendable's SetChatID method.
func (x *SendAnimation) SetChatID(id int64) { x.ChatId = ID(id) }
// SetChatID implements Sendable's SetChatID method.
func (x *SendAudio) SetChatID(id int64) { x.ChatId = ID(id) }
// SetChatID implements Sendable's SetChatID method.
func (x *SendContact) SetChatID(id int64) { x.ChatId = ID(id) }
// SetChatID implements Sendable's SetChatID method.
func (x *SendDice) SetChatID(id int64) { x.ChatId = ID(id) }
// SetChatID implements Sendable's SetChatID method.
func (x *SendDocument) SetChatID(id int64) { x.ChatId = ID(id) }
// SetChatID implements Sendable's SetChatID method.
func (x *SendGame) SetChatID(id int64) { x.ChatId = id }
// SetChatID implements Sendable's SetChatID method.
func (x *SendInvoice) SetChatID(id int64) { x.ChatId = ID(id) }
// SetChatID implements Sendable's SetChatID method.
func (x *SendLocation) SetChatID(id int64) { x.ChatId = ID(id) }
// SetChatID implements Sendable's SetChatID method.
func (x *SendMessage) SetChatID(id int64) { x.ChatId = ID(id) }
// SetChatID implements Sendable's SetChatID method.
func (x *SendPhoto) SetChatID(id int64) { x.ChatId = ID(id) }
// SetChatID implements Sendable's SetChatID method.
func (x *SendPoll) SetChatID(id int64) { x.ChatId = ID(id) }
// SetChatID implements Sendable's SetChatID method.
func (x *SendSticker) SetChatID(id int64) { x.ChatId = ID(id) }
// SetChatID implements Sendable's SetChatID method.
func (x *SendVenue) SetChatID(id int64) { x.ChatId = ID(id) }
// SetChatID implements Sendable's SetChatID method.
func (x *SendVideo) SetChatID(id int64) { x.ChatId = ID(id) }
// SetChatID implements Sendable's SetChatID method.
func (x *SendVideoNote) SetChatID(id int64) { x.ChatId = ID(id) }
// SetChatID implements Sendable's SetChatID method.
func (x *SendVoice) SetChatID(id int64) { x.ChatId = ID(id) }
// Send implements Sendable's Send method.
func (x *SendAnimation) Send(api *API) (*Message, error) { return api.SendAnimation(x) }
// Send implements Sendable's Send method.
func (x *SendAudio) Send(api *API) (*Message, error) { return api.SendAudio(x) }
// Send implements Sendable's Send method.
func (x *SendContact) Send(api *API) (*Message, error) { return api.SendContact(x) }
// Send implements Sendable's Send method.
func (x *SendDice) Send(api *API) (*Message, error) { return api.SendDice(x) }
// Send implements Sendable's Send method.
func (x *SendDocument) Send(api *API) (*Message, error) { return api.SendDocument(x) }
// Send implements Sendable's Send method.
func (x *SendGame) Send(api *API) (*Message, error) { return api.SendGame(x) }
// Send implements Sendable's Send method.
func (x *SendInvoice) Send(api *API) (*Message, error) { return api.SendInvoice(x) }
// Send implements Sendable's Send method.
func (x *SendLocation) Send(api *API) (*Message, error) { return api.SendLocation(x) }
// Send implements Sendable's Send method.
func (x *SendMessage) Send(api *API) (*Message, error) { return api.SendMessage(x) }
// Send implements Sendable's Send method.
func (x *SendPhoto) Send(api *API) (*Message, error) { return api.SendPhoto(x) }
// Send implements Sendable's Send method.
func (x *SendPoll) Send(api *API) (*Message, error) { return api.SendPoll(x) }
// Send implements Sendable's Send method.
func (x *SendSticker) Send(api *API) (*Message, error) { return api.SendSticker(x) }
// Send implements Sendable's Send method.
func (x *SendVenue) Send(api *API) (*Message, error) { return api.SendVenue(x) }
// Send implements Sendable's Send method.
func (x *SendVideo) Send(api *API) (*Message, error) { return api.SendVideo(x) }
// Send implements Sendable's Send method.
func (x *SendVideoNote) Send(api *API) (*Message, error) { return api.SendVideoNote(x) }
// Send implements Sendable's Send method.
func (x *SendVoice) Send(api *API) (*Message, error) { return api.SendVoice(x) }
// GetParseMode implements ParseModeSettable's GetParseMode method.
func (x *SendAnimation) GetParseMode() ParseMode { return x.ParseMode }
// SetParseMode implements ParseModeSettable's SetParseMode method.
func (x *SendAnimation) SetParseMode(mode ParseMode) { x.ParseMode = mode }
// GetParseMode implements ParseModeSettable's GetParseMode method.
func (x *SendAudio) GetParseMode() ParseMode { return x.ParseMode }
// SetParseMode implements ParseModeSettable's SetParseMode method.
func (x *SendAudio) SetParseMode(mode ParseMode) { x.ParseMode = mode }
// GetParseMode implements ParseModeSettable's GetParseMode method.
func (x *SendDocument) GetParseMode() ParseMode { return x.ParseMode }
// SetParseMode implements ParseModeSettable's SetParseMode method.
func (x *SendDocument) SetParseMode(mode ParseMode) { x.ParseMode = mode }
// GetParseMode implements ParseModeSettable's GetParseMode method.
func (x *SendMessage) GetParseMode() ParseMode { return x.ParseMode }
// SetParseMode implements ParseModeSettable's SetParseMode method.
func (x *SendMessage) SetParseMode(mode ParseMode) { x.ParseMode = mode }
// GetParseMode implements ParseModeSettable's GetParseMode method.
func (x *SendPhoto) GetParseMode() ParseMode { return x.ParseMode }
// SetParseMode implements ParseModeSettable's SetParseMode method.
func (x *SendPhoto) SetParseMode(mode ParseMode) { x.ParseMode = mode }
// GetParseMode implements ParseModeSettable's GetParseMode method.
func (x *SendVideo) GetParseMode() ParseMode { return x.ParseMode }
// SetParseMode implements ParseModeSettable's SetParseMode method.
func (x *SendVideo) SetParseMode(mode ParseMode) { x.ParseMode = mode }
// GetParseMode implements ParseModeSettable's GetParseMode method.
func (x *SendVoice) GetParseMode() ParseMode { return x.ParseMode }
// SetParseMode implements ParseModeSettable's SetParseMode method.
func (x *SendVoice) SetParseMode(mode ParseMode) { x.ParseMode = mode }
// SetReplyToMessageId implements Replyable's SetReplyToMessageId method.
func (x *SendAnimation) SetReplyToMessageId(id int64) {
x.ReplyParameters = &ReplyParameters{MessageId: id, ChatId: x.GetChatID()}
}
// SetReplyToMessageId implements Replyable's SetReplyToMessageId method.
func (x *SendAudio) SetReplyToMessageId(id int64) {
x.ReplyParameters = &ReplyParameters{MessageId: id, ChatId: x.GetChatID()}
}
// SetReplyToMessageId implements Replyable's SetReplyToMessageId method.
func (x *SendContact) SetReplyToMessageId(id int64) {
x.ReplyParameters = &ReplyParameters{MessageId: id, ChatId: x.GetChatID()}
}
// SetReplyToMessageId implements Replyable's SetReplyToMessageId method.
func (x *SendDice) SetReplyToMessageId(id int64) {
x.ReplyParameters = &ReplyParameters{MessageId: id, ChatId: x.GetChatID()}
}
// SetReplyToMessageId implements Replyable's SetReplyToMessageId method.
func (x *SendDocument) SetReplyToMessageId(id int64) {
x.ReplyParameters = &ReplyParameters{MessageId: id, ChatId: x.GetChatID()}
}
// SetReplyToMessageId implements Replyable's SetReplyToMessageId method.
func (x *SendGame) SetReplyToMessageId(id int64) {
x.ReplyParameters = &ReplyParameters{MessageId: id, ChatId: x.GetChatID()}
}
// SetReplyToMessageId implements Replyable's SetReplyToMessageId method.
func (x *SendInvoice) SetReplyToMessageId(id int64) {
x.ReplyParameters = &ReplyParameters{MessageId: id, ChatId: x.GetChatID()}
}
// SetReplyToMessageId implements Replyable's SetReplyToMessageId method.
func (x *SendLocation) SetReplyToMessageId(id int64) {
x.ReplyParameters = &ReplyParameters{MessageId: id, ChatId: x.GetChatID()}
}
// SetReplyToMessageId implements Replyable's SetReplyToMessageId method.
func (x *SendMessage) SetReplyToMessageId(id int64) {
x.ReplyParameters = &ReplyParameters{MessageId: id, ChatId: x.GetChatID()}
}
// SetReplyToMessageId implements Replyable's SetReplyToMessageId method.
func (x *SendPhoto) SetReplyToMessageId(id int64) {
x.ReplyParameters = &ReplyParameters{MessageId: id, ChatId: x.GetChatID()}
}
// SetReplyToMessageId implements Replyable's SetReplyToMessageId method.
func (x *SendPoll) SetReplyToMessageId(id int64) {
x.ReplyParameters = &ReplyParameters{MessageId: id, ChatId: x.GetChatID()}
}
// SetReplyToMessageId implements Replyable's SetReplyToMessageId method.
func (x *SendSticker) SetReplyToMessageId(id int64) {
x.ReplyParameters = &ReplyParameters{MessageId: id, ChatId: x.GetChatID()}
}
// SetReplyToMessageId implements Replyable's SetReplyToMessageId method.
func (x *SendVenue) SetReplyToMessageId(id int64) {
x.ReplyParameters = &ReplyParameters{MessageId: id, ChatId: x.GetChatID()}
}
// SetReplyToMessageId implements Replyable's SetReplyToMessageId method.
func (x *SendVideo) SetReplyToMessageId(id int64) {
x.ReplyParameters = &ReplyParameters{MessageId: id, ChatId: x.GetChatID()}
}
// SetReplyToMessageId implements Replyable's SetReplyToMessageId method.
func (x *SendVideoNote) SetReplyToMessageId(id int64) {
x.ReplyParameters = &ReplyParameters{MessageId: id, ChatId: x.GetChatID()}
}
// SetReplyToMessageId implements Replyable's SetReplyToMessageId method.
func (x *SendVoice) SetReplyToMessageId(id int64) {
x.ReplyParameters = &ReplyParameters{MessageId: id, ChatId: x.GetChatID()}
}