all repos — telegram-bot-api @ 8d14bd7a5608c3a9fb7459c37893dc977d968f4f

Golang bindings for the Telegram Bot API

helpers.go (view raw)

  1package tgbotapi
  2
  3import (
  4	"net/url"
  5)
  6
  7// NewMessage creates a new Message.
  8//
  9// chatID is where to send it, text is the message text.
 10func NewMessage(chatID int64, text string) MessageConfig {
 11	return MessageConfig{
 12		BaseChat: BaseChat{
 13			ChatID:           chatID,
 14			ReplyToMessageID: 0,
 15		},
 16		Text:                  text,
 17		DisableWebPagePreview: false,
 18	}
 19}
 20
 21// NewDeleteMessage creates a request to delete a message.
 22func NewDeleteMessage(chatID int64, messageID int) DeleteMessageConfig {
 23	return DeleteMessageConfig{
 24		ChatID:    chatID,
 25		MessageID: messageID,
 26	}
 27}
 28
 29// NewMessageToChannel creates a new Message that is sent to a channel
 30// by username.
 31//
 32// username is the username of the channel, text is the message text.
 33func NewMessageToChannel(username string, text string) MessageConfig {
 34	return MessageConfig{
 35		BaseChat: BaseChat{
 36			ChannelUsername: username,
 37		},
 38		Text: text,
 39	}
 40}
 41
 42// NewForward creates a new forward.
 43//
 44// chatID is where to send it, fromChatID is the source chat,
 45// and messageID is the ID of the original message.
 46func NewForward(chatID int64, fromChatID int64, messageID int) ForwardConfig {
 47	return ForwardConfig{
 48		BaseChat:   BaseChat{ChatID: chatID},
 49		FromChatID: fromChatID,
 50		MessageID:  messageID,
 51	}
 52}
 53
 54// NewPhoto creates a new sendPhoto request.
 55//
 56// Note that you must send animated GIFs as a document.
 57func NewPhoto(chatID int64, file interface{}) PhotoConfig {
 58	return PhotoConfig{
 59		BaseFile: BaseFile{
 60			BaseChat: BaseChat{ChatID: chatID},
 61			File:     file,
 62		},
 63	}
 64}
 65
 66// NewPhotoToChannel creates a new photo uploader to send a photo to a channel.
 67//
 68// Note that you must send animated GIFs as a document.
 69func NewPhotoToChannel(username string, file interface{}) PhotoConfig {
 70	return PhotoConfig{
 71		BaseFile: BaseFile{
 72			BaseChat: BaseChat{
 73				ChannelUsername: username,
 74			},
 75			File: file,
 76		},
 77	}
 78}
 79
 80// NewAudio creates a new sendAudio request.
 81func NewAudio(chatID int64, file interface{}) AudioConfig {
 82	return AudioConfig{
 83		BaseFile: BaseFile{
 84			BaseChat: BaseChat{ChatID: chatID},
 85			File:     file,
 86		},
 87	}
 88}
 89
 90// NewDocument creates a new sendDocument request.
 91func NewDocument(chatID int64, file interface{}) DocumentConfig {
 92	return DocumentConfig{
 93		BaseFile: BaseFile{
 94			BaseChat: BaseChat{ChatID: chatID},
 95			File:     file,
 96		},
 97	}
 98}
 99
100// NewSticker creates a new sendSticker request.
101func NewSticker(chatID int64, file interface{}) StickerConfig {
102	return StickerConfig{
103		BaseFile: BaseFile{
104			BaseChat: BaseChat{ChatID: chatID},
105			File:     file,
106		},
107	}
108}
109
110// NewVideo creates a new sendVideo request.
111func NewVideo(chatID int64, file interface{}) VideoConfig {
112	return VideoConfig{
113		BaseFile: BaseFile{
114			BaseChat: BaseChat{ChatID: chatID},
115			File:     file,
116		},
117	}
118}
119
120// NewAnimation creates a new sendAnimation request.
121func NewAnimation(chatID int64, file interface{}) AnimationConfig {
122	return AnimationConfig{
123		BaseFile: BaseFile{
124			BaseChat: BaseChat{ChatID: chatID},
125			File:     file,
126		},
127	}
128}
129
130// NewVideoNote creates a new sendVideoNote request.
131//
132// chatID is where to send it, file is a string path to the file,
133// FileReader, or FileBytes.
134func NewVideoNote(chatID int64, length int, file interface{}) VideoNoteConfig {
135	return VideoNoteConfig{
136		BaseFile: BaseFile{
137			BaseChat: BaseChat{ChatID: chatID},
138			File:     file,
139		},
140		Length: length,
141	}
142}
143
144// NewVoice creates a new sendVoice request.
145func NewVoice(chatID int64, file interface{}) VoiceConfig {
146	return VoiceConfig{
147		BaseFile: BaseFile{
148			BaseChat: BaseChat{ChatID: chatID},
149			File:     file,
150		},
151	}
152}
153
154// NewMediaGroup creates a new media group. Files should be an array of
155// two to ten InputMediaPhoto or InputMediaVideo.
156func NewMediaGroup(chatID int64, files []interface{}) MediaGroupConfig {
157	return MediaGroupConfig{
158		ChatID: chatID,
159		Media:  files,
160	}
161}
162
163// NewInputMediaPhoto creates a new InputMediaPhoto.
164func NewInputMediaPhoto(media interface{}) InputMediaPhoto {
165	return InputMediaPhoto{
166		BaseInputMedia{
167			Type:  "photo",
168			Media: media,
169		},
170	}
171}
172
173// NewInputMediaVideo creates a new InputMediaVideo.
174func NewInputMediaVideo(media interface{}) InputMediaVideo {
175	return InputMediaVideo{
176		BaseInputMedia: BaseInputMedia{
177			Type:  "video",
178			Media: media,
179		},
180	}
181}
182
183// NewInputMediaAnimation creates a new InputMediaAnimation.
184func NewInputMediaAnimation(media interface{}) InputMediaAnimation {
185	return InputMediaAnimation{
186		BaseInputMedia: BaseInputMedia{
187			Type:  "animation",
188			Media: media,
189		},
190	}
191}
192
193// NewInputMediaAudio creates a new InputMediaAudio.
194func NewInputMediaAudio(media interface{}) InputMediaAudio {
195	return InputMediaAudio{
196		BaseInputMedia: BaseInputMedia{
197			Type:  "audio",
198			Media: media,
199		},
200	}
201}
202
203// NewInputMediaDocument creates a new InputMediaDocument.
204func NewInputMediaDocument(media string) InputMediaDocument {
205	return InputMediaDocument{
206		BaseInputMedia: BaseInputMedia{
207			Type:  "document",
208			Media: media,
209		},
210	}
211}
212
213// NewContact allows you to send a shared contact.
214func NewContact(chatID int64, phoneNumber, firstName string) ContactConfig {
215	return ContactConfig{
216		BaseChat: BaseChat{
217			ChatID: chatID,
218		},
219		PhoneNumber: phoneNumber,
220		FirstName:   firstName,
221	}
222}
223
224// NewLocation shares your location.
225//
226// chatID is where to send it, latitude and longitude are coordinates.
227func NewLocation(chatID int64, latitude float64, longitude float64) LocationConfig {
228	return LocationConfig{
229		BaseChat: BaseChat{
230			ChatID: chatID,
231		},
232		Latitude:  latitude,
233		Longitude: longitude,
234	}
235}
236
237// NewVenue allows you to send a venue and its location.
238func NewVenue(chatID int64, title, address string, latitude, longitude float64) VenueConfig {
239	return VenueConfig{
240		BaseChat: BaseChat{
241			ChatID: chatID,
242		},
243		Title:     title,
244		Address:   address,
245		Latitude:  latitude,
246		Longitude: longitude,
247	}
248}
249
250// NewChatAction sets a chat action.
251// Actions last for 5 seconds, or until your next action.
252//
253// chatID is where to send it, action should be set via Chat constants.
254func NewChatAction(chatID int64, action string) ChatActionConfig {
255	return ChatActionConfig{
256		BaseChat: BaseChat{ChatID: chatID},
257		Action:   action,
258	}
259}
260
261// NewUserProfilePhotos gets user profile photos.
262//
263// userID is the ID of the user you wish to get profile photos from.
264func NewUserProfilePhotos(userID int) UserProfilePhotosConfig {
265	return UserProfilePhotosConfig{
266		UserID: userID,
267		Offset: 0,
268		Limit:  0,
269	}
270}
271
272// NewUpdate gets updates since the last Offset.
273//
274// offset is the last Update ID to include.
275// You likely want to set this to the last Update ID plus 1.
276func NewUpdate(offset int) UpdateConfig {
277	return UpdateConfig{
278		Offset:  offset,
279		Limit:   0,
280		Timeout: 0,
281	}
282}
283
284// NewWebhook creates a new webhook.
285//
286// link is the url parsable link you wish to get the updates.
287func NewWebhook(link string) WebhookConfig {
288	u, _ := url.Parse(link)
289
290	return WebhookConfig{
291		URL: u,
292	}
293}
294
295// NewWebhookWithCert creates a new webhook with a certificate.
296//
297// link is the url you wish to get webhooks,
298// file contains a string to a file, FileReader, or FileBytes.
299func NewWebhookWithCert(link string, file interface{}) WebhookConfig {
300	u, _ := url.Parse(link)
301
302	return WebhookConfig{
303		URL:         u,
304		Certificate: file,
305	}
306}
307
308// NewInlineQueryResultArticle creates a new inline query article.
309func NewInlineQueryResultArticle(id, title, messageText string) InlineQueryResultArticle {
310	return InlineQueryResultArticle{
311		Type:  "article",
312		ID:    id,
313		Title: title,
314		InputMessageContent: InputTextMessageContent{
315			Text: messageText,
316		},
317	}
318}
319
320// NewInlineQueryResultArticleMarkdown creates a new inline query article with Markdown parsing.
321func NewInlineQueryResultArticleMarkdown(id, title, messageText string) InlineQueryResultArticle {
322	return InlineQueryResultArticle{
323		Type:  "article",
324		ID:    id,
325		Title: title,
326		InputMessageContent: InputTextMessageContent{
327			Text:      messageText,
328			ParseMode: "Markdown",
329		},
330	}
331}
332
333// NewInlineQueryResultArticleMarkdownV2 creates a new inline query article with MarkdownV2 parsing.
334func NewInlineQueryResultArticleMarkdownV2(id, title, messageText string) InlineQueryResultArticle {
335	return InlineQueryResultArticle{
336		Type:  "article",
337		ID:    id,
338		Title: title,
339		InputMessageContent: InputTextMessageContent{
340			Text:      messageText,
341			ParseMode: "MarkdownV2",
342		},
343	}
344}
345
346// NewInlineQueryResultArticleHTML creates a new inline query article with HTML parsing.
347func NewInlineQueryResultArticleHTML(id, title, messageText string) InlineQueryResultArticle {
348	return InlineQueryResultArticle{
349		Type:  "article",
350		ID:    id,
351		Title: title,
352		InputMessageContent: InputTextMessageContent{
353			Text:      messageText,
354			ParseMode: "HTML",
355		},
356	}
357}
358
359// NewInlineQueryResultGIF creates a new inline query GIF.
360func NewInlineQueryResultGIF(id, url string) InlineQueryResultGIF {
361	return InlineQueryResultGIF{
362		Type: "gif",
363		ID:   id,
364		URL:  url,
365	}
366}
367
368// NewInlineQueryResultCachedGIF create a new inline query with cached photo.
369func NewInlineQueryResultCachedGIF(id, gifID string) InlineQueryResultCachedGIF {
370	return InlineQueryResultCachedGIF{
371		Type:  "gif",
372		ID:    id,
373		GifID: gifID,
374	}
375}
376
377// NewInlineQueryResultMPEG4GIF creates a new inline query MPEG4 GIF.
378func NewInlineQueryResultMPEG4GIF(id, url string) InlineQueryResultMPEG4GIF {
379	return InlineQueryResultMPEG4GIF{
380		Type: "mpeg4_gif",
381		ID:   id,
382		URL:  url,
383	}
384}
385
386// NewInlineQueryResultCachedMPEG4GIF create a new inline query with cached photo.
387func NewInlineQueryResultCachedMPEG4GIF(id, MPEG4GifID string) InlineQueryResultCachedMpeg4Gif {
388	return InlineQueryResultCachedMpeg4Gif{
389		Type:   "mpeg4_gif",
390		ID:     id,
391		MGifID: MPEG4GifID,
392	}
393}
394
395// NewInlineQueryResultPhoto creates a new inline query photo.
396func NewInlineQueryResultPhoto(id, url string) InlineQueryResultPhoto {
397	return InlineQueryResultPhoto{
398		Type: "photo",
399		ID:   id,
400		URL:  url,
401	}
402}
403
404// NewInlineQueryResultPhotoWithThumb creates a new inline query photo.
405func NewInlineQueryResultPhotoWithThumb(id, url, thumb string) InlineQueryResultPhoto {
406	return InlineQueryResultPhoto{
407		Type:     "photo",
408		ID:       id,
409		URL:      url,
410		ThumbURL: thumb,
411	}
412}
413
414// NewInlineQueryResultCachedPhoto create a new inline query with cached photo.
415func NewInlineQueryResultCachedPhoto(id, photoID string) InlineQueryResultCachedPhoto {
416	return InlineQueryResultCachedPhoto{
417		Type:    "photo",
418		ID:      id,
419		PhotoID: photoID,
420	}
421}
422
423// NewInlineQueryResultVideo creates a new inline query video.
424func NewInlineQueryResultVideo(id, url string) InlineQueryResultVideo {
425	return InlineQueryResultVideo{
426		Type: "video",
427		ID:   id,
428		URL:  url,
429	}
430}
431
432// NewInlineQueryResultCachedVideo create a new inline query with cached video.
433func NewInlineQueryResultCachedVideo(id, videoID, title string) InlineQueryResultCachedVideo {
434	return InlineQueryResultCachedVideo{
435		Type:    "video",
436		ID:      id,
437		VideoID: videoID,
438		Title:   title,
439	}
440}
441
442// NewInlineQueryResultCachedSticker create a new inline query with cached sticker.
443func NewInlineQueryResultCachedSticker(id, stickerID, title string) InlineQueryResultCachedSticker {
444	return InlineQueryResultCachedSticker{
445		Type:      "sticker",
446		ID:        id,
447		StickerID: stickerID,
448		Title:     title,
449	}
450}
451
452// NewInlineQueryResultAudio creates a new inline query audio.
453func NewInlineQueryResultAudio(id, url, title string) InlineQueryResultAudio {
454	return InlineQueryResultAudio{
455		Type:  "audio",
456		ID:    id,
457		URL:   url,
458		Title: title,
459	}
460}
461
462// NewInlineQueryResultCachedAudio create a new inline query with cached photo.
463func NewInlineQueryResultCachedAudio(id, audioID string) InlineQueryResultCachedAudio {
464	return InlineQueryResultCachedAudio{
465		Type:    "audio",
466		ID:      id,
467		AudioID: audioID,
468	}
469}
470
471// NewInlineQueryResultVoice creates a new inline query voice.
472func NewInlineQueryResultVoice(id, url, title string) InlineQueryResultVoice {
473	return InlineQueryResultVoice{
474		Type:  "voice",
475		ID:    id,
476		URL:   url,
477		Title: title,
478	}
479}
480
481// NewInlineQueryResultCachedVoice create a new inline query with cached photo.
482func NewInlineQueryResultCachedVoice(id, voiceID, title string) InlineQueryResultCachedVoice {
483	return InlineQueryResultCachedVoice{
484		Type:    "voice",
485		ID:      id,
486		VoiceID: voiceID,
487		Title:   title,
488	}
489}
490
491// NewInlineQueryResultDocument creates a new inline query document.
492func NewInlineQueryResultDocument(id, url, title, mimeType string) InlineQueryResultDocument {
493	return InlineQueryResultDocument{
494		Type:     "document",
495		ID:       id,
496		URL:      url,
497		Title:    title,
498		MimeType: mimeType,
499	}
500}
501
502// NewInlineQueryResultCachedDocument create a new inline query with cached photo.
503func NewInlineQueryResultCachedDocument(id, documentID, title string) InlineQueryResultCachedDocument {
504	return InlineQueryResultCachedDocument{
505		Type:       "document",
506		ID:         id,
507		DocumentID: documentID,
508		Title:      title,
509	}
510}
511
512// NewInlineQueryResultLocation creates a new inline query location.
513func NewInlineQueryResultLocation(id, title string, latitude, longitude float64) InlineQueryResultLocation {
514	return InlineQueryResultLocation{
515		Type:      "location",
516		ID:        id,
517		Title:     title,
518		Latitude:  latitude,
519		Longitude: longitude,
520	}
521}
522
523// NewInlineQueryResultVenue creates a new inline query venue.
524func NewInlineQueryResultVenue(id, title, address string, latitude, longitude float64) InlineQueryResultVenue {
525	return InlineQueryResultVenue{
526		Type:      "venue",
527		ID:        id,
528		Title:     title,
529		Address:   address,
530		Latitude:  latitude,
531		Longitude: longitude,
532	}
533}
534
535// NewEditMessageText allows you to edit the text of a message.
536func NewEditMessageText(chatID int64, messageID int, text string) EditMessageTextConfig {
537	return EditMessageTextConfig{
538		BaseEdit: BaseEdit{
539			ChatID:    chatID,
540			MessageID: messageID,
541		},
542		Text: text,
543	}
544}
545
546// NewEditMessageCaption allows you to edit the caption of a message.
547func NewEditMessageCaption(chatID int64, messageID int, caption string) EditMessageCaptionConfig {
548	return EditMessageCaptionConfig{
549		BaseEdit: BaseEdit{
550			ChatID:    chatID,
551			MessageID: messageID,
552		},
553		Caption: caption,
554	}
555}
556
557// NewEditMessageReplyMarkup allows you to edit the inline
558// keyboard markup.
559func NewEditMessageReplyMarkup(chatID int64, messageID int, replyMarkup InlineKeyboardMarkup) EditMessageReplyMarkupConfig {
560	return EditMessageReplyMarkupConfig{
561		BaseEdit: BaseEdit{
562			ChatID:      chatID,
563			MessageID:   messageID,
564			ReplyMarkup: &replyMarkup,
565		},
566	}
567}
568
569// NewHideKeyboard hides the keyboard, with the option for being selective
570// or hiding for everyone.
571func NewHideKeyboard(selective bool) ReplyKeyboardHide {
572	log.Println("NewHideKeyboard is deprecated, please use NewRemoveKeyboard")
573
574	return ReplyKeyboardHide{
575		HideKeyboard: true,
576		Selective:    selective,
577	}
578}
579
580// NewRemoveKeyboard hides the keyboard, with the option for being selective
581// or hiding for everyone.
582func NewRemoveKeyboard(selective bool) ReplyKeyboardRemove {
583	return ReplyKeyboardRemove{
584		RemoveKeyboard: true,
585		Selective:      selective,
586	}
587}
588
589// NewKeyboardButton creates a regular keyboard button.
590func NewKeyboardButton(text string) KeyboardButton {
591	return KeyboardButton{
592		Text: text,
593	}
594}
595
596// NewKeyboardButtonContact creates a keyboard button that requests
597// user contact information upon click.
598func NewKeyboardButtonContact(text string) KeyboardButton {
599	return KeyboardButton{
600		Text:           text,
601		RequestContact: true,
602	}
603}
604
605// NewKeyboardButtonLocation creates a keyboard button that requests
606// user location information upon click.
607func NewKeyboardButtonLocation(text string) KeyboardButton {
608	return KeyboardButton{
609		Text:            text,
610		RequestLocation: true,
611	}
612}
613
614// NewKeyboardButtonRow creates a row of keyboard buttons.
615func NewKeyboardButtonRow(buttons ...KeyboardButton) []KeyboardButton {
616	var row []KeyboardButton
617
618	row = append(row, buttons...)
619
620	return row
621}
622
623// NewReplyKeyboard creates a new regular keyboard with sane defaults.
624func NewReplyKeyboard(rows ...[]KeyboardButton) ReplyKeyboardMarkup {
625	var keyboard [][]KeyboardButton
626
627	keyboard = append(keyboard, rows...)
628
629	return ReplyKeyboardMarkup{
630		ResizeKeyboard: true,
631		Keyboard:       keyboard,
632	}
633}
634
635// NewOneTimeReplyKeyboard creates a new one time keyboard.
636func NewOneTimeReplyKeyboard(rows ...[]KeyboardButton) ReplyKeyboardMarkup {
637	markup := NewReplyKeyboard(rows...)
638	markup.OneTimeKeyboard = true
639	return markup
640}
641
642// NewInlineKeyboardButtonData creates an inline keyboard button with text
643// and data for a callback.
644func NewInlineKeyboardButtonData(text, data string) InlineKeyboardButton {
645	return InlineKeyboardButton{
646		Text:         text,
647		CallbackData: &data,
648	}
649}
650
651// NewInlineKeyboardButtonURL creates an inline keyboard button with text
652// which goes to a URL.
653func NewInlineKeyboardButtonURL(text, url string) InlineKeyboardButton {
654	return InlineKeyboardButton{
655		Text: text,
656		URL:  &url,
657	}
658}
659
660// NewInlineKeyboardButtonSwitch creates an inline keyboard button with
661// text which allows the user to switch to a chat or return to a chat.
662func NewInlineKeyboardButtonSwitch(text, sw string) InlineKeyboardButton {
663	return InlineKeyboardButton{
664		Text:              text,
665		SwitchInlineQuery: &sw,
666	}
667}
668
669// NewInlineKeyboardRow creates an inline keyboard row with buttons.
670func NewInlineKeyboardRow(buttons ...InlineKeyboardButton) []InlineKeyboardButton {
671	var row []InlineKeyboardButton
672
673	row = append(row, buttons...)
674
675	return row
676}
677
678// NewInlineKeyboardMarkup creates a new inline keyboard.
679func NewInlineKeyboardMarkup(rows ...[]InlineKeyboardButton) InlineKeyboardMarkup {
680	var keyboard [][]InlineKeyboardButton
681
682	keyboard = append(keyboard, rows...)
683
684	return InlineKeyboardMarkup{
685		InlineKeyboard: keyboard,
686	}
687}
688
689// NewCallback creates a new callback message.
690func NewCallback(id, text string) CallbackConfig {
691	return CallbackConfig{
692		CallbackQueryID: id,
693		Text:            text,
694		ShowAlert:       false,
695	}
696}
697
698// NewCallbackWithAlert creates a new callback message that alerts
699// the user.
700func NewCallbackWithAlert(id, text string) CallbackConfig {
701	return CallbackConfig{
702		CallbackQueryID: id,
703		Text:            text,
704		ShowAlert:       true,
705	}
706}
707
708// NewInvoice creates a new Invoice request to the user.
709func NewInvoice(chatID int64, title, description, payload, providerToken, startParameter, currency string, prices []LabeledPrice) InvoiceConfig {
710	return InvoiceConfig{
711		BaseChat:       BaseChat{ChatID: chatID},
712		Title:          title,
713		Description:    description,
714		Payload:        payload,
715		ProviderToken:  providerToken,
716		StartParameter: startParameter,
717		Currency:       currency,
718		Prices:         prices}
719}
720
721// NewChatTitle allows you to update the title of a chat.
722func NewChatTitle(chatID int64, title string) SetChatTitleConfig {
723	return SetChatTitleConfig{
724		ChatID: chatID,
725		Title:  title,
726	}
727}
728
729// NewChatDescription allows you to update the description of a chat.
730func NewChatDescription(chatID int64, description string) SetChatDescriptionConfig {
731	return SetChatDescriptionConfig{
732		ChatID:      chatID,
733		Description: description,
734	}
735}
736
737// NewChatPhoto allows you to update the photo for a chat.
738func NewChatPhoto(chatID int64, photo interface{}) SetChatPhotoConfig {
739	return SetChatPhotoConfig{
740		BaseFile: BaseFile{
741			BaseChat: BaseChat{
742				ChatID: chatID,
743			},
744			File: photo,
745		},
746	}
747}
748
749// NewDeleteChatPhoto allows you to delete the photo for a chat.
750func NewDeleteChatPhoto(chatID int64, photo interface{}) DeleteChatPhotoConfig {
751	return DeleteChatPhotoConfig{
752		ChatID: chatID,
753	}
754}
755
756// NewPoll allows you to create a new poll.
757func NewPoll(chatID int64, question string, options ...string) SendPollConfig {
758	return SendPollConfig{
759		BaseChat: BaseChat{
760			ChatID: chatID,
761		},
762		Question:    question,
763		Options:     options,
764		IsAnonymous: true, // This is Telegram's default.
765	}
766}
767
768// NewStopPoll allows you to stop a poll.
769func NewStopPoll(chatID int64, messageID int) StopPollConfig {
770	return StopPollConfig{
771		BaseEdit{
772			ChatID:    chatID,
773			MessageID: messageID,
774		},
775	}
776}
777
778// NewSendDice allows you to send a random dice roll.
779//
780// Deprecated: Use NewDice instead.
781func NewSendDice(chatID int64) DiceConfig {
782	return NewDice(chatID)
783}
784
785// NewDice allows you to send a random dice roll.
786func NewDice(chatID int64) DiceConfig {
787	return DiceConfig{
788		BaseChat: BaseChat{
789			ChatID: chatID,
790		},
791	}
792}
793
794// NewDiceWithEmoji allows you to send a random roll of one of many types.
795//
796// Emoji may be 🎲 (1-6), 🎯 (1-6), or 🏀 (1-5).
797func NewDiceWithEmoji(chatID int64, emoji string) DiceConfig {
798	return DiceConfig{
799		BaseChat: BaseChat{
800			ChatID: chatID,
801		},
802		Emoji: emoji,
803	}
804}
805
806// NewSetMyCommands allows you to set the registered commands.
807func NewSetMyCommands(commands ...BotCommand) SetMyCommandsConfig {
808	return SetMyCommandsConfig{commands: commands}
809}