id int32 0 167k | repo stringlengths 5 54 | path stringlengths 4 155 | func_name stringlengths 1 118 | original_string stringlengths 52 85.5k | language stringclasses 1
value | code stringlengths 52 85.5k | code_tokens listlengths 21 1.41k | docstring stringlengths 6 2.61k | docstring_tokens listlengths 3 215 | sha stringlengths 40 40 | url stringlengths 85 252 |
|---|---|---|---|---|---|---|---|---|---|---|---|
31,300 | go-telegram-bot-api/telegram-bot-api | helpers.go | NewStickerShare | func NewStickerShare(chatID int64, fileID string) StickerConfig {
return StickerConfig{
BaseFile: BaseFile{
BaseChat: BaseChat{ChatID: chatID},
FileID: fileID,
UseExisting: true,
},
}
} | go | func NewStickerShare(chatID int64, fileID string) StickerConfig {
return StickerConfig{
BaseFile: BaseFile{
BaseChat: BaseChat{ChatID: chatID},
FileID: fileID,
UseExisting: true,
},
}
} | [
"func",
"NewStickerShare",
"(",
"chatID",
"int64",
",",
"fileID",
"string",
")",
"StickerConfig",
"{",
"return",
"StickerConfig",
"{",
"BaseFile",
":",
"BaseFile",
"{",
"BaseChat",
":",
"BaseChat",
"{",
"ChatID",
":",
"chatID",
"}",
",",
"FileID",
":",
"file... | // NewStickerShare shares an existing sticker.
// You may use this to reshare an existing sticker without
// reuploading it.
//
// chatID is where to send it, fileID is the ID of the sticker
// already uploaded. | [
"NewStickerShare",
"shares",
"an",
"existing",
"sticker",
".",
"You",
"may",
"use",
"this",
"to",
"reshare",
"an",
"existing",
"sticker",
"without",
"reuploading",
"it",
".",
"chatID",
"is",
"where",
"to",
"send",
"it",
"fileID",
"is",
"the",
"ID",
"of",
"... | 87e7035a900c7cb1fd896e5f33b461c96c3ac31e | https://github.com/go-telegram-bot-api/telegram-bot-api/blob/87e7035a900c7cb1fd896e5f33b461c96c3ac31e/helpers.go#L165-L173 |
31,301 | go-telegram-bot-api/telegram-bot-api | helpers.go | NewVideoUpload | func NewVideoUpload(chatID int64, file interface{}) VideoConfig {
return VideoConfig{
BaseFile: BaseFile{
BaseChat: BaseChat{ChatID: chatID},
File: file,
UseExisting: false,
},
}
} | go | func NewVideoUpload(chatID int64, file interface{}) VideoConfig {
return VideoConfig{
BaseFile: BaseFile{
BaseChat: BaseChat{ChatID: chatID},
File: file,
UseExisting: false,
},
}
} | [
"func",
"NewVideoUpload",
"(",
"chatID",
"int64",
",",
"file",
"interface",
"{",
"}",
")",
"VideoConfig",
"{",
"return",
"VideoConfig",
"{",
"BaseFile",
":",
"BaseFile",
"{",
"BaseChat",
":",
"BaseChat",
"{",
"ChatID",
":",
"chatID",
"}",
",",
"File",
":",... | // NewVideoUpload creates a new video uploader.
//
// chatID is where to send it, file is a string path to the file,
// FileReader, or FileBytes. | [
"NewVideoUpload",
"creates",
"a",
"new",
"video",
"uploader",
".",
"chatID",
"is",
"where",
"to",
"send",
"it",
"file",
"is",
"a",
"string",
"path",
"to",
"the",
"file",
"FileReader",
"or",
"FileBytes",
"."
] | 87e7035a900c7cb1fd896e5f33b461c96c3ac31e | https://github.com/go-telegram-bot-api/telegram-bot-api/blob/87e7035a900c7cb1fd896e5f33b461c96c3ac31e/helpers.go#L179-L187 |
31,302 | go-telegram-bot-api/telegram-bot-api | helpers.go | NewVideoShare | func NewVideoShare(chatID int64, fileID string) VideoConfig {
return VideoConfig{
BaseFile: BaseFile{
BaseChat: BaseChat{ChatID: chatID},
FileID: fileID,
UseExisting: true,
},
}
} | go | func NewVideoShare(chatID int64, fileID string) VideoConfig {
return VideoConfig{
BaseFile: BaseFile{
BaseChat: BaseChat{ChatID: chatID},
FileID: fileID,
UseExisting: true,
},
}
} | [
"func",
"NewVideoShare",
"(",
"chatID",
"int64",
",",
"fileID",
"string",
")",
"VideoConfig",
"{",
"return",
"VideoConfig",
"{",
"BaseFile",
":",
"BaseFile",
"{",
"BaseChat",
":",
"BaseChat",
"{",
"ChatID",
":",
"chatID",
"}",
",",
"FileID",
":",
"fileID",
... | // NewVideoShare shares an existing video.
// You may use this to reshare an existing video without reuploading it.
//
// chatID is where to send it, fileID is the ID of the video
// already uploaded. | [
"NewVideoShare",
"shares",
"an",
"existing",
"video",
".",
"You",
"may",
"use",
"this",
"to",
"reshare",
"an",
"existing",
"video",
"without",
"reuploading",
"it",
".",
"chatID",
"is",
"where",
"to",
"send",
"it",
"fileID",
"is",
"the",
"ID",
"of",
"the",
... | 87e7035a900c7cb1fd896e5f33b461c96c3ac31e | https://github.com/go-telegram-bot-api/telegram-bot-api/blob/87e7035a900c7cb1fd896e5f33b461c96c3ac31e/helpers.go#L194-L202 |
31,303 | go-telegram-bot-api/telegram-bot-api | helpers.go | NewAnimationUpload | func NewAnimationUpload(chatID int64, file interface{}) AnimationConfig {
return AnimationConfig{
BaseFile: BaseFile{
BaseChat: BaseChat{ChatID: chatID},
File: file,
UseExisting: false,
},
}
} | go | func NewAnimationUpload(chatID int64, file interface{}) AnimationConfig {
return AnimationConfig{
BaseFile: BaseFile{
BaseChat: BaseChat{ChatID: chatID},
File: file,
UseExisting: false,
},
}
} | [
"func",
"NewAnimationUpload",
"(",
"chatID",
"int64",
",",
"file",
"interface",
"{",
"}",
")",
"AnimationConfig",
"{",
"return",
"AnimationConfig",
"{",
"BaseFile",
":",
"BaseFile",
"{",
"BaseChat",
":",
"BaseChat",
"{",
"ChatID",
":",
"chatID",
"}",
",",
"F... | // NewAnimationUpload creates a new animation uploader.
//
// chatID is where to send it, file is a string path to the file,
// FileReader, or FileBytes. | [
"NewAnimationUpload",
"creates",
"a",
"new",
"animation",
"uploader",
".",
"chatID",
"is",
"where",
"to",
"send",
"it",
"file",
"is",
"a",
"string",
"path",
"to",
"the",
"file",
"FileReader",
"or",
"FileBytes",
"."
] | 87e7035a900c7cb1fd896e5f33b461c96c3ac31e | https://github.com/go-telegram-bot-api/telegram-bot-api/blob/87e7035a900c7cb1fd896e5f33b461c96c3ac31e/helpers.go#L208-L216 |
31,304 | go-telegram-bot-api/telegram-bot-api | helpers.go | NewAnimationShare | func NewAnimationShare(chatID int64, fileID string) AnimationConfig {
return AnimationConfig{
BaseFile: BaseFile{
BaseChat: BaseChat{ChatID: chatID},
FileID: fileID,
UseExisting: true,
},
}
} | go | func NewAnimationShare(chatID int64, fileID string) AnimationConfig {
return AnimationConfig{
BaseFile: BaseFile{
BaseChat: BaseChat{ChatID: chatID},
FileID: fileID,
UseExisting: true,
},
}
} | [
"func",
"NewAnimationShare",
"(",
"chatID",
"int64",
",",
"fileID",
"string",
")",
"AnimationConfig",
"{",
"return",
"AnimationConfig",
"{",
"BaseFile",
":",
"BaseFile",
"{",
"BaseChat",
":",
"BaseChat",
"{",
"ChatID",
":",
"chatID",
"}",
",",
"FileID",
":",
... | // NewAnimationShare shares an existing animation.
// You may use this to reshare an existing animation without reuploading it.
//
// chatID is where to send it, fileID is the ID of the animation
// already uploaded. | [
"NewAnimationShare",
"shares",
"an",
"existing",
"animation",
".",
"You",
"may",
"use",
"this",
"to",
"reshare",
"an",
"existing",
"animation",
"without",
"reuploading",
"it",
".",
"chatID",
"is",
"where",
"to",
"send",
"it",
"fileID",
"is",
"the",
"ID",
"of... | 87e7035a900c7cb1fd896e5f33b461c96c3ac31e | https://github.com/go-telegram-bot-api/telegram-bot-api/blob/87e7035a900c7cb1fd896e5f33b461c96c3ac31e/helpers.go#L223-L231 |
31,305 | go-telegram-bot-api/telegram-bot-api | helpers.go | NewVideoNoteUpload | func NewVideoNoteUpload(chatID int64, length int, file interface{}) VideoNoteConfig {
return VideoNoteConfig{
BaseFile: BaseFile{
BaseChat: BaseChat{ChatID: chatID},
File: file,
UseExisting: false,
},
Length: length,
}
} | go | func NewVideoNoteUpload(chatID int64, length int, file interface{}) VideoNoteConfig {
return VideoNoteConfig{
BaseFile: BaseFile{
BaseChat: BaseChat{ChatID: chatID},
File: file,
UseExisting: false,
},
Length: length,
}
} | [
"func",
"NewVideoNoteUpload",
"(",
"chatID",
"int64",
",",
"length",
"int",
",",
"file",
"interface",
"{",
"}",
")",
"VideoNoteConfig",
"{",
"return",
"VideoNoteConfig",
"{",
"BaseFile",
":",
"BaseFile",
"{",
"BaseChat",
":",
"BaseChat",
"{",
"ChatID",
":",
... | // NewVideoNoteUpload creates a new video note uploader.
//
// chatID is where to send it, file is a string path to the file,
// FileReader, or FileBytes. | [
"NewVideoNoteUpload",
"creates",
"a",
"new",
"video",
"note",
"uploader",
".",
"chatID",
"is",
"where",
"to",
"send",
"it",
"file",
"is",
"a",
"string",
"path",
"to",
"the",
"file",
"FileReader",
"or",
"FileBytes",
"."
] | 87e7035a900c7cb1fd896e5f33b461c96c3ac31e | https://github.com/go-telegram-bot-api/telegram-bot-api/blob/87e7035a900c7cb1fd896e5f33b461c96c3ac31e/helpers.go#L237-L246 |
31,306 | go-telegram-bot-api/telegram-bot-api | helpers.go | NewVideoNoteShare | func NewVideoNoteShare(chatID int64, length int, fileID string) VideoNoteConfig {
return VideoNoteConfig{
BaseFile: BaseFile{
BaseChat: BaseChat{ChatID: chatID},
FileID: fileID,
UseExisting: true,
},
Length: length,
}
} | go | func NewVideoNoteShare(chatID int64, length int, fileID string) VideoNoteConfig {
return VideoNoteConfig{
BaseFile: BaseFile{
BaseChat: BaseChat{ChatID: chatID},
FileID: fileID,
UseExisting: true,
},
Length: length,
}
} | [
"func",
"NewVideoNoteShare",
"(",
"chatID",
"int64",
",",
"length",
"int",
",",
"fileID",
"string",
")",
"VideoNoteConfig",
"{",
"return",
"VideoNoteConfig",
"{",
"BaseFile",
":",
"BaseFile",
"{",
"BaseChat",
":",
"BaseChat",
"{",
"ChatID",
":",
"chatID",
"}",... | // NewVideoNoteShare shares an existing video.
// You may use this to reshare an existing video without reuploading it.
//
// chatID is where to send it, fileID is the ID of the video
// already uploaded. | [
"NewVideoNoteShare",
"shares",
"an",
"existing",
"video",
".",
"You",
"may",
"use",
"this",
"to",
"reshare",
"an",
"existing",
"video",
"without",
"reuploading",
"it",
".",
"chatID",
"is",
"where",
"to",
"send",
"it",
"fileID",
"is",
"the",
"ID",
"of",
"th... | 87e7035a900c7cb1fd896e5f33b461c96c3ac31e | https://github.com/go-telegram-bot-api/telegram-bot-api/blob/87e7035a900c7cb1fd896e5f33b461c96c3ac31e/helpers.go#L253-L262 |
31,307 | go-telegram-bot-api/telegram-bot-api | helpers.go | NewVoiceUpload | func NewVoiceUpload(chatID int64, file interface{}) VoiceConfig {
return VoiceConfig{
BaseFile: BaseFile{
BaseChat: BaseChat{ChatID: chatID},
File: file,
UseExisting: false,
},
}
} | go | func NewVoiceUpload(chatID int64, file interface{}) VoiceConfig {
return VoiceConfig{
BaseFile: BaseFile{
BaseChat: BaseChat{ChatID: chatID},
File: file,
UseExisting: false,
},
}
} | [
"func",
"NewVoiceUpload",
"(",
"chatID",
"int64",
",",
"file",
"interface",
"{",
"}",
")",
"VoiceConfig",
"{",
"return",
"VoiceConfig",
"{",
"BaseFile",
":",
"BaseFile",
"{",
"BaseChat",
":",
"BaseChat",
"{",
"ChatID",
":",
"chatID",
"}",
",",
"File",
":",... | // NewVoiceUpload creates a new voice uploader.
//
// chatID is where to send it, file is a string path to the file,
// FileReader, or FileBytes. | [
"NewVoiceUpload",
"creates",
"a",
"new",
"voice",
"uploader",
".",
"chatID",
"is",
"where",
"to",
"send",
"it",
"file",
"is",
"a",
"string",
"path",
"to",
"the",
"file",
"FileReader",
"or",
"FileBytes",
"."
] | 87e7035a900c7cb1fd896e5f33b461c96c3ac31e | https://github.com/go-telegram-bot-api/telegram-bot-api/blob/87e7035a900c7cb1fd896e5f33b461c96c3ac31e/helpers.go#L268-L276 |
31,308 | go-telegram-bot-api/telegram-bot-api | helpers.go | NewVoiceShare | func NewVoiceShare(chatID int64, fileID string) VoiceConfig {
return VoiceConfig{
BaseFile: BaseFile{
BaseChat: BaseChat{ChatID: chatID},
FileID: fileID,
UseExisting: true,
},
}
} | go | func NewVoiceShare(chatID int64, fileID string) VoiceConfig {
return VoiceConfig{
BaseFile: BaseFile{
BaseChat: BaseChat{ChatID: chatID},
FileID: fileID,
UseExisting: true,
},
}
} | [
"func",
"NewVoiceShare",
"(",
"chatID",
"int64",
",",
"fileID",
"string",
")",
"VoiceConfig",
"{",
"return",
"VoiceConfig",
"{",
"BaseFile",
":",
"BaseFile",
"{",
"BaseChat",
":",
"BaseChat",
"{",
"ChatID",
":",
"chatID",
"}",
",",
"FileID",
":",
"fileID",
... | // NewVoiceShare shares an existing voice.
// You may use this to reshare an existing voice without reuploading it.
//
// chatID is where to send it, fileID is the ID of the video
// already uploaded. | [
"NewVoiceShare",
"shares",
"an",
"existing",
"voice",
".",
"You",
"may",
"use",
"this",
"to",
"reshare",
"an",
"existing",
"voice",
"without",
"reuploading",
"it",
".",
"chatID",
"is",
"where",
"to",
"send",
"it",
"fileID",
"is",
"the",
"ID",
"of",
"the",
... | 87e7035a900c7cb1fd896e5f33b461c96c3ac31e | https://github.com/go-telegram-bot-api/telegram-bot-api/blob/87e7035a900c7cb1fd896e5f33b461c96c3ac31e/helpers.go#L283-L291 |
31,309 | go-telegram-bot-api/telegram-bot-api | helpers.go | NewMediaGroup | func NewMediaGroup(chatID int64, files []interface{}) MediaGroupConfig {
return MediaGroupConfig{
BaseChat: BaseChat{
ChatID: chatID,
},
InputMedia: files,
}
} | go | func NewMediaGroup(chatID int64, files []interface{}) MediaGroupConfig {
return MediaGroupConfig{
BaseChat: BaseChat{
ChatID: chatID,
},
InputMedia: files,
}
} | [
"func",
"NewMediaGroup",
"(",
"chatID",
"int64",
",",
"files",
"[",
"]",
"interface",
"{",
"}",
")",
"MediaGroupConfig",
"{",
"return",
"MediaGroupConfig",
"{",
"BaseChat",
":",
"BaseChat",
"{",
"ChatID",
":",
"chatID",
",",
"}",
",",
"InputMedia",
":",
"f... | // NewMediaGroup creates a new media group. Files should be an array of
// two to ten InputMediaPhoto or InputMediaVideo. | [
"NewMediaGroup",
"creates",
"a",
"new",
"media",
"group",
".",
"Files",
"should",
"be",
"an",
"array",
"of",
"two",
"to",
"ten",
"InputMediaPhoto",
"or",
"InputMediaVideo",
"."
] | 87e7035a900c7cb1fd896e5f33b461c96c3ac31e | https://github.com/go-telegram-bot-api/telegram-bot-api/blob/87e7035a900c7cb1fd896e5f33b461c96c3ac31e/helpers.go#L295-L302 |
31,310 | go-telegram-bot-api/telegram-bot-api | helpers.go | NewContact | func NewContact(chatID int64, phoneNumber, firstName string) ContactConfig {
return ContactConfig{
BaseChat: BaseChat{
ChatID: chatID,
},
PhoneNumber: phoneNumber,
FirstName: firstName,
}
} | go | func NewContact(chatID int64, phoneNumber, firstName string) ContactConfig {
return ContactConfig{
BaseChat: BaseChat{
ChatID: chatID,
},
PhoneNumber: phoneNumber,
FirstName: firstName,
}
} | [
"func",
"NewContact",
"(",
"chatID",
"int64",
",",
"phoneNumber",
",",
"firstName",
"string",
")",
"ContactConfig",
"{",
"return",
"ContactConfig",
"{",
"BaseChat",
":",
"BaseChat",
"{",
"ChatID",
":",
"chatID",
",",
"}",
",",
"PhoneNumber",
":",
"phoneNumber"... | // NewContact allows you to send a shared contact. | [
"NewContact",
"allows",
"you",
"to",
"send",
"a",
"shared",
"contact",
"."
] | 87e7035a900c7cb1fd896e5f33b461c96c3ac31e | https://github.com/go-telegram-bot-api/telegram-bot-api/blob/87e7035a900c7cb1fd896e5f33b461c96c3ac31e/helpers.go#L321-L329 |
31,311 | go-telegram-bot-api/telegram-bot-api | helpers.go | NewLocation | func NewLocation(chatID int64, latitude float64, longitude float64) LocationConfig {
return LocationConfig{
BaseChat: BaseChat{
ChatID: chatID,
},
Latitude: latitude,
Longitude: longitude,
}
} | go | func NewLocation(chatID int64, latitude float64, longitude float64) LocationConfig {
return LocationConfig{
BaseChat: BaseChat{
ChatID: chatID,
},
Latitude: latitude,
Longitude: longitude,
}
} | [
"func",
"NewLocation",
"(",
"chatID",
"int64",
",",
"latitude",
"float64",
",",
"longitude",
"float64",
")",
"LocationConfig",
"{",
"return",
"LocationConfig",
"{",
"BaseChat",
":",
"BaseChat",
"{",
"ChatID",
":",
"chatID",
",",
"}",
",",
"Latitude",
":",
"l... | // NewLocation shares your location.
//
// chatID is where to send it, latitude and longitude are coordinates. | [
"NewLocation",
"shares",
"your",
"location",
".",
"chatID",
"is",
"where",
"to",
"send",
"it",
"latitude",
"and",
"longitude",
"are",
"coordinates",
"."
] | 87e7035a900c7cb1fd896e5f33b461c96c3ac31e | https://github.com/go-telegram-bot-api/telegram-bot-api/blob/87e7035a900c7cb1fd896e5f33b461c96c3ac31e/helpers.go#L334-L342 |
31,312 | go-telegram-bot-api/telegram-bot-api | helpers.go | NewVenue | func NewVenue(chatID int64, title, address string, latitude, longitude float64) VenueConfig {
return VenueConfig{
BaseChat: BaseChat{
ChatID: chatID,
},
Title: title,
Address: address,
Latitude: latitude,
Longitude: longitude,
}
} | go | func NewVenue(chatID int64, title, address string, latitude, longitude float64) VenueConfig {
return VenueConfig{
BaseChat: BaseChat{
ChatID: chatID,
},
Title: title,
Address: address,
Latitude: latitude,
Longitude: longitude,
}
} | [
"func",
"NewVenue",
"(",
"chatID",
"int64",
",",
"title",
",",
"address",
"string",
",",
"latitude",
",",
"longitude",
"float64",
")",
"VenueConfig",
"{",
"return",
"VenueConfig",
"{",
"BaseChat",
":",
"BaseChat",
"{",
"ChatID",
":",
"chatID",
",",
"}",
",... | // NewVenue allows you to send a venue and its location. | [
"NewVenue",
"allows",
"you",
"to",
"send",
"a",
"venue",
"and",
"its",
"location",
"."
] | 87e7035a900c7cb1fd896e5f33b461c96c3ac31e | https://github.com/go-telegram-bot-api/telegram-bot-api/blob/87e7035a900c7cb1fd896e5f33b461c96c3ac31e/helpers.go#L345-L355 |
31,313 | go-telegram-bot-api/telegram-bot-api | helpers.go | NewChatAction | func NewChatAction(chatID int64, action string) ChatActionConfig {
return ChatActionConfig{
BaseChat: BaseChat{ChatID: chatID},
Action: action,
}
} | go | func NewChatAction(chatID int64, action string) ChatActionConfig {
return ChatActionConfig{
BaseChat: BaseChat{ChatID: chatID},
Action: action,
}
} | [
"func",
"NewChatAction",
"(",
"chatID",
"int64",
",",
"action",
"string",
")",
"ChatActionConfig",
"{",
"return",
"ChatActionConfig",
"{",
"BaseChat",
":",
"BaseChat",
"{",
"ChatID",
":",
"chatID",
"}",
",",
"Action",
":",
"action",
",",
"}",
"\n",
"}"
] | // NewChatAction sets a chat action.
// Actions last for 5 seconds, or until your next action.
//
// chatID is where to send it, action should be set via Chat constants. | [
"NewChatAction",
"sets",
"a",
"chat",
"action",
".",
"Actions",
"last",
"for",
"5",
"seconds",
"or",
"until",
"your",
"next",
"action",
".",
"chatID",
"is",
"where",
"to",
"send",
"it",
"action",
"should",
"be",
"set",
"via",
"Chat",
"constants",
"."
] | 87e7035a900c7cb1fd896e5f33b461c96c3ac31e | https://github.com/go-telegram-bot-api/telegram-bot-api/blob/87e7035a900c7cb1fd896e5f33b461c96c3ac31e/helpers.go#L361-L366 |
31,314 | go-telegram-bot-api/telegram-bot-api | helpers.go | NewWebhook | func NewWebhook(link string) WebhookConfig {
u, _ := url.Parse(link)
return WebhookConfig{
URL: u,
}
} | go | func NewWebhook(link string) WebhookConfig {
u, _ := url.Parse(link)
return WebhookConfig{
URL: u,
}
} | [
"func",
"NewWebhook",
"(",
"link",
"string",
")",
"WebhookConfig",
"{",
"u",
",",
"_",
":=",
"url",
".",
"Parse",
"(",
"link",
")",
"\n\n",
"return",
"WebhookConfig",
"{",
"URL",
":",
"u",
",",
"}",
"\n",
"}"
] | // NewWebhook creates a new webhook.
//
// link is the url parsable link you wish to get the updates. | [
"NewWebhook",
"creates",
"a",
"new",
"webhook",
".",
"link",
"is",
"the",
"url",
"parsable",
"link",
"you",
"wish",
"to",
"get",
"the",
"updates",
"."
] | 87e7035a900c7cb1fd896e5f33b461c96c3ac31e | https://github.com/go-telegram-bot-api/telegram-bot-api/blob/87e7035a900c7cb1fd896e5f33b461c96c3ac31e/helpers.go#L394-L400 |
31,315 | go-telegram-bot-api/telegram-bot-api | helpers.go | NewWebhookWithCert | func NewWebhookWithCert(link string, file interface{}) WebhookConfig {
u, _ := url.Parse(link)
return WebhookConfig{
URL: u,
Certificate: file,
}
} | go | func NewWebhookWithCert(link string, file interface{}) WebhookConfig {
u, _ := url.Parse(link)
return WebhookConfig{
URL: u,
Certificate: file,
}
} | [
"func",
"NewWebhookWithCert",
"(",
"link",
"string",
",",
"file",
"interface",
"{",
"}",
")",
"WebhookConfig",
"{",
"u",
",",
"_",
":=",
"url",
".",
"Parse",
"(",
"link",
")",
"\n\n",
"return",
"WebhookConfig",
"{",
"URL",
":",
"u",
",",
"Certificate",
... | // NewWebhookWithCert creates a new webhook with a certificate.
//
// link is the url you wish to get webhooks,
// file contains a string to a file, FileReader, or FileBytes. | [
"NewWebhookWithCert",
"creates",
"a",
"new",
"webhook",
"with",
"a",
"certificate",
".",
"link",
"is",
"the",
"url",
"you",
"wish",
"to",
"get",
"webhooks",
"file",
"contains",
"a",
"string",
"to",
"a",
"file",
"FileReader",
"or",
"FileBytes",
"."
] | 87e7035a900c7cb1fd896e5f33b461c96c3ac31e | https://github.com/go-telegram-bot-api/telegram-bot-api/blob/87e7035a900c7cb1fd896e5f33b461c96c3ac31e/helpers.go#L406-L413 |
31,316 | go-telegram-bot-api/telegram-bot-api | helpers.go | NewInlineQueryResultArticle | func NewInlineQueryResultArticle(id, title, messageText string) InlineQueryResultArticle {
return InlineQueryResultArticle{
Type: "article",
ID: id,
Title: title,
InputMessageContent: InputTextMessageContent{
Text: messageText,
},
}
} | go | func NewInlineQueryResultArticle(id, title, messageText string) InlineQueryResultArticle {
return InlineQueryResultArticle{
Type: "article",
ID: id,
Title: title,
InputMessageContent: InputTextMessageContent{
Text: messageText,
},
}
} | [
"func",
"NewInlineQueryResultArticle",
"(",
"id",
",",
"title",
",",
"messageText",
"string",
")",
"InlineQueryResultArticle",
"{",
"return",
"InlineQueryResultArticle",
"{",
"Type",
":",
"\"",
"\"",
",",
"ID",
":",
"id",
",",
"Title",
":",
"title",
",",
"Inpu... | // NewInlineQueryResultArticle creates a new inline query article. | [
"NewInlineQueryResultArticle",
"creates",
"a",
"new",
"inline",
"query",
"article",
"."
] | 87e7035a900c7cb1fd896e5f33b461c96c3ac31e | https://github.com/go-telegram-bot-api/telegram-bot-api/blob/87e7035a900c7cb1fd896e5f33b461c96c3ac31e/helpers.go#L416-L425 |
31,317 | go-telegram-bot-api/telegram-bot-api | helpers.go | NewInlineQueryResultArticleMarkdown | func NewInlineQueryResultArticleMarkdown(id, title, messageText string) InlineQueryResultArticle {
return InlineQueryResultArticle{
Type: "article",
ID: id,
Title: title,
InputMessageContent: InputTextMessageContent{
Text: messageText,
ParseMode: "Markdown",
},
}
} | go | func NewInlineQueryResultArticleMarkdown(id, title, messageText string) InlineQueryResultArticle {
return InlineQueryResultArticle{
Type: "article",
ID: id,
Title: title,
InputMessageContent: InputTextMessageContent{
Text: messageText,
ParseMode: "Markdown",
},
}
} | [
"func",
"NewInlineQueryResultArticleMarkdown",
"(",
"id",
",",
"title",
",",
"messageText",
"string",
")",
"InlineQueryResultArticle",
"{",
"return",
"InlineQueryResultArticle",
"{",
"Type",
":",
"\"",
"\"",
",",
"ID",
":",
"id",
",",
"Title",
":",
"title",
",",... | // NewInlineQueryResultArticleMarkdown creates a new inline query article with Markdown parsing. | [
"NewInlineQueryResultArticleMarkdown",
"creates",
"a",
"new",
"inline",
"query",
"article",
"with",
"Markdown",
"parsing",
"."
] | 87e7035a900c7cb1fd896e5f33b461c96c3ac31e | https://github.com/go-telegram-bot-api/telegram-bot-api/blob/87e7035a900c7cb1fd896e5f33b461c96c3ac31e/helpers.go#L428-L438 |
31,318 | go-telegram-bot-api/telegram-bot-api | helpers.go | NewInlineQueryResultGIF | func NewInlineQueryResultGIF(id, url string) InlineQueryResultGIF {
return InlineQueryResultGIF{
Type: "gif",
ID: id,
URL: url,
}
} | go | func NewInlineQueryResultGIF(id, url string) InlineQueryResultGIF {
return InlineQueryResultGIF{
Type: "gif",
ID: id,
URL: url,
}
} | [
"func",
"NewInlineQueryResultGIF",
"(",
"id",
",",
"url",
"string",
")",
"InlineQueryResultGIF",
"{",
"return",
"InlineQueryResultGIF",
"{",
"Type",
":",
"\"",
"\"",
",",
"ID",
":",
"id",
",",
"URL",
":",
"url",
",",
"}",
"\n",
"}"
] | // NewInlineQueryResultGIF creates a new inline query GIF. | [
"NewInlineQueryResultGIF",
"creates",
"a",
"new",
"inline",
"query",
"GIF",
"."
] | 87e7035a900c7cb1fd896e5f33b461c96c3ac31e | https://github.com/go-telegram-bot-api/telegram-bot-api/blob/87e7035a900c7cb1fd896e5f33b461c96c3ac31e/helpers.go#L454-L460 |
31,319 | go-telegram-bot-api/telegram-bot-api | helpers.go | NewInlineQueryResultCachedGIF | func NewInlineQueryResultCachedGIF(id, gifID string) InlineQueryResultCachedGIF {
return InlineQueryResultCachedGIF{
Type: "gif",
ID: id,
GifID: gifID,
}
} | go | func NewInlineQueryResultCachedGIF(id, gifID string) InlineQueryResultCachedGIF {
return InlineQueryResultCachedGIF{
Type: "gif",
ID: id,
GifID: gifID,
}
} | [
"func",
"NewInlineQueryResultCachedGIF",
"(",
"id",
",",
"gifID",
"string",
")",
"InlineQueryResultCachedGIF",
"{",
"return",
"InlineQueryResultCachedGIF",
"{",
"Type",
":",
"\"",
"\"",
",",
"ID",
":",
"id",
",",
"GifID",
":",
"gifID",
",",
"}",
"\n",
"}"
] | // NewInlineQueryResultCachedGIF create a new inline query with cached photo. | [
"NewInlineQueryResultCachedGIF",
"create",
"a",
"new",
"inline",
"query",
"with",
"cached",
"photo",
"."
] | 87e7035a900c7cb1fd896e5f33b461c96c3ac31e | https://github.com/go-telegram-bot-api/telegram-bot-api/blob/87e7035a900c7cb1fd896e5f33b461c96c3ac31e/helpers.go#L463-L469 |
31,320 | go-telegram-bot-api/telegram-bot-api | helpers.go | NewInlineQueryResultMPEG4GIF | func NewInlineQueryResultMPEG4GIF(id, url string) InlineQueryResultMPEG4GIF {
return InlineQueryResultMPEG4GIF{
Type: "mpeg4_gif",
ID: id,
URL: url,
}
} | go | func NewInlineQueryResultMPEG4GIF(id, url string) InlineQueryResultMPEG4GIF {
return InlineQueryResultMPEG4GIF{
Type: "mpeg4_gif",
ID: id,
URL: url,
}
} | [
"func",
"NewInlineQueryResultMPEG4GIF",
"(",
"id",
",",
"url",
"string",
")",
"InlineQueryResultMPEG4GIF",
"{",
"return",
"InlineQueryResultMPEG4GIF",
"{",
"Type",
":",
"\"",
"\"",
",",
"ID",
":",
"id",
",",
"URL",
":",
"url",
",",
"}",
"\n",
"}"
] | // NewInlineQueryResultMPEG4GIF creates a new inline query MPEG4 GIF. | [
"NewInlineQueryResultMPEG4GIF",
"creates",
"a",
"new",
"inline",
"query",
"MPEG4",
"GIF",
"."
] | 87e7035a900c7cb1fd896e5f33b461c96c3ac31e | https://github.com/go-telegram-bot-api/telegram-bot-api/blob/87e7035a900c7cb1fd896e5f33b461c96c3ac31e/helpers.go#L472-L478 |
31,321 | go-telegram-bot-api/telegram-bot-api | helpers.go | NewInlineQueryResultPhoto | func NewInlineQueryResultPhoto(id, url string) InlineQueryResultPhoto {
return InlineQueryResultPhoto{
Type: "photo",
ID: id,
URL: url,
}
} | go | func NewInlineQueryResultPhoto(id, url string) InlineQueryResultPhoto {
return InlineQueryResultPhoto{
Type: "photo",
ID: id,
URL: url,
}
} | [
"func",
"NewInlineQueryResultPhoto",
"(",
"id",
",",
"url",
"string",
")",
"InlineQueryResultPhoto",
"{",
"return",
"InlineQueryResultPhoto",
"{",
"Type",
":",
"\"",
"\"",
",",
"ID",
":",
"id",
",",
"URL",
":",
"url",
",",
"}",
"\n",
"}"
] | // NewInlineQueryResultPhoto creates a new inline query photo. | [
"NewInlineQueryResultPhoto",
"creates",
"a",
"new",
"inline",
"query",
"photo",
"."
] | 87e7035a900c7cb1fd896e5f33b461c96c3ac31e | https://github.com/go-telegram-bot-api/telegram-bot-api/blob/87e7035a900c7cb1fd896e5f33b461c96c3ac31e/helpers.go#L490-L496 |
31,322 | go-telegram-bot-api/telegram-bot-api | helpers.go | NewInlineQueryResultPhotoWithThumb | func NewInlineQueryResultPhotoWithThumb(id, url, thumb string) InlineQueryResultPhoto {
return InlineQueryResultPhoto{
Type: "photo",
ID: id,
URL: url,
ThumbURL: thumb,
}
} | go | func NewInlineQueryResultPhotoWithThumb(id, url, thumb string) InlineQueryResultPhoto {
return InlineQueryResultPhoto{
Type: "photo",
ID: id,
URL: url,
ThumbURL: thumb,
}
} | [
"func",
"NewInlineQueryResultPhotoWithThumb",
"(",
"id",
",",
"url",
",",
"thumb",
"string",
")",
"InlineQueryResultPhoto",
"{",
"return",
"InlineQueryResultPhoto",
"{",
"Type",
":",
"\"",
"\"",
",",
"ID",
":",
"id",
",",
"URL",
":",
"url",
",",
"ThumbURL",
... | // NewInlineQueryResultPhotoWithThumb creates a new inline query photo. | [
"NewInlineQueryResultPhotoWithThumb",
"creates",
"a",
"new",
"inline",
"query",
"photo",
"."
] | 87e7035a900c7cb1fd896e5f33b461c96c3ac31e | https://github.com/go-telegram-bot-api/telegram-bot-api/blob/87e7035a900c7cb1fd896e5f33b461c96c3ac31e/helpers.go#L499-L506 |
31,323 | go-telegram-bot-api/telegram-bot-api | helpers.go | NewInlineQueryResultVideo | func NewInlineQueryResultVideo(id, url string) InlineQueryResultVideo {
return InlineQueryResultVideo{
Type: "video",
ID: id,
URL: url,
}
} | go | func NewInlineQueryResultVideo(id, url string) InlineQueryResultVideo {
return InlineQueryResultVideo{
Type: "video",
ID: id,
URL: url,
}
} | [
"func",
"NewInlineQueryResultVideo",
"(",
"id",
",",
"url",
"string",
")",
"InlineQueryResultVideo",
"{",
"return",
"InlineQueryResultVideo",
"{",
"Type",
":",
"\"",
"\"",
",",
"ID",
":",
"id",
",",
"URL",
":",
"url",
",",
"}",
"\n",
"}"
] | // NewInlineQueryResultVideo creates a new inline query video. | [
"NewInlineQueryResultVideo",
"creates",
"a",
"new",
"inline",
"query",
"video",
"."
] | 87e7035a900c7cb1fd896e5f33b461c96c3ac31e | https://github.com/go-telegram-bot-api/telegram-bot-api/blob/87e7035a900c7cb1fd896e5f33b461c96c3ac31e/helpers.go#L518-L524 |
31,324 | go-telegram-bot-api/telegram-bot-api | helpers.go | NewInlineQueryResultCachedVideo | func NewInlineQueryResultCachedVideo(id, videoID, title string) InlineQueryResultCachedVideo {
return InlineQueryResultCachedVideo{
Type: "video",
ID: id,
VideoID: videoID,
Title: title,
}
} | go | func NewInlineQueryResultCachedVideo(id, videoID, title string) InlineQueryResultCachedVideo {
return InlineQueryResultCachedVideo{
Type: "video",
ID: id,
VideoID: videoID,
Title: title,
}
} | [
"func",
"NewInlineQueryResultCachedVideo",
"(",
"id",
",",
"videoID",
",",
"title",
"string",
")",
"InlineQueryResultCachedVideo",
"{",
"return",
"InlineQueryResultCachedVideo",
"{",
"Type",
":",
"\"",
"\"",
",",
"ID",
":",
"id",
",",
"VideoID",
":",
"videoID",
... | // NewInlineQueryResultCachedVideo create a new inline query with cached video. | [
"NewInlineQueryResultCachedVideo",
"create",
"a",
"new",
"inline",
"query",
"with",
"cached",
"video",
"."
] | 87e7035a900c7cb1fd896e5f33b461c96c3ac31e | https://github.com/go-telegram-bot-api/telegram-bot-api/blob/87e7035a900c7cb1fd896e5f33b461c96c3ac31e/helpers.go#L527-L534 |
31,325 | go-telegram-bot-api/telegram-bot-api | helpers.go | NewInlineQueryResultAudio | func NewInlineQueryResultAudio(id, url, title string) InlineQueryResultAudio {
return InlineQueryResultAudio{
Type: "audio",
ID: id,
URL: url,
Title: title,
}
} | go | func NewInlineQueryResultAudio(id, url, title string) InlineQueryResultAudio {
return InlineQueryResultAudio{
Type: "audio",
ID: id,
URL: url,
Title: title,
}
} | [
"func",
"NewInlineQueryResultAudio",
"(",
"id",
",",
"url",
",",
"title",
"string",
")",
"InlineQueryResultAudio",
"{",
"return",
"InlineQueryResultAudio",
"{",
"Type",
":",
"\"",
"\"",
",",
"ID",
":",
"id",
",",
"URL",
":",
"url",
",",
"Title",
":",
"titl... | // NewInlineQueryResultAudio creates a new inline query audio. | [
"NewInlineQueryResultAudio",
"creates",
"a",
"new",
"inline",
"query",
"audio",
"."
] | 87e7035a900c7cb1fd896e5f33b461c96c3ac31e | https://github.com/go-telegram-bot-api/telegram-bot-api/blob/87e7035a900c7cb1fd896e5f33b461c96c3ac31e/helpers.go#L537-L544 |
31,326 | go-telegram-bot-api/telegram-bot-api | helpers.go | NewInlineQueryResultCachedAudio | func NewInlineQueryResultCachedAudio(id, audioID string) InlineQueryResultCachedAudio {
return InlineQueryResultCachedAudio{
Type: "audio",
ID: id,
AudioID: audioID,
}
} | go | func NewInlineQueryResultCachedAudio(id, audioID string) InlineQueryResultCachedAudio {
return InlineQueryResultCachedAudio{
Type: "audio",
ID: id,
AudioID: audioID,
}
} | [
"func",
"NewInlineQueryResultCachedAudio",
"(",
"id",
",",
"audioID",
"string",
")",
"InlineQueryResultCachedAudio",
"{",
"return",
"InlineQueryResultCachedAudio",
"{",
"Type",
":",
"\"",
"\"",
",",
"ID",
":",
"id",
",",
"AudioID",
":",
"audioID",
",",
"}",
"\n"... | // NewInlineQueryResultCachedAudio create a new inline query with cached photo. | [
"NewInlineQueryResultCachedAudio",
"create",
"a",
"new",
"inline",
"query",
"with",
"cached",
"photo",
"."
] | 87e7035a900c7cb1fd896e5f33b461c96c3ac31e | https://github.com/go-telegram-bot-api/telegram-bot-api/blob/87e7035a900c7cb1fd896e5f33b461c96c3ac31e/helpers.go#L547-L553 |
31,327 | go-telegram-bot-api/telegram-bot-api | helpers.go | NewInlineQueryResultVoice | func NewInlineQueryResultVoice(id, url, title string) InlineQueryResultVoice {
return InlineQueryResultVoice{
Type: "voice",
ID: id,
URL: url,
Title: title,
}
} | go | func NewInlineQueryResultVoice(id, url, title string) InlineQueryResultVoice {
return InlineQueryResultVoice{
Type: "voice",
ID: id,
URL: url,
Title: title,
}
} | [
"func",
"NewInlineQueryResultVoice",
"(",
"id",
",",
"url",
",",
"title",
"string",
")",
"InlineQueryResultVoice",
"{",
"return",
"InlineQueryResultVoice",
"{",
"Type",
":",
"\"",
"\"",
",",
"ID",
":",
"id",
",",
"URL",
":",
"url",
",",
"Title",
":",
"titl... | // NewInlineQueryResultVoice creates a new inline query voice. | [
"NewInlineQueryResultVoice",
"creates",
"a",
"new",
"inline",
"query",
"voice",
"."
] | 87e7035a900c7cb1fd896e5f33b461c96c3ac31e | https://github.com/go-telegram-bot-api/telegram-bot-api/blob/87e7035a900c7cb1fd896e5f33b461c96c3ac31e/helpers.go#L556-L563 |
31,328 | go-telegram-bot-api/telegram-bot-api | helpers.go | NewInlineQueryResultCachedVoice | func NewInlineQueryResultCachedVoice(id, voiceID, title string) InlineQueryResultCachedVoice {
return InlineQueryResultCachedVoice{
Type: "voice",
ID: id,
VoiceID: voiceID,
Title: title,
}
} | go | func NewInlineQueryResultCachedVoice(id, voiceID, title string) InlineQueryResultCachedVoice {
return InlineQueryResultCachedVoice{
Type: "voice",
ID: id,
VoiceID: voiceID,
Title: title,
}
} | [
"func",
"NewInlineQueryResultCachedVoice",
"(",
"id",
",",
"voiceID",
",",
"title",
"string",
")",
"InlineQueryResultCachedVoice",
"{",
"return",
"InlineQueryResultCachedVoice",
"{",
"Type",
":",
"\"",
"\"",
",",
"ID",
":",
"id",
",",
"VoiceID",
":",
"voiceID",
... | // NewInlineQueryResultCachedVoice create a new inline query with cached photo. | [
"NewInlineQueryResultCachedVoice",
"create",
"a",
"new",
"inline",
"query",
"with",
"cached",
"photo",
"."
] | 87e7035a900c7cb1fd896e5f33b461c96c3ac31e | https://github.com/go-telegram-bot-api/telegram-bot-api/blob/87e7035a900c7cb1fd896e5f33b461c96c3ac31e/helpers.go#L566-L573 |
31,329 | go-telegram-bot-api/telegram-bot-api | helpers.go | NewInlineQueryResultDocument | func NewInlineQueryResultDocument(id, url, title, mimeType string) InlineQueryResultDocument {
return InlineQueryResultDocument{
Type: "document",
ID: id,
URL: url,
Title: title,
MimeType: mimeType,
}
} | go | func NewInlineQueryResultDocument(id, url, title, mimeType string) InlineQueryResultDocument {
return InlineQueryResultDocument{
Type: "document",
ID: id,
URL: url,
Title: title,
MimeType: mimeType,
}
} | [
"func",
"NewInlineQueryResultDocument",
"(",
"id",
",",
"url",
",",
"title",
",",
"mimeType",
"string",
")",
"InlineQueryResultDocument",
"{",
"return",
"InlineQueryResultDocument",
"{",
"Type",
":",
"\"",
"\"",
",",
"ID",
":",
"id",
",",
"URL",
":",
"url",
... | // NewInlineQueryResultDocument creates a new inline query document. | [
"NewInlineQueryResultDocument",
"creates",
"a",
"new",
"inline",
"query",
"document",
"."
] | 87e7035a900c7cb1fd896e5f33b461c96c3ac31e | https://github.com/go-telegram-bot-api/telegram-bot-api/blob/87e7035a900c7cb1fd896e5f33b461c96c3ac31e/helpers.go#L576-L584 |
31,330 | go-telegram-bot-api/telegram-bot-api | helpers.go | NewInlineQueryResultCachedDocument | func NewInlineQueryResultCachedDocument(id, documentID, title string) InlineQueryResultCachedDocument {
return InlineQueryResultCachedDocument{
Type: "document",
ID: id,
DocumentID: documentID,
Title: title,
}
} | go | func NewInlineQueryResultCachedDocument(id, documentID, title string) InlineQueryResultCachedDocument {
return InlineQueryResultCachedDocument{
Type: "document",
ID: id,
DocumentID: documentID,
Title: title,
}
} | [
"func",
"NewInlineQueryResultCachedDocument",
"(",
"id",
",",
"documentID",
",",
"title",
"string",
")",
"InlineQueryResultCachedDocument",
"{",
"return",
"InlineQueryResultCachedDocument",
"{",
"Type",
":",
"\"",
"\"",
",",
"ID",
":",
"id",
",",
"DocumentID",
":",
... | // NewInlineQueryResultCachedDocument create a new inline query with cached photo. | [
"NewInlineQueryResultCachedDocument",
"create",
"a",
"new",
"inline",
"query",
"with",
"cached",
"photo",
"."
] | 87e7035a900c7cb1fd896e5f33b461c96c3ac31e | https://github.com/go-telegram-bot-api/telegram-bot-api/blob/87e7035a900c7cb1fd896e5f33b461c96c3ac31e/helpers.go#L587-L594 |
31,331 | go-telegram-bot-api/telegram-bot-api | helpers.go | NewInlineQueryResultLocation | func NewInlineQueryResultLocation(id, title string, latitude, longitude float64) InlineQueryResultLocation {
return InlineQueryResultLocation{
Type: "location",
ID: id,
Title: title,
Latitude: latitude,
Longitude: longitude,
}
} | go | func NewInlineQueryResultLocation(id, title string, latitude, longitude float64) InlineQueryResultLocation {
return InlineQueryResultLocation{
Type: "location",
ID: id,
Title: title,
Latitude: latitude,
Longitude: longitude,
}
} | [
"func",
"NewInlineQueryResultLocation",
"(",
"id",
",",
"title",
"string",
",",
"latitude",
",",
"longitude",
"float64",
")",
"InlineQueryResultLocation",
"{",
"return",
"InlineQueryResultLocation",
"{",
"Type",
":",
"\"",
"\"",
",",
"ID",
":",
"id",
",",
"Title... | // NewInlineQueryResultLocation creates a new inline query location. | [
"NewInlineQueryResultLocation",
"creates",
"a",
"new",
"inline",
"query",
"location",
"."
] | 87e7035a900c7cb1fd896e5f33b461c96c3ac31e | https://github.com/go-telegram-bot-api/telegram-bot-api/blob/87e7035a900c7cb1fd896e5f33b461c96c3ac31e/helpers.go#L597-L605 |
31,332 | go-telegram-bot-api/telegram-bot-api | helpers.go | NewEditMessageText | func NewEditMessageText(chatID int64, messageID int, text string) EditMessageTextConfig {
return EditMessageTextConfig{
BaseEdit: BaseEdit{
ChatID: chatID,
MessageID: messageID,
},
Text: text,
}
} | go | func NewEditMessageText(chatID int64, messageID int, text string) EditMessageTextConfig {
return EditMessageTextConfig{
BaseEdit: BaseEdit{
ChatID: chatID,
MessageID: messageID,
},
Text: text,
}
} | [
"func",
"NewEditMessageText",
"(",
"chatID",
"int64",
",",
"messageID",
"int",
",",
"text",
"string",
")",
"EditMessageTextConfig",
"{",
"return",
"EditMessageTextConfig",
"{",
"BaseEdit",
":",
"BaseEdit",
"{",
"ChatID",
":",
"chatID",
",",
"MessageID",
":",
"me... | // NewEditMessageText allows you to edit the text of a message. | [
"NewEditMessageText",
"allows",
"you",
"to",
"edit",
"the",
"text",
"of",
"a",
"message",
"."
] | 87e7035a900c7cb1fd896e5f33b461c96c3ac31e | https://github.com/go-telegram-bot-api/telegram-bot-api/blob/87e7035a900c7cb1fd896e5f33b461c96c3ac31e/helpers.go#L608-L616 |
31,333 | go-telegram-bot-api/telegram-bot-api | helpers.go | NewEditMessageCaption | func NewEditMessageCaption(chatID int64, messageID int, caption string) EditMessageCaptionConfig {
return EditMessageCaptionConfig{
BaseEdit: BaseEdit{
ChatID: chatID,
MessageID: messageID,
},
Caption: caption,
}
} | go | func NewEditMessageCaption(chatID int64, messageID int, caption string) EditMessageCaptionConfig {
return EditMessageCaptionConfig{
BaseEdit: BaseEdit{
ChatID: chatID,
MessageID: messageID,
},
Caption: caption,
}
} | [
"func",
"NewEditMessageCaption",
"(",
"chatID",
"int64",
",",
"messageID",
"int",
",",
"caption",
"string",
")",
"EditMessageCaptionConfig",
"{",
"return",
"EditMessageCaptionConfig",
"{",
"BaseEdit",
":",
"BaseEdit",
"{",
"ChatID",
":",
"chatID",
",",
"MessageID",
... | // NewEditMessageCaption allows you to edit the caption of a message. | [
"NewEditMessageCaption",
"allows",
"you",
"to",
"edit",
"the",
"caption",
"of",
"a",
"message",
"."
] | 87e7035a900c7cb1fd896e5f33b461c96c3ac31e | https://github.com/go-telegram-bot-api/telegram-bot-api/blob/87e7035a900c7cb1fd896e5f33b461c96c3ac31e/helpers.go#L619-L627 |
31,334 | go-telegram-bot-api/telegram-bot-api | helpers.go | NewEditMessageReplyMarkup | func NewEditMessageReplyMarkup(chatID int64, messageID int, replyMarkup InlineKeyboardMarkup) EditMessageReplyMarkupConfig {
return EditMessageReplyMarkupConfig{
BaseEdit: BaseEdit{
ChatID: chatID,
MessageID: messageID,
ReplyMarkup: &replyMarkup,
},
}
} | go | func NewEditMessageReplyMarkup(chatID int64, messageID int, replyMarkup InlineKeyboardMarkup) EditMessageReplyMarkupConfig {
return EditMessageReplyMarkupConfig{
BaseEdit: BaseEdit{
ChatID: chatID,
MessageID: messageID,
ReplyMarkup: &replyMarkup,
},
}
} | [
"func",
"NewEditMessageReplyMarkup",
"(",
"chatID",
"int64",
",",
"messageID",
"int",
",",
"replyMarkup",
"InlineKeyboardMarkup",
")",
"EditMessageReplyMarkupConfig",
"{",
"return",
"EditMessageReplyMarkupConfig",
"{",
"BaseEdit",
":",
"BaseEdit",
"{",
"ChatID",
":",
"c... | // NewEditMessageReplyMarkup allows you to edit the inline
// keyboard markup. | [
"NewEditMessageReplyMarkup",
"allows",
"you",
"to",
"edit",
"the",
"inline",
"keyboard",
"markup",
"."
] | 87e7035a900c7cb1fd896e5f33b461c96c3ac31e | https://github.com/go-telegram-bot-api/telegram-bot-api/blob/87e7035a900c7cb1fd896e5f33b461c96c3ac31e/helpers.go#L631-L639 |
31,335 | go-telegram-bot-api/telegram-bot-api | helpers.go | NewHideKeyboard | func NewHideKeyboard(selective bool) ReplyKeyboardHide {
log.Println("NewHideKeyboard is deprecated, please use NewRemoveKeyboard")
return ReplyKeyboardHide{
HideKeyboard: true,
Selective: selective,
}
} | go | func NewHideKeyboard(selective bool) ReplyKeyboardHide {
log.Println("NewHideKeyboard is deprecated, please use NewRemoveKeyboard")
return ReplyKeyboardHide{
HideKeyboard: true,
Selective: selective,
}
} | [
"func",
"NewHideKeyboard",
"(",
"selective",
"bool",
")",
"ReplyKeyboardHide",
"{",
"log",
".",
"Println",
"(",
"\"",
"\"",
")",
"\n\n",
"return",
"ReplyKeyboardHide",
"{",
"HideKeyboard",
":",
"true",
",",
"Selective",
":",
"selective",
",",
"}",
"\n",
"}"
... | // NewHideKeyboard hides the keyboard, with the option for being selective
// or hiding for everyone. | [
"NewHideKeyboard",
"hides",
"the",
"keyboard",
"with",
"the",
"option",
"for",
"being",
"selective",
"or",
"hiding",
"for",
"everyone",
"."
] | 87e7035a900c7cb1fd896e5f33b461c96c3ac31e | https://github.com/go-telegram-bot-api/telegram-bot-api/blob/87e7035a900c7cb1fd896e5f33b461c96c3ac31e/helpers.go#L643-L650 |
31,336 | go-telegram-bot-api/telegram-bot-api | helpers.go | NewKeyboardButtonRow | func NewKeyboardButtonRow(buttons ...KeyboardButton) []KeyboardButton {
var row []KeyboardButton
row = append(row, buttons...)
return row
} | go | func NewKeyboardButtonRow(buttons ...KeyboardButton) []KeyboardButton {
var row []KeyboardButton
row = append(row, buttons...)
return row
} | [
"func",
"NewKeyboardButtonRow",
"(",
"buttons",
"...",
"KeyboardButton",
")",
"[",
"]",
"KeyboardButton",
"{",
"var",
"row",
"[",
"]",
"KeyboardButton",
"\n\n",
"row",
"=",
"append",
"(",
"row",
",",
"buttons",
"...",
")",
"\n\n",
"return",
"row",
"\n",
"}... | // NewKeyboardButtonRow creates a row of keyboard buttons. | [
"NewKeyboardButtonRow",
"creates",
"a",
"row",
"of",
"keyboard",
"buttons",
"."
] | 87e7035a900c7cb1fd896e5f33b461c96c3ac31e | https://github.com/go-telegram-bot-api/telegram-bot-api/blob/87e7035a900c7cb1fd896e5f33b461c96c3ac31e/helpers.go#L687-L693 |
31,337 | go-telegram-bot-api/telegram-bot-api | helpers.go | NewReplyKeyboard | func NewReplyKeyboard(rows ...[]KeyboardButton) ReplyKeyboardMarkup {
var keyboard [][]KeyboardButton
keyboard = append(keyboard, rows...)
return ReplyKeyboardMarkup{
ResizeKeyboard: true,
Keyboard: keyboard,
}
} | go | func NewReplyKeyboard(rows ...[]KeyboardButton) ReplyKeyboardMarkup {
var keyboard [][]KeyboardButton
keyboard = append(keyboard, rows...)
return ReplyKeyboardMarkup{
ResizeKeyboard: true,
Keyboard: keyboard,
}
} | [
"func",
"NewReplyKeyboard",
"(",
"rows",
"...",
"[",
"]",
"KeyboardButton",
")",
"ReplyKeyboardMarkup",
"{",
"var",
"keyboard",
"[",
"]",
"[",
"]",
"KeyboardButton",
"\n\n",
"keyboard",
"=",
"append",
"(",
"keyboard",
",",
"rows",
"...",
")",
"\n\n",
"return... | // NewReplyKeyboard creates a new regular keyboard with sane defaults. | [
"NewReplyKeyboard",
"creates",
"a",
"new",
"regular",
"keyboard",
"with",
"sane",
"defaults",
"."
] | 87e7035a900c7cb1fd896e5f33b461c96c3ac31e | https://github.com/go-telegram-bot-api/telegram-bot-api/blob/87e7035a900c7cb1fd896e5f33b461c96c3ac31e/helpers.go#L696-L705 |
31,338 | go-telegram-bot-api/telegram-bot-api | helpers.go | NewInlineKeyboardButtonData | func NewInlineKeyboardButtonData(text, data string) InlineKeyboardButton {
return InlineKeyboardButton{
Text: text,
CallbackData: &data,
}
} | go | func NewInlineKeyboardButtonData(text, data string) InlineKeyboardButton {
return InlineKeyboardButton{
Text: text,
CallbackData: &data,
}
} | [
"func",
"NewInlineKeyboardButtonData",
"(",
"text",
",",
"data",
"string",
")",
"InlineKeyboardButton",
"{",
"return",
"InlineKeyboardButton",
"{",
"Text",
":",
"text",
",",
"CallbackData",
":",
"&",
"data",
",",
"}",
"\n",
"}"
] | // NewInlineKeyboardButtonData creates an inline keyboard button with text
// and data for a callback. | [
"NewInlineKeyboardButtonData",
"creates",
"an",
"inline",
"keyboard",
"button",
"with",
"text",
"and",
"data",
"for",
"a",
"callback",
"."
] | 87e7035a900c7cb1fd896e5f33b461c96c3ac31e | https://github.com/go-telegram-bot-api/telegram-bot-api/blob/87e7035a900c7cb1fd896e5f33b461c96c3ac31e/helpers.go#L709-L714 |
31,339 | go-telegram-bot-api/telegram-bot-api | helpers.go | NewInlineKeyboardButtonURL | func NewInlineKeyboardButtonURL(text, url string) InlineKeyboardButton {
return InlineKeyboardButton{
Text: text,
URL: &url,
}
} | go | func NewInlineKeyboardButtonURL(text, url string) InlineKeyboardButton {
return InlineKeyboardButton{
Text: text,
URL: &url,
}
} | [
"func",
"NewInlineKeyboardButtonURL",
"(",
"text",
",",
"url",
"string",
")",
"InlineKeyboardButton",
"{",
"return",
"InlineKeyboardButton",
"{",
"Text",
":",
"text",
",",
"URL",
":",
"&",
"url",
",",
"}",
"\n",
"}"
] | // NewInlineKeyboardButtonURL creates an inline keyboard button with text
// which goes to a URL. | [
"NewInlineKeyboardButtonURL",
"creates",
"an",
"inline",
"keyboard",
"button",
"with",
"text",
"which",
"goes",
"to",
"a",
"URL",
"."
] | 87e7035a900c7cb1fd896e5f33b461c96c3ac31e | https://github.com/go-telegram-bot-api/telegram-bot-api/blob/87e7035a900c7cb1fd896e5f33b461c96c3ac31e/helpers.go#L718-L723 |
31,340 | go-telegram-bot-api/telegram-bot-api | helpers.go | NewInlineKeyboardButtonSwitch | func NewInlineKeyboardButtonSwitch(text, sw string) InlineKeyboardButton {
return InlineKeyboardButton{
Text: text,
SwitchInlineQuery: &sw,
}
} | go | func NewInlineKeyboardButtonSwitch(text, sw string) InlineKeyboardButton {
return InlineKeyboardButton{
Text: text,
SwitchInlineQuery: &sw,
}
} | [
"func",
"NewInlineKeyboardButtonSwitch",
"(",
"text",
",",
"sw",
"string",
")",
"InlineKeyboardButton",
"{",
"return",
"InlineKeyboardButton",
"{",
"Text",
":",
"text",
",",
"SwitchInlineQuery",
":",
"&",
"sw",
",",
"}",
"\n",
"}"
] | // NewInlineKeyboardButtonSwitch creates an inline keyboard button with
// text which allows the user to switch to a chat or return to a chat. | [
"NewInlineKeyboardButtonSwitch",
"creates",
"an",
"inline",
"keyboard",
"button",
"with",
"text",
"which",
"allows",
"the",
"user",
"to",
"switch",
"to",
"a",
"chat",
"or",
"return",
"to",
"a",
"chat",
"."
] | 87e7035a900c7cb1fd896e5f33b461c96c3ac31e | https://github.com/go-telegram-bot-api/telegram-bot-api/blob/87e7035a900c7cb1fd896e5f33b461c96c3ac31e/helpers.go#L727-L732 |
31,341 | go-telegram-bot-api/telegram-bot-api | helpers.go | NewInlineKeyboardRow | func NewInlineKeyboardRow(buttons ...InlineKeyboardButton) []InlineKeyboardButton {
var row []InlineKeyboardButton
row = append(row, buttons...)
return row
} | go | func NewInlineKeyboardRow(buttons ...InlineKeyboardButton) []InlineKeyboardButton {
var row []InlineKeyboardButton
row = append(row, buttons...)
return row
} | [
"func",
"NewInlineKeyboardRow",
"(",
"buttons",
"...",
"InlineKeyboardButton",
")",
"[",
"]",
"InlineKeyboardButton",
"{",
"var",
"row",
"[",
"]",
"InlineKeyboardButton",
"\n\n",
"row",
"=",
"append",
"(",
"row",
",",
"buttons",
"...",
")",
"\n\n",
"return",
"... | // NewInlineKeyboardRow creates an inline keyboard row with buttons. | [
"NewInlineKeyboardRow",
"creates",
"an",
"inline",
"keyboard",
"row",
"with",
"buttons",
"."
] | 87e7035a900c7cb1fd896e5f33b461c96c3ac31e | https://github.com/go-telegram-bot-api/telegram-bot-api/blob/87e7035a900c7cb1fd896e5f33b461c96c3ac31e/helpers.go#L735-L741 |
31,342 | go-telegram-bot-api/telegram-bot-api | helpers.go | NewInlineKeyboardMarkup | func NewInlineKeyboardMarkup(rows ...[]InlineKeyboardButton) InlineKeyboardMarkup {
var keyboard [][]InlineKeyboardButton
keyboard = append(keyboard, rows...)
return InlineKeyboardMarkup{
InlineKeyboard: keyboard,
}
} | go | func NewInlineKeyboardMarkup(rows ...[]InlineKeyboardButton) InlineKeyboardMarkup {
var keyboard [][]InlineKeyboardButton
keyboard = append(keyboard, rows...)
return InlineKeyboardMarkup{
InlineKeyboard: keyboard,
}
} | [
"func",
"NewInlineKeyboardMarkup",
"(",
"rows",
"...",
"[",
"]",
"InlineKeyboardButton",
")",
"InlineKeyboardMarkup",
"{",
"var",
"keyboard",
"[",
"]",
"[",
"]",
"InlineKeyboardButton",
"\n\n",
"keyboard",
"=",
"append",
"(",
"keyboard",
",",
"rows",
"...",
")",... | // NewInlineKeyboardMarkup creates a new inline keyboard. | [
"NewInlineKeyboardMarkup",
"creates",
"a",
"new",
"inline",
"keyboard",
"."
] | 87e7035a900c7cb1fd896e5f33b461c96c3ac31e | https://github.com/go-telegram-bot-api/telegram-bot-api/blob/87e7035a900c7cb1fd896e5f33b461c96c3ac31e/helpers.go#L744-L752 |
31,343 | go-telegram-bot-api/telegram-bot-api | helpers.go | NewCallback | func NewCallback(id, text string) CallbackConfig {
return CallbackConfig{
CallbackQueryID: id,
Text: text,
ShowAlert: false,
}
} | go | func NewCallback(id, text string) CallbackConfig {
return CallbackConfig{
CallbackQueryID: id,
Text: text,
ShowAlert: false,
}
} | [
"func",
"NewCallback",
"(",
"id",
",",
"text",
"string",
")",
"CallbackConfig",
"{",
"return",
"CallbackConfig",
"{",
"CallbackQueryID",
":",
"id",
",",
"Text",
":",
"text",
",",
"ShowAlert",
":",
"false",
",",
"}",
"\n",
"}"
] | // NewCallback creates a new callback message. | [
"NewCallback",
"creates",
"a",
"new",
"callback",
"message",
"."
] | 87e7035a900c7cb1fd896e5f33b461c96c3ac31e | https://github.com/go-telegram-bot-api/telegram-bot-api/blob/87e7035a900c7cb1fd896e5f33b461c96c3ac31e/helpers.go#L755-L761 |
31,344 | go-telegram-bot-api/telegram-bot-api | helpers.go | NewCallbackWithAlert | func NewCallbackWithAlert(id, text string) CallbackConfig {
return CallbackConfig{
CallbackQueryID: id,
Text: text,
ShowAlert: true,
}
} | go | func NewCallbackWithAlert(id, text string) CallbackConfig {
return CallbackConfig{
CallbackQueryID: id,
Text: text,
ShowAlert: true,
}
} | [
"func",
"NewCallbackWithAlert",
"(",
"id",
",",
"text",
"string",
")",
"CallbackConfig",
"{",
"return",
"CallbackConfig",
"{",
"CallbackQueryID",
":",
"id",
",",
"Text",
":",
"text",
",",
"ShowAlert",
":",
"true",
",",
"}",
"\n",
"}"
] | // NewCallbackWithAlert creates a new callback message that alerts
// the user. | [
"NewCallbackWithAlert",
"creates",
"a",
"new",
"callback",
"message",
"that",
"alerts",
"the",
"user",
"."
] | 87e7035a900c7cb1fd896e5f33b461c96c3ac31e | https://github.com/go-telegram-bot-api/telegram-bot-api/blob/87e7035a900c7cb1fd896e5f33b461c96c3ac31e/helpers.go#L765-L771 |
31,345 | go-telegram-bot-api/telegram-bot-api | helpers.go | NewInvoice | func NewInvoice(chatID int64, title, description, payload, providerToken, startParameter, currency string, prices *[]LabeledPrice) InvoiceConfig {
return InvoiceConfig{
BaseChat: BaseChat{ChatID: chatID},
Title: title,
Description: description,
Payload: payload,
ProviderToken: provi... | go | func NewInvoice(chatID int64, title, description, payload, providerToken, startParameter, currency string, prices *[]LabeledPrice) InvoiceConfig {
return InvoiceConfig{
BaseChat: BaseChat{ChatID: chatID},
Title: title,
Description: description,
Payload: payload,
ProviderToken: provi... | [
"func",
"NewInvoice",
"(",
"chatID",
"int64",
",",
"title",
",",
"description",
",",
"payload",
",",
"providerToken",
",",
"startParameter",
",",
"currency",
"string",
",",
"prices",
"*",
"[",
"]",
"LabeledPrice",
")",
"InvoiceConfig",
"{",
"return",
"InvoiceC... | // NewInvoice creates a new Invoice request to the user. | [
"NewInvoice",
"creates",
"a",
"new",
"Invoice",
"request",
"to",
"the",
"user",
"."
] | 87e7035a900c7cb1fd896e5f33b461c96c3ac31e | https://github.com/go-telegram-bot-api/telegram-bot-api/blob/87e7035a900c7cb1fd896e5f33b461c96c3ac31e/helpers.go#L774-L784 |
31,346 | go-telegram-bot-api/telegram-bot-api | helpers.go | NewSetChatPhotoUpload | func NewSetChatPhotoUpload(chatID int64, file interface{}) SetChatPhotoConfig {
return SetChatPhotoConfig{
BaseFile: BaseFile{
BaseChat: BaseChat{ChatID: chatID},
File: file,
UseExisting: false,
},
}
} | go | func NewSetChatPhotoUpload(chatID int64, file interface{}) SetChatPhotoConfig {
return SetChatPhotoConfig{
BaseFile: BaseFile{
BaseChat: BaseChat{ChatID: chatID},
File: file,
UseExisting: false,
},
}
} | [
"func",
"NewSetChatPhotoUpload",
"(",
"chatID",
"int64",
",",
"file",
"interface",
"{",
"}",
")",
"SetChatPhotoConfig",
"{",
"return",
"SetChatPhotoConfig",
"{",
"BaseFile",
":",
"BaseFile",
"{",
"BaseChat",
":",
"BaseChat",
"{",
"ChatID",
":",
"chatID",
"}",
... | // NewSetChatPhotoUpload creates a new chat photo uploader.
//
// chatID is where to send it, file is a string path to the file,
// FileReader, or FileBytes.
//
// Note that you must send animated GIFs as a document. | [
"NewSetChatPhotoUpload",
"creates",
"a",
"new",
"chat",
"photo",
"uploader",
".",
"chatID",
"is",
"where",
"to",
"send",
"it",
"file",
"is",
"a",
"string",
"path",
"to",
"the",
"file",
"FileReader",
"or",
"FileBytes",
".",
"Note",
"that",
"you",
"must",
"s... | 87e7035a900c7cb1fd896e5f33b461c96c3ac31e | https://github.com/go-telegram-bot-api/telegram-bot-api/blob/87e7035a900c7cb1fd896e5f33b461c96c3ac31e/helpers.go#L792-L800 |
31,347 | go-telegram-bot-api/telegram-bot-api | helpers.go | NewSetChatPhotoShare | func NewSetChatPhotoShare(chatID int64, fileID string) SetChatPhotoConfig {
return SetChatPhotoConfig{
BaseFile: BaseFile{
BaseChat: BaseChat{ChatID: chatID},
FileID: fileID,
UseExisting: true,
},
}
} | go | func NewSetChatPhotoShare(chatID int64, fileID string) SetChatPhotoConfig {
return SetChatPhotoConfig{
BaseFile: BaseFile{
BaseChat: BaseChat{ChatID: chatID},
FileID: fileID,
UseExisting: true,
},
}
} | [
"func",
"NewSetChatPhotoShare",
"(",
"chatID",
"int64",
",",
"fileID",
"string",
")",
"SetChatPhotoConfig",
"{",
"return",
"SetChatPhotoConfig",
"{",
"BaseFile",
":",
"BaseFile",
"{",
"BaseChat",
":",
"BaseChat",
"{",
"ChatID",
":",
"chatID",
"}",
",",
"FileID",... | // NewSetChatPhotoShare shares an existing photo.
// You may use this to reshare an existing photo without reuploading it.
//
// chatID is where to send it, fileID is the ID of the file
// already uploaded. | [
"NewSetChatPhotoShare",
"shares",
"an",
"existing",
"photo",
".",
"You",
"may",
"use",
"this",
"to",
"reshare",
"an",
"existing",
"photo",
"without",
"reuploading",
"it",
".",
"chatID",
"is",
"where",
"to",
"send",
"it",
"fileID",
"is",
"the",
"ID",
"of",
... | 87e7035a900c7cb1fd896e5f33b461c96c3ac31e | https://github.com/go-telegram-bot-api/telegram-bot-api/blob/87e7035a900c7cb1fd896e5f33b461c96c3ac31e/helpers.go#L807-L815 |
31,348 | go-telegram-bot-api/telegram-bot-api | types.go | Time | func (m *Message) Time() time.Time {
return time.Unix(int64(m.Date), 0)
} | go | func (m *Message) Time() time.Time {
return time.Unix(int64(m.Date), 0)
} | [
"func",
"(",
"m",
"*",
"Message",
")",
"Time",
"(",
")",
"time",
".",
"Time",
"{",
"return",
"time",
".",
"Unix",
"(",
"int64",
"(",
"m",
".",
"Date",
")",
",",
"0",
")",
"\n",
"}"
] | // Time converts the message timestamp into a Time. | [
"Time",
"converts",
"the",
"message",
"timestamp",
"into",
"a",
"Time",
"."
] | 87e7035a900c7cb1fd896e5f33b461c96c3ac31e | https://github.com/go-telegram-bot-api/telegram-bot-api/blob/87e7035a900c7cb1fd896e5f33b461c96c3ac31e/types.go#L177-L179 |
31,349 | go-telegram-bot-api/telegram-bot-api | types.go | IsCommand | func (m *Message) IsCommand() bool {
if m.Entities == nil || len(*m.Entities) == 0 {
return false
}
entity := (*m.Entities)[0]
return entity.Offset == 0 && entity.IsCommand()
} | go | func (m *Message) IsCommand() bool {
if m.Entities == nil || len(*m.Entities) == 0 {
return false
}
entity := (*m.Entities)[0]
return entity.Offset == 0 && entity.IsCommand()
} | [
"func",
"(",
"m",
"*",
"Message",
")",
"IsCommand",
"(",
")",
"bool",
"{",
"if",
"m",
".",
"Entities",
"==",
"nil",
"||",
"len",
"(",
"*",
"m",
".",
"Entities",
")",
"==",
"0",
"{",
"return",
"false",
"\n",
"}",
"\n\n",
"entity",
":=",
"(",
"*"... | // IsCommand returns true if message starts with a "bot_command" entity. | [
"IsCommand",
"returns",
"true",
"if",
"message",
"starts",
"with",
"a",
"bot_command",
"entity",
"."
] | 87e7035a900c7cb1fd896e5f33b461c96c3ac31e | https://github.com/go-telegram-bot-api/telegram-bot-api/blob/87e7035a900c7cb1fd896e5f33b461c96c3ac31e/types.go#L182-L189 |
31,350 | go-telegram-bot-api/telegram-bot-api | types.go | ParseURL | func (e MessageEntity) ParseURL() (*url.URL, error) {
if e.URL == "" {
return nil, errors.New(ErrBadURL)
}
return url.Parse(e.URL)
} | go | func (e MessageEntity) ParseURL() (*url.URL, error) {
if e.URL == "" {
return nil, errors.New(ErrBadURL)
}
return url.Parse(e.URL)
} | [
"func",
"(",
"e",
"MessageEntity",
")",
"ParseURL",
"(",
")",
"(",
"*",
"url",
".",
"URL",
",",
"error",
")",
"{",
"if",
"e",
".",
"URL",
"==",
"\"",
"\"",
"{",
"return",
"nil",
",",
"errors",
".",
"New",
"(",
"ErrBadURL",
")",
"\n",
"}",
"\n\n... | // ParseURL attempts to parse a URL contained within a MessageEntity. | [
"ParseURL",
"attempts",
"to",
"parse",
"a",
"URL",
"contained",
"within",
"a",
"MessageEntity",
"."
] | 87e7035a900c7cb1fd896e5f33b461c96c3ac31e | https://github.com/go-telegram-bot-api/telegram-bot-api/blob/87e7035a900c7cb1fd896e5f33b461c96c3ac31e/types.go#L254-L260 |
31,351 | go-telegram-bot-api/telegram-bot-api | types.go | Link | func (f *File) Link(token string) string {
return fmt.Sprintf(FileEndpoint, token, f.FilePath)
} | go | func (f *File) Link(token string) string {
return fmt.Sprintf(FileEndpoint, token, f.FilePath)
} | [
"func",
"(",
"f",
"*",
"File",
")",
"Link",
"(",
"token",
"string",
")",
"string",
"{",
"return",
"fmt",
".",
"Sprintf",
"(",
"FileEndpoint",
",",
"token",
",",
"f",
".",
"FilePath",
")",
"\n",
"}"
] | // Link returns a full path to the download URL for a File.
//
// It requires the Bot Token to create the link. | [
"Link",
"returns",
"a",
"full",
"path",
"to",
"the",
"download",
"URL",
"for",
"a",
"File",
".",
"It",
"requires",
"the",
"Bot",
"Token",
"to",
"create",
"the",
"link",
"."
] | 87e7035a900c7cb1fd896e5f33b461c96c3ac31e | https://github.com/go-telegram-bot-api/telegram-bot-api/blob/87e7035a900c7cb1fd896e5f33b461c96c3ac31e/types.go#L430-L432 |
31,352 | go-telegram-bot-api/telegram-bot-api | bot.go | NewBotAPIWithClient | func NewBotAPIWithClient(token string, client *http.Client) (*BotAPI, error) {
bot := &BotAPI{
Token: token,
Client: client,
Buffer: 100,
shutdownChannel: make(chan interface{}),
}
self, err := bot.GetMe()
if err != nil {
return nil, err
}
bot.Self = self
return bot, nil
} | go | func NewBotAPIWithClient(token string, client *http.Client) (*BotAPI, error) {
bot := &BotAPI{
Token: token,
Client: client,
Buffer: 100,
shutdownChannel: make(chan interface{}),
}
self, err := bot.GetMe()
if err != nil {
return nil, err
}
bot.Self = self
return bot, nil
} | [
"func",
"NewBotAPIWithClient",
"(",
"token",
"string",
",",
"client",
"*",
"http",
".",
"Client",
")",
"(",
"*",
"BotAPI",
",",
"error",
")",
"{",
"bot",
":=",
"&",
"BotAPI",
"{",
"Token",
":",
"token",
",",
"Client",
":",
"client",
",",
"Buffer",
":... | // NewBotAPIWithClient creates a new BotAPI instance
// and allows you to pass a http.Client.
//
// It requires a token, provided by @BotFather on Telegram. | [
"NewBotAPIWithClient",
"creates",
"a",
"new",
"BotAPI",
"instance",
"and",
"allows",
"you",
"to",
"pass",
"a",
"http",
".",
"Client",
".",
"It",
"requires",
"a",
"token",
"provided",
"by"
] | 87e7035a900c7cb1fd896e5f33b461c96c3ac31e | https://github.com/go-telegram-bot-api/telegram-bot-api/blob/87e7035a900c7cb1fd896e5f33b461c96c3ac31e/bot.go#L44-L60 |
31,353 | go-telegram-bot-api/telegram-bot-api | bot.go | MakeRequest | func (bot *BotAPI) MakeRequest(endpoint string, params url.Values) (APIResponse, error) {
method := fmt.Sprintf(APIEndpoint, bot.Token, endpoint)
resp, err := bot.Client.PostForm(method, params)
if err != nil {
return APIResponse{}, err
}
defer resp.Body.Close()
var apiResp APIResponse
bytes, err := bot.deco... | go | func (bot *BotAPI) MakeRequest(endpoint string, params url.Values) (APIResponse, error) {
method := fmt.Sprintf(APIEndpoint, bot.Token, endpoint)
resp, err := bot.Client.PostForm(method, params)
if err != nil {
return APIResponse{}, err
}
defer resp.Body.Close()
var apiResp APIResponse
bytes, err := bot.deco... | [
"func",
"(",
"bot",
"*",
"BotAPI",
")",
"MakeRequest",
"(",
"endpoint",
"string",
",",
"params",
"url",
".",
"Values",
")",
"(",
"APIResponse",
",",
"error",
")",
"{",
"method",
":=",
"fmt",
".",
"Sprintf",
"(",
"APIEndpoint",
",",
"bot",
".",
"Token",... | // MakeRequest makes a request to a specific endpoint with our token. | [
"MakeRequest",
"makes",
"a",
"request",
"to",
"a",
"specific",
"endpoint",
"with",
"our",
"token",
"."
] | 87e7035a900c7cb1fd896e5f33b461c96c3ac31e | https://github.com/go-telegram-bot-api/telegram-bot-api/blob/87e7035a900c7cb1fd896e5f33b461c96c3ac31e/bot.go#L63-L91 |
31,354 | go-telegram-bot-api/telegram-bot-api | bot.go | decodeAPIResponse | func (bot *BotAPI) decodeAPIResponse(responseBody io.Reader, resp *APIResponse) (_ []byte, err error) {
if !bot.Debug {
dec := json.NewDecoder(responseBody)
err = dec.Decode(resp)
return
}
// if debug, read reponse body
data, err := ioutil.ReadAll(responseBody)
if err != nil {
return
}
err = json.Unmar... | go | func (bot *BotAPI) decodeAPIResponse(responseBody io.Reader, resp *APIResponse) (_ []byte, err error) {
if !bot.Debug {
dec := json.NewDecoder(responseBody)
err = dec.Decode(resp)
return
}
// if debug, read reponse body
data, err := ioutil.ReadAll(responseBody)
if err != nil {
return
}
err = json.Unmar... | [
"func",
"(",
"bot",
"*",
"BotAPI",
")",
"decodeAPIResponse",
"(",
"responseBody",
"io",
".",
"Reader",
",",
"resp",
"*",
"APIResponse",
")",
"(",
"_",
"[",
"]",
"byte",
",",
"err",
"error",
")",
"{",
"if",
"!",
"bot",
".",
"Debug",
"{",
"dec",
":="... | // decodeAPIResponse decode response and return slice of bytes if debug enabled.
// If debug disabled, just decode http.Response.Body stream to APIResponse struct
// for efficient memory usage | [
"decodeAPIResponse",
"decode",
"response",
"and",
"return",
"slice",
"of",
"bytes",
"if",
"debug",
"enabled",
".",
"If",
"debug",
"disabled",
"just",
"decode",
"http",
".",
"Response",
".",
"Body",
"stream",
"to",
"APIResponse",
"struct",
"for",
"efficient",
"... | 87e7035a900c7cb1fd896e5f33b461c96c3ac31e | https://github.com/go-telegram-bot-api/telegram-bot-api/blob/87e7035a900c7cb1fd896e5f33b461c96c3ac31e/bot.go#L96-L115 |
31,355 | go-telegram-bot-api/telegram-bot-api | bot.go | makeMessageRequest | func (bot *BotAPI) makeMessageRequest(endpoint string, params url.Values) (Message, error) {
resp, err := bot.MakeRequest(endpoint, params)
if err != nil {
return Message{}, err
}
var message Message
json.Unmarshal(resp.Result, &message)
bot.debugLog(endpoint, params, message)
return message, nil
} | go | func (bot *BotAPI) makeMessageRequest(endpoint string, params url.Values) (Message, error) {
resp, err := bot.MakeRequest(endpoint, params)
if err != nil {
return Message{}, err
}
var message Message
json.Unmarshal(resp.Result, &message)
bot.debugLog(endpoint, params, message)
return message, nil
} | [
"func",
"(",
"bot",
"*",
"BotAPI",
")",
"makeMessageRequest",
"(",
"endpoint",
"string",
",",
"params",
"url",
".",
"Values",
")",
"(",
"Message",
",",
"error",
")",
"{",
"resp",
",",
"err",
":=",
"bot",
".",
"MakeRequest",
"(",
"endpoint",
",",
"param... | // makeMessageRequest makes a request to a method that returns a Message. | [
"makeMessageRequest",
"makes",
"a",
"request",
"to",
"a",
"method",
"that",
"returns",
"a",
"Message",
"."
] | 87e7035a900c7cb1fd896e5f33b461c96c3ac31e | https://github.com/go-telegram-bot-api/telegram-bot-api/blob/87e7035a900c7cb1fd896e5f33b461c96c3ac31e/bot.go#L118-L130 |
31,356 | go-telegram-bot-api/telegram-bot-api | bot.go | UploadFile | func (bot *BotAPI) UploadFile(endpoint string, params map[string]string, fieldname string, file interface{}) (APIResponse, error) {
ms := multipartstreamer.New()
switch f := file.(type) {
case string:
ms.WriteFields(params)
fileHandle, err := os.Open(f)
if err != nil {
return APIResponse{}, err
}
defe... | go | func (bot *BotAPI) UploadFile(endpoint string, params map[string]string, fieldname string, file interface{}) (APIResponse, error) {
ms := multipartstreamer.New()
switch f := file.(type) {
case string:
ms.WriteFields(params)
fileHandle, err := os.Open(f)
if err != nil {
return APIResponse{}, err
}
defe... | [
"func",
"(",
"bot",
"*",
"BotAPI",
")",
"UploadFile",
"(",
"endpoint",
"string",
",",
"params",
"map",
"[",
"string",
"]",
"string",
",",
"fieldname",
"string",
",",
"file",
"interface",
"{",
"}",
")",
"(",
"APIResponse",
",",
"error",
")",
"{",
"ms",
... | // UploadFile makes a request to the API with a file.
//
// Requires the parameter to hold the file not be in the params.
// File should be a string to a file path, a FileBytes struct,
// a FileReader struct, or a url.URL.
//
// Note that if your FileReader has a size set to -1, it will read
// the file into memory to ... | [
"UploadFile",
"makes",
"a",
"request",
"to",
"the",
"API",
"with",
"a",
"file",
".",
"Requires",
"the",
"parameter",
"to",
"hold",
"the",
"file",
"not",
"be",
"in",
"the",
"params",
".",
"File",
"should",
"be",
"a",
"string",
"to",
"a",
"file",
"path",... | 87e7035a900c7cb1fd896e5f33b461c96c3ac31e | https://github.com/go-telegram-bot-api/telegram-bot-api/blob/87e7035a900c7cb1fd896e5f33b461c96c3ac31e/bot.go#L140-L225 |
31,357 | go-telegram-bot-api/telegram-bot-api | bot.go | GetFileDirectURL | func (bot *BotAPI) GetFileDirectURL(fileID string) (string, error) {
file, err := bot.GetFile(FileConfig{fileID})
if err != nil {
return "", err
}
return file.Link(bot.Token), nil
} | go | func (bot *BotAPI) GetFileDirectURL(fileID string) (string, error) {
file, err := bot.GetFile(FileConfig{fileID})
if err != nil {
return "", err
}
return file.Link(bot.Token), nil
} | [
"func",
"(",
"bot",
"*",
"BotAPI",
")",
"GetFileDirectURL",
"(",
"fileID",
"string",
")",
"(",
"string",
",",
"error",
")",
"{",
"file",
",",
"err",
":=",
"bot",
".",
"GetFile",
"(",
"FileConfig",
"{",
"fileID",
"}",
")",
"\n\n",
"if",
"err",
"!=",
... | // GetFileDirectURL returns direct URL to file
//
// It requires the FileID. | [
"GetFileDirectURL",
"returns",
"direct",
"URL",
"to",
"file",
"It",
"requires",
"the",
"FileID",
"."
] | 87e7035a900c7cb1fd896e5f33b461c96c3ac31e | https://github.com/go-telegram-bot-api/telegram-bot-api/blob/87e7035a900c7cb1fd896e5f33b461c96c3ac31e/bot.go#L230-L238 |
31,358 | go-telegram-bot-api/telegram-bot-api | bot.go | GetMe | func (bot *BotAPI) GetMe() (User, error) {
resp, err := bot.MakeRequest("getMe", nil)
if err != nil {
return User{}, err
}
var user User
json.Unmarshal(resp.Result, &user)
bot.debugLog("getMe", nil, user)
return user, nil
} | go | func (bot *BotAPI) GetMe() (User, error) {
resp, err := bot.MakeRequest("getMe", nil)
if err != nil {
return User{}, err
}
var user User
json.Unmarshal(resp.Result, &user)
bot.debugLog("getMe", nil, user)
return user, nil
} | [
"func",
"(",
"bot",
"*",
"BotAPI",
")",
"GetMe",
"(",
")",
"(",
"User",
",",
"error",
")",
"{",
"resp",
",",
"err",
":=",
"bot",
".",
"MakeRequest",
"(",
"\"",
"\"",
",",
"nil",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"User",
"{",
... | // GetMe fetches the currently authenticated bot.
//
// This method is called upon creation to validate the token,
// and so you may get this data from BotAPI.Self without the need for
// another request. | [
"GetMe",
"fetches",
"the",
"currently",
"authenticated",
"bot",
".",
"This",
"method",
"is",
"called",
"upon",
"creation",
"to",
"validate",
"the",
"token",
"and",
"so",
"you",
"may",
"get",
"this",
"data",
"from",
"BotAPI",
".",
"Self",
"without",
"the",
... | 87e7035a900c7cb1fd896e5f33b461c96c3ac31e | https://github.com/go-telegram-bot-api/telegram-bot-api/blob/87e7035a900c7cb1fd896e5f33b461c96c3ac31e/bot.go#L245-L257 |
31,359 | go-telegram-bot-api/telegram-bot-api | bot.go | IsMessageToMe | func (bot *BotAPI) IsMessageToMe(message Message) bool {
return strings.Contains(message.Text, "@"+bot.Self.UserName)
} | go | func (bot *BotAPI) IsMessageToMe(message Message) bool {
return strings.Contains(message.Text, "@"+bot.Self.UserName)
} | [
"func",
"(",
"bot",
"*",
"BotAPI",
")",
"IsMessageToMe",
"(",
"message",
"Message",
")",
"bool",
"{",
"return",
"strings",
".",
"Contains",
"(",
"message",
".",
"Text",
",",
"\"",
"\"",
"+",
"bot",
".",
"Self",
".",
"UserName",
")",
"\n",
"}"
] | // IsMessageToMe returns true if message directed to this bot.
//
// It requires the Message. | [
"IsMessageToMe",
"returns",
"true",
"if",
"message",
"directed",
"to",
"this",
"bot",
".",
"It",
"requires",
"the",
"Message",
"."
] | 87e7035a900c7cb1fd896e5f33b461c96c3ac31e | https://github.com/go-telegram-bot-api/telegram-bot-api/blob/87e7035a900c7cb1fd896e5f33b461c96c3ac31e/bot.go#L262-L264 |
31,360 | go-telegram-bot-api/telegram-bot-api | bot.go | Send | func (bot *BotAPI) Send(c Chattable) (Message, error) {
switch c.(type) {
case Fileable:
return bot.sendFile(c.(Fileable))
default:
return bot.sendChattable(c)
}
} | go | func (bot *BotAPI) Send(c Chattable) (Message, error) {
switch c.(type) {
case Fileable:
return bot.sendFile(c.(Fileable))
default:
return bot.sendChattable(c)
}
} | [
"func",
"(",
"bot",
"*",
"BotAPI",
")",
"Send",
"(",
"c",
"Chattable",
")",
"(",
"Message",
",",
"error",
")",
"{",
"switch",
"c",
".",
"(",
"type",
")",
"{",
"case",
"Fileable",
":",
"return",
"bot",
".",
"sendFile",
"(",
"c",
".",
"(",
"Fileabl... | // Send will send a Chattable item to Telegram.
//
// It requires the Chattable to send. | [
"Send",
"will",
"send",
"a",
"Chattable",
"item",
"to",
"Telegram",
".",
"It",
"requires",
"the",
"Chattable",
"to",
"send",
"."
] | 87e7035a900c7cb1fd896e5f33b461c96c3ac31e | https://github.com/go-telegram-bot-api/telegram-bot-api/blob/87e7035a900c7cb1fd896e5f33b461c96c3ac31e/bot.go#L269-L276 |
31,361 | go-telegram-bot-api/telegram-bot-api | bot.go | debugLog | func (bot *BotAPI) debugLog(context string, v url.Values, message interface{}) {
if bot.Debug {
log.Printf("%s req : %+v\n", context, v)
log.Printf("%s resp: %+v\n", context, message)
}
} | go | func (bot *BotAPI) debugLog(context string, v url.Values, message interface{}) {
if bot.Debug {
log.Printf("%s req : %+v\n", context, v)
log.Printf("%s resp: %+v\n", context, message)
}
} | [
"func",
"(",
"bot",
"*",
"BotAPI",
")",
"debugLog",
"(",
"context",
"string",
",",
"v",
"url",
".",
"Values",
",",
"message",
"interface",
"{",
"}",
")",
"{",
"if",
"bot",
".",
"Debug",
"{",
"log",
".",
"Printf",
"(",
"\"",
"\\n",
"\"",
",",
"con... | // debugLog checks if the bot is currently running in debug mode, and if
// so will display information about the request and response in the
// debug log. | [
"debugLog",
"checks",
"if",
"the",
"bot",
"is",
"currently",
"running",
"in",
"debug",
"mode",
"and",
"if",
"so",
"will",
"display",
"information",
"about",
"the",
"request",
"and",
"response",
"in",
"the",
"debug",
"log",
"."
] | 87e7035a900c7cb1fd896e5f33b461c96c3ac31e | https://github.com/go-telegram-bot-api/telegram-bot-api/blob/87e7035a900c7cb1fd896e5f33b461c96c3ac31e/bot.go#L281-L286 |
31,362 | go-telegram-bot-api/telegram-bot-api | bot.go | sendExisting | func (bot *BotAPI) sendExisting(method string, config Fileable) (Message, error) {
v, err := config.values()
if err != nil {
return Message{}, err
}
message, err := bot.makeMessageRequest(method, v)
if err != nil {
return Message{}, err
}
return message, nil
} | go | func (bot *BotAPI) sendExisting(method string, config Fileable) (Message, error) {
v, err := config.values()
if err != nil {
return Message{}, err
}
message, err := bot.makeMessageRequest(method, v)
if err != nil {
return Message{}, err
}
return message, nil
} | [
"func",
"(",
"bot",
"*",
"BotAPI",
")",
"sendExisting",
"(",
"method",
"string",
",",
"config",
"Fileable",
")",
"(",
"Message",
",",
"error",
")",
"{",
"v",
",",
"err",
":=",
"config",
".",
"values",
"(",
")",
"\n\n",
"if",
"err",
"!=",
"nil",
"{"... | // sendExisting will send a Message with an existing file to Telegram. | [
"sendExisting",
"will",
"send",
"a",
"Message",
"with",
"an",
"existing",
"file",
"to",
"Telegram",
"."
] | 87e7035a900c7cb1fd896e5f33b461c96c3ac31e | https://github.com/go-telegram-bot-api/telegram-bot-api/blob/87e7035a900c7cb1fd896e5f33b461c96c3ac31e/bot.go#L289-L302 |
31,363 | go-telegram-bot-api/telegram-bot-api | bot.go | uploadAndSend | func (bot *BotAPI) uploadAndSend(method string, config Fileable) (Message, error) {
params, err := config.params()
if err != nil {
return Message{}, err
}
file := config.getFile()
resp, err := bot.UploadFile(method, params, config.name(), file)
if err != nil {
return Message{}, err
}
var message Message
... | go | func (bot *BotAPI) uploadAndSend(method string, config Fileable) (Message, error) {
params, err := config.params()
if err != nil {
return Message{}, err
}
file := config.getFile()
resp, err := bot.UploadFile(method, params, config.name(), file)
if err != nil {
return Message{}, err
}
var message Message
... | [
"func",
"(",
"bot",
"*",
"BotAPI",
")",
"uploadAndSend",
"(",
"method",
"string",
",",
"config",
"Fileable",
")",
"(",
"Message",
",",
"error",
")",
"{",
"params",
",",
"err",
":=",
"config",
".",
"params",
"(",
")",
"\n",
"if",
"err",
"!=",
"nil",
... | // uploadAndSend will send a Message with a new file to Telegram. | [
"uploadAndSend",
"will",
"send",
"a",
"Message",
"with",
"a",
"new",
"file",
"to",
"Telegram",
"."
] | 87e7035a900c7cb1fd896e5f33b461c96c3ac31e | https://github.com/go-telegram-bot-api/telegram-bot-api/blob/87e7035a900c7cb1fd896e5f33b461c96c3ac31e/bot.go#L305-L324 |
31,364 | go-telegram-bot-api/telegram-bot-api | bot.go | sendFile | func (bot *BotAPI) sendFile(config Fileable) (Message, error) {
if config.useExistingFile() {
return bot.sendExisting(config.method(), config)
}
return bot.uploadAndSend(config.method(), config)
} | go | func (bot *BotAPI) sendFile(config Fileable) (Message, error) {
if config.useExistingFile() {
return bot.sendExisting(config.method(), config)
}
return bot.uploadAndSend(config.method(), config)
} | [
"func",
"(",
"bot",
"*",
"BotAPI",
")",
"sendFile",
"(",
"config",
"Fileable",
")",
"(",
"Message",
",",
"error",
")",
"{",
"if",
"config",
".",
"useExistingFile",
"(",
")",
"{",
"return",
"bot",
".",
"sendExisting",
"(",
"config",
".",
"method",
"(",
... | // sendFile determines if the file is using an existing file or uploading
// a new file, then sends it as needed. | [
"sendFile",
"determines",
"if",
"the",
"file",
"is",
"using",
"an",
"existing",
"file",
"or",
"uploading",
"a",
"new",
"file",
"then",
"sends",
"it",
"as",
"needed",
"."
] | 87e7035a900c7cb1fd896e5f33b461c96c3ac31e | https://github.com/go-telegram-bot-api/telegram-bot-api/blob/87e7035a900c7cb1fd896e5f33b461c96c3ac31e/bot.go#L328-L334 |
31,365 | go-telegram-bot-api/telegram-bot-api | bot.go | sendChattable | func (bot *BotAPI) sendChattable(config Chattable) (Message, error) {
v, err := config.values()
if err != nil {
return Message{}, err
}
message, err := bot.makeMessageRequest(config.method(), v)
if err != nil {
return Message{}, err
}
return message, nil
} | go | func (bot *BotAPI) sendChattable(config Chattable) (Message, error) {
v, err := config.values()
if err != nil {
return Message{}, err
}
message, err := bot.makeMessageRequest(config.method(), v)
if err != nil {
return Message{}, err
}
return message, nil
} | [
"func",
"(",
"bot",
"*",
"BotAPI",
")",
"sendChattable",
"(",
"config",
"Chattable",
")",
"(",
"Message",
",",
"error",
")",
"{",
"v",
",",
"err",
":=",
"config",
".",
"values",
"(",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"Message",
"{... | // sendChattable sends a Chattable. | [
"sendChattable",
"sends",
"a",
"Chattable",
"."
] | 87e7035a900c7cb1fd896e5f33b461c96c3ac31e | https://github.com/go-telegram-bot-api/telegram-bot-api/blob/87e7035a900c7cb1fd896e5f33b461c96c3ac31e/bot.go#L337-L350 |
31,366 | go-telegram-bot-api/telegram-bot-api | bot.go | GetUserProfilePhotos | func (bot *BotAPI) GetUserProfilePhotos(config UserProfilePhotosConfig) (UserProfilePhotos, error) {
v := url.Values{}
v.Add("user_id", strconv.Itoa(config.UserID))
if config.Offset != 0 {
v.Add("offset", strconv.Itoa(config.Offset))
}
if config.Limit != 0 {
v.Add("limit", strconv.Itoa(config.Limit))
}
resp... | go | func (bot *BotAPI) GetUserProfilePhotos(config UserProfilePhotosConfig) (UserProfilePhotos, error) {
v := url.Values{}
v.Add("user_id", strconv.Itoa(config.UserID))
if config.Offset != 0 {
v.Add("offset", strconv.Itoa(config.Offset))
}
if config.Limit != 0 {
v.Add("limit", strconv.Itoa(config.Limit))
}
resp... | [
"func",
"(",
"bot",
"*",
"BotAPI",
")",
"GetUserProfilePhotos",
"(",
"config",
"UserProfilePhotosConfig",
")",
"(",
"UserProfilePhotos",
",",
"error",
")",
"{",
"v",
":=",
"url",
".",
"Values",
"{",
"}",
"\n",
"v",
".",
"Add",
"(",
"\"",
"\"",
",",
"st... | // GetUserProfilePhotos gets a user's profile photos.
//
// It requires UserID.
// Offset and Limit are optional. | [
"GetUserProfilePhotos",
"gets",
"a",
"user",
"s",
"profile",
"photos",
".",
"It",
"requires",
"UserID",
".",
"Offset",
"and",
"Limit",
"are",
"optional",
"."
] | 87e7035a900c7cb1fd896e5f33b461c96c3ac31e | https://github.com/go-telegram-bot-api/telegram-bot-api/blob/87e7035a900c7cb1fd896e5f33b461c96c3ac31e/bot.go#L356-L377 |
31,367 | go-telegram-bot-api/telegram-bot-api | bot.go | GetFile | func (bot *BotAPI) GetFile(config FileConfig) (File, error) {
v := url.Values{}
v.Add("file_id", config.FileID)
resp, err := bot.MakeRequest("getFile", v)
if err != nil {
return File{}, err
}
var file File
json.Unmarshal(resp.Result, &file)
bot.debugLog("GetFile", v, file)
return file, nil
} | go | func (bot *BotAPI) GetFile(config FileConfig) (File, error) {
v := url.Values{}
v.Add("file_id", config.FileID)
resp, err := bot.MakeRequest("getFile", v)
if err != nil {
return File{}, err
}
var file File
json.Unmarshal(resp.Result, &file)
bot.debugLog("GetFile", v, file)
return file, nil
} | [
"func",
"(",
"bot",
"*",
"BotAPI",
")",
"GetFile",
"(",
"config",
"FileConfig",
")",
"(",
"File",
",",
"error",
")",
"{",
"v",
":=",
"url",
".",
"Values",
"{",
"}",
"\n",
"v",
".",
"Add",
"(",
"\"",
"\"",
",",
"config",
".",
"FileID",
")",
"\n\... | // GetFile returns a File which can download a file from Telegram.
//
// Requires FileID. | [
"GetFile",
"returns",
"a",
"File",
"which",
"can",
"download",
"a",
"file",
"from",
"Telegram",
".",
"Requires",
"FileID",
"."
] | 87e7035a900c7cb1fd896e5f33b461c96c3ac31e | https://github.com/go-telegram-bot-api/telegram-bot-api/blob/87e7035a900c7cb1fd896e5f33b461c96c3ac31e/bot.go#L382-L397 |
31,368 | go-telegram-bot-api/telegram-bot-api | bot.go | GetUpdates | func (bot *BotAPI) GetUpdates(config UpdateConfig) ([]Update, error) {
v := url.Values{}
if config.Offset != 0 {
v.Add("offset", strconv.Itoa(config.Offset))
}
if config.Limit > 0 {
v.Add("limit", strconv.Itoa(config.Limit))
}
if config.Timeout > 0 {
v.Add("timeout", strconv.Itoa(config.Timeout))
}
resp,... | go | func (bot *BotAPI) GetUpdates(config UpdateConfig) ([]Update, error) {
v := url.Values{}
if config.Offset != 0 {
v.Add("offset", strconv.Itoa(config.Offset))
}
if config.Limit > 0 {
v.Add("limit", strconv.Itoa(config.Limit))
}
if config.Timeout > 0 {
v.Add("timeout", strconv.Itoa(config.Timeout))
}
resp,... | [
"func",
"(",
"bot",
"*",
"BotAPI",
")",
"GetUpdates",
"(",
"config",
"UpdateConfig",
")",
"(",
"[",
"]",
"Update",
",",
"error",
")",
"{",
"v",
":=",
"url",
".",
"Values",
"{",
"}",
"\n",
"if",
"config",
".",
"Offset",
"!=",
"0",
"{",
"v",
".",
... | // GetUpdates fetches updates.
// If a WebHook is set, this will not return any data!
//
// Offset, Limit, and Timeout are optional.
// To avoid stale items, set Offset to one higher than the previous item.
// Set Timeout to a large number to reduce requests so you can get updates
// instantly instead of having to wait... | [
"GetUpdates",
"fetches",
"updates",
".",
"If",
"a",
"WebHook",
"is",
"set",
"this",
"will",
"not",
"return",
"any",
"data!",
"Offset",
"Limit",
"and",
"Timeout",
"are",
"optional",
".",
"To",
"avoid",
"stale",
"items",
"set",
"Offset",
"to",
"one",
"higher... | 87e7035a900c7cb1fd896e5f33b461c96c3ac31e | https://github.com/go-telegram-bot-api/telegram-bot-api/blob/87e7035a900c7cb1fd896e5f33b461c96c3ac31e/bot.go#L406-L429 |
31,369 | go-telegram-bot-api/telegram-bot-api | bot.go | SetWebhook | func (bot *BotAPI) SetWebhook(config WebhookConfig) (APIResponse, error) {
if config.Certificate == nil {
v := url.Values{}
v.Add("url", config.URL.String())
if config.MaxConnections != 0 {
v.Add("max_connections", strconv.Itoa(config.MaxConnections))
}
return bot.MakeRequest("setWebhook", v)
}
param... | go | func (bot *BotAPI) SetWebhook(config WebhookConfig) (APIResponse, error) {
if config.Certificate == nil {
v := url.Values{}
v.Add("url", config.URL.String())
if config.MaxConnections != 0 {
v.Add("max_connections", strconv.Itoa(config.MaxConnections))
}
return bot.MakeRequest("setWebhook", v)
}
param... | [
"func",
"(",
"bot",
"*",
"BotAPI",
")",
"SetWebhook",
"(",
"config",
"WebhookConfig",
")",
"(",
"APIResponse",
",",
"error",
")",
"{",
"if",
"config",
".",
"Certificate",
"==",
"nil",
"{",
"v",
":=",
"url",
".",
"Values",
"{",
"}",
"\n",
"v",
".",
... | // SetWebhook sets a webhook.
//
// If this is set, GetUpdates will not get any data!
//
// If you do not have a legitimate TLS certificate, you need to include
// your self signed certificate with the config. | [
"SetWebhook",
"sets",
"a",
"webhook",
".",
"If",
"this",
"is",
"set",
"GetUpdates",
"will",
"not",
"get",
"any",
"data!",
"If",
"you",
"do",
"not",
"have",
"a",
"legitimate",
"TLS",
"certificate",
"you",
"need",
"to",
"include",
"your",
"self",
"signed",
... | 87e7035a900c7cb1fd896e5f33b461c96c3ac31e | https://github.com/go-telegram-bot-api/telegram-bot-api/blob/87e7035a900c7cb1fd896e5f33b461c96c3ac31e/bot.go#L442-L466 |
31,370 | go-telegram-bot-api/telegram-bot-api | bot.go | GetWebhookInfo | func (bot *BotAPI) GetWebhookInfo() (WebhookInfo, error) {
resp, err := bot.MakeRequest("getWebhookInfo", url.Values{})
if err != nil {
return WebhookInfo{}, err
}
var info WebhookInfo
err = json.Unmarshal(resp.Result, &info)
return info, err
} | go | func (bot *BotAPI) GetWebhookInfo() (WebhookInfo, error) {
resp, err := bot.MakeRequest("getWebhookInfo", url.Values{})
if err != nil {
return WebhookInfo{}, err
}
var info WebhookInfo
err = json.Unmarshal(resp.Result, &info)
return info, err
} | [
"func",
"(",
"bot",
"*",
"BotAPI",
")",
"GetWebhookInfo",
"(",
")",
"(",
"WebhookInfo",
",",
"error",
")",
"{",
"resp",
",",
"err",
":=",
"bot",
".",
"MakeRequest",
"(",
"\"",
"\"",
",",
"url",
".",
"Values",
"{",
"}",
")",
"\n",
"if",
"err",
"!=... | // GetWebhookInfo allows you to fetch information about a webhook and if
// one currently is set, along with pending update count and error messages. | [
"GetWebhookInfo",
"allows",
"you",
"to",
"fetch",
"information",
"about",
"a",
"webhook",
"and",
"if",
"one",
"currently",
"is",
"set",
"along",
"with",
"pending",
"update",
"count",
"and",
"error",
"messages",
"."
] | 87e7035a900c7cb1fd896e5f33b461c96c3ac31e | https://github.com/go-telegram-bot-api/telegram-bot-api/blob/87e7035a900c7cb1fd896e5f33b461c96c3ac31e/bot.go#L470-L480 |
31,371 | go-telegram-bot-api/telegram-bot-api | bot.go | GetUpdatesChan | func (bot *BotAPI) GetUpdatesChan(config UpdateConfig) (UpdatesChannel, error) {
ch := make(chan Update, bot.Buffer)
go func() {
for {
select {
case <-bot.shutdownChannel:
return
default:
}
updates, err := bot.GetUpdates(config)
if err != nil {
log.Println(err)
log.Println("Failed... | go | func (bot *BotAPI) GetUpdatesChan(config UpdateConfig) (UpdatesChannel, error) {
ch := make(chan Update, bot.Buffer)
go func() {
for {
select {
case <-bot.shutdownChannel:
return
default:
}
updates, err := bot.GetUpdates(config)
if err != nil {
log.Println(err)
log.Println("Failed... | [
"func",
"(",
"bot",
"*",
"BotAPI",
")",
"GetUpdatesChan",
"(",
"config",
"UpdateConfig",
")",
"(",
"UpdatesChannel",
",",
"error",
")",
"{",
"ch",
":=",
"make",
"(",
"chan",
"Update",
",",
"bot",
".",
"Buffer",
")",
"\n\n",
"go",
"func",
"(",
")",
"{... | // GetUpdatesChan starts and returns a channel for getting updates. | [
"GetUpdatesChan",
"starts",
"and",
"returns",
"a",
"channel",
"for",
"getting",
"updates",
"."
] | 87e7035a900c7cb1fd896e5f33b461c96c3ac31e | https://github.com/go-telegram-bot-api/telegram-bot-api/blob/87e7035a900c7cb1fd896e5f33b461c96c3ac31e/bot.go#L483-L513 |
31,372 | go-telegram-bot-api/telegram-bot-api | bot.go | StopReceivingUpdates | func (bot *BotAPI) StopReceivingUpdates() {
if bot.Debug {
log.Println("Stopping the update receiver routine...")
}
close(bot.shutdownChannel)
} | go | func (bot *BotAPI) StopReceivingUpdates() {
if bot.Debug {
log.Println("Stopping the update receiver routine...")
}
close(bot.shutdownChannel)
} | [
"func",
"(",
"bot",
"*",
"BotAPI",
")",
"StopReceivingUpdates",
"(",
")",
"{",
"if",
"bot",
".",
"Debug",
"{",
"log",
".",
"Println",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n",
"close",
"(",
"bot",
".",
"shutdownChannel",
")",
"\n",
"}"
] | // StopReceivingUpdates stops the go routine which receives updates | [
"StopReceivingUpdates",
"stops",
"the",
"go",
"routine",
"which",
"receives",
"updates"
] | 87e7035a900c7cb1fd896e5f33b461c96c3ac31e | https://github.com/go-telegram-bot-api/telegram-bot-api/blob/87e7035a900c7cb1fd896e5f33b461c96c3ac31e/bot.go#L516-L521 |
31,373 | go-telegram-bot-api/telegram-bot-api | bot.go | ListenForWebhook | func (bot *BotAPI) ListenForWebhook(pattern string) UpdatesChannel {
ch := make(chan Update, bot.Buffer)
http.HandleFunc(pattern, func(w http.ResponseWriter, r *http.Request) {
bytes, _ := ioutil.ReadAll(r.Body)
r.Body.Close()
var update Update
json.Unmarshal(bytes, &update)
ch <- update
})
return ch
... | go | func (bot *BotAPI) ListenForWebhook(pattern string) UpdatesChannel {
ch := make(chan Update, bot.Buffer)
http.HandleFunc(pattern, func(w http.ResponseWriter, r *http.Request) {
bytes, _ := ioutil.ReadAll(r.Body)
r.Body.Close()
var update Update
json.Unmarshal(bytes, &update)
ch <- update
})
return ch
... | [
"func",
"(",
"bot",
"*",
"BotAPI",
")",
"ListenForWebhook",
"(",
"pattern",
"string",
")",
"UpdatesChannel",
"{",
"ch",
":=",
"make",
"(",
"chan",
"Update",
",",
"bot",
".",
"Buffer",
")",
"\n\n",
"http",
".",
"HandleFunc",
"(",
"pattern",
",",
"func",
... | // ListenForWebhook registers a http handler for a webhook. | [
"ListenForWebhook",
"registers",
"a",
"http",
"handler",
"for",
"a",
"webhook",
"."
] | 87e7035a900c7cb1fd896e5f33b461c96c3ac31e | https://github.com/go-telegram-bot-api/telegram-bot-api/blob/87e7035a900c7cb1fd896e5f33b461c96c3ac31e/bot.go#L524-L538 |
31,374 | go-telegram-bot-api/telegram-bot-api | bot.go | AnswerInlineQuery | func (bot *BotAPI) AnswerInlineQuery(config InlineConfig) (APIResponse, error) {
v := url.Values{}
v.Add("inline_query_id", config.InlineQueryID)
v.Add("cache_time", strconv.Itoa(config.CacheTime))
v.Add("is_personal", strconv.FormatBool(config.IsPersonal))
v.Add("next_offset", config.NextOffset)
data, err := js... | go | func (bot *BotAPI) AnswerInlineQuery(config InlineConfig) (APIResponse, error) {
v := url.Values{}
v.Add("inline_query_id", config.InlineQueryID)
v.Add("cache_time", strconv.Itoa(config.CacheTime))
v.Add("is_personal", strconv.FormatBool(config.IsPersonal))
v.Add("next_offset", config.NextOffset)
data, err := js... | [
"func",
"(",
"bot",
"*",
"BotAPI",
")",
"AnswerInlineQuery",
"(",
"config",
"InlineConfig",
")",
"(",
"APIResponse",
",",
"error",
")",
"{",
"v",
":=",
"url",
".",
"Values",
"{",
"}",
"\n\n",
"v",
".",
"Add",
"(",
"\"",
"\"",
",",
"config",
".",
"I... | // AnswerInlineQuery sends a response to an inline query.
//
// Note that you must respond to an inline query within 30 seconds. | [
"AnswerInlineQuery",
"sends",
"a",
"response",
"to",
"an",
"inline",
"query",
".",
"Note",
"that",
"you",
"must",
"respond",
"to",
"an",
"inline",
"query",
"within",
"30",
"seconds",
"."
] | 87e7035a900c7cb1fd896e5f33b461c96c3ac31e | https://github.com/go-telegram-bot-api/telegram-bot-api/blob/87e7035a900c7cb1fd896e5f33b461c96c3ac31e/bot.go#L543-L561 |
31,375 | go-telegram-bot-api/telegram-bot-api | bot.go | AnswerCallbackQuery | func (bot *BotAPI) AnswerCallbackQuery(config CallbackConfig) (APIResponse, error) {
v := url.Values{}
v.Add("callback_query_id", config.CallbackQueryID)
if config.Text != "" {
v.Add("text", config.Text)
}
v.Add("show_alert", strconv.FormatBool(config.ShowAlert))
if config.URL != "" {
v.Add("url", config.URL... | go | func (bot *BotAPI) AnswerCallbackQuery(config CallbackConfig) (APIResponse, error) {
v := url.Values{}
v.Add("callback_query_id", config.CallbackQueryID)
if config.Text != "" {
v.Add("text", config.Text)
}
v.Add("show_alert", strconv.FormatBool(config.ShowAlert))
if config.URL != "" {
v.Add("url", config.URL... | [
"func",
"(",
"bot",
"*",
"BotAPI",
")",
"AnswerCallbackQuery",
"(",
"config",
"CallbackConfig",
")",
"(",
"APIResponse",
",",
"error",
")",
"{",
"v",
":=",
"url",
".",
"Values",
"{",
"}",
"\n\n",
"v",
".",
"Add",
"(",
"\"",
"\"",
",",
"config",
".",
... | // AnswerCallbackQuery sends a response to an inline query callback. | [
"AnswerCallbackQuery",
"sends",
"a",
"response",
"to",
"an",
"inline",
"query",
"callback",
"."
] | 87e7035a900c7cb1fd896e5f33b461c96c3ac31e | https://github.com/go-telegram-bot-api/telegram-bot-api/blob/87e7035a900c7cb1fd896e5f33b461c96c3ac31e/bot.go#L564-L580 |
31,376 | go-telegram-bot-api/telegram-bot-api | bot.go | KickChatMember | func (bot *BotAPI) KickChatMember(config KickChatMemberConfig) (APIResponse, error) {
v := url.Values{}
if config.SuperGroupUsername == "" {
v.Add("chat_id", strconv.FormatInt(config.ChatID, 10))
} else {
v.Add("chat_id", config.SuperGroupUsername)
}
v.Add("user_id", strconv.Itoa(config.UserID))
if config.U... | go | func (bot *BotAPI) KickChatMember(config KickChatMemberConfig) (APIResponse, error) {
v := url.Values{}
if config.SuperGroupUsername == "" {
v.Add("chat_id", strconv.FormatInt(config.ChatID, 10))
} else {
v.Add("chat_id", config.SuperGroupUsername)
}
v.Add("user_id", strconv.Itoa(config.UserID))
if config.U... | [
"func",
"(",
"bot",
"*",
"BotAPI",
")",
"KickChatMember",
"(",
"config",
"KickChatMemberConfig",
")",
"(",
"APIResponse",
",",
"error",
")",
"{",
"v",
":=",
"url",
".",
"Values",
"{",
"}",
"\n\n",
"if",
"config",
".",
"SuperGroupUsername",
"==",
"\"",
"\... | // KickChatMember kicks a user from a chat. Note that this only will work
// in supergroups, and requires the bot to be an admin. Also note they
// will be unable to rejoin until they are unbanned. | [
"KickChatMember",
"kicks",
"a",
"user",
"from",
"a",
"chat",
".",
"Note",
"that",
"this",
"only",
"will",
"work",
"in",
"supergroups",
"and",
"requires",
"the",
"bot",
"to",
"be",
"an",
"admin",
".",
"Also",
"note",
"they",
"will",
"be",
"unable",
"to",
... | 87e7035a900c7cb1fd896e5f33b461c96c3ac31e | https://github.com/go-telegram-bot-api/telegram-bot-api/blob/87e7035a900c7cb1fd896e5f33b461c96c3ac31e/bot.go#L585-L602 |
31,377 | go-telegram-bot-api/telegram-bot-api | bot.go | LeaveChat | func (bot *BotAPI) LeaveChat(config ChatConfig) (APIResponse, error) {
v := url.Values{}
if config.SuperGroupUsername == "" {
v.Add("chat_id", strconv.FormatInt(config.ChatID, 10))
} else {
v.Add("chat_id", config.SuperGroupUsername)
}
bot.debugLog("leaveChat", v, nil)
return bot.MakeRequest("leaveChat", v... | go | func (bot *BotAPI) LeaveChat(config ChatConfig) (APIResponse, error) {
v := url.Values{}
if config.SuperGroupUsername == "" {
v.Add("chat_id", strconv.FormatInt(config.ChatID, 10))
} else {
v.Add("chat_id", config.SuperGroupUsername)
}
bot.debugLog("leaveChat", v, nil)
return bot.MakeRequest("leaveChat", v... | [
"func",
"(",
"bot",
"*",
"BotAPI",
")",
"LeaveChat",
"(",
"config",
"ChatConfig",
")",
"(",
"APIResponse",
",",
"error",
")",
"{",
"v",
":=",
"url",
".",
"Values",
"{",
"}",
"\n\n",
"if",
"config",
".",
"SuperGroupUsername",
"==",
"\"",
"\"",
"{",
"v... | // LeaveChat makes the bot leave the chat. | [
"LeaveChat",
"makes",
"the",
"bot",
"leave",
"the",
"chat",
"."
] | 87e7035a900c7cb1fd896e5f33b461c96c3ac31e | https://github.com/go-telegram-bot-api/telegram-bot-api/blob/87e7035a900c7cb1fd896e5f33b461c96c3ac31e/bot.go#L605-L617 |
31,378 | go-telegram-bot-api/telegram-bot-api | bot.go | GetChat | func (bot *BotAPI) GetChat(config ChatConfig) (Chat, error) {
v := url.Values{}
if config.SuperGroupUsername == "" {
v.Add("chat_id", strconv.FormatInt(config.ChatID, 10))
} else {
v.Add("chat_id", config.SuperGroupUsername)
}
resp, err := bot.MakeRequest("getChat", v)
if err != nil {
return Chat{}, err
... | go | func (bot *BotAPI) GetChat(config ChatConfig) (Chat, error) {
v := url.Values{}
if config.SuperGroupUsername == "" {
v.Add("chat_id", strconv.FormatInt(config.ChatID, 10))
} else {
v.Add("chat_id", config.SuperGroupUsername)
}
resp, err := bot.MakeRequest("getChat", v)
if err != nil {
return Chat{}, err
... | [
"func",
"(",
"bot",
"*",
"BotAPI",
")",
"GetChat",
"(",
"config",
"ChatConfig",
")",
"(",
"Chat",
",",
"error",
")",
"{",
"v",
":=",
"url",
".",
"Values",
"{",
"}",
"\n\n",
"if",
"config",
".",
"SuperGroupUsername",
"==",
"\"",
"\"",
"{",
"v",
".",... | // GetChat gets information about a chat. | [
"GetChat",
"gets",
"information",
"about",
"a",
"chat",
"."
] | 87e7035a900c7cb1fd896e5f33b461c96c3ac31e | https://github.com/go-telegram-bot-api/telegram-bot-api/blob/87e7035a900c7cb1fd896e5f33b461c96c3ac31e/bot.go#L620-L640 |
31,379 | go-telegram-bot-api/telegram-bot-api | bot.go | GetChatAdministrators | func (bot *BotAPI) GetChatAdministrators(config ChatConfig) ([]ChatMember, error) {
v := url.Values{}
if config.SuperGroupUsername == "" {
v.Add("chat_id", strconv.FormatInt(config.ChatID, 10))
} else {
v.Add("chat_id", config.SuperGroupUsername)
}
resp, err := bot.MakeRequest("getChatAdministrators", v)
if... | go | func (bot *BotAPI) GetChatAdministrators(config ChatConfig) ([]ChatMember, error) {
v := url.Values{}
if config.SuperGroupUsername == "" {
v.Add("chat_id", strconv.FormatInt(config.ChatID, 10))
} else {
v.Add("chat_id", config.SuperGroupUsername)
}
resp, err := bot.MakeRequest("getChatAdministrators", v)
if... | [
"func",
"(",
"bot",
"*",
"BotAPI",
")",
"GetChatAdministrators",
"(",
"config",
"ChatConfig",
")",
"(",
"[",
"]",
"ChatMember",
",",
"error",
")",
"{",
"v",
":=",
"url",
".",
"Values",
"{",
"}",
"\n\n",
"if",
"config",
".",
"SuperGroupUsername",
"==",
... | // GetChatAdministrators gets a list of administrators in the chat.
//
// If none have been appointed, only the creator will be returned.
// Bots are not shown, even if they are an administrator. | [
"GetChatAdministrators",
"gets",
"a",
"list",
"of",
"administrators",
"in",
"the",
"chat",
".",
"If",
"none",
"have",
"been",
"appointed",
"only",
"the",
"creator",
"will",
"be",
"returned",
".",
"Bots",
"are",
"not",
"shown",
"even",
"if",
"they",
"are",
... | 87e7035a900c7cb1fd896e5f33b461c96c3ac31e | https://github.com/go-telegram-bot-api/telegram-bot-api/blob/87e7035a900c7cb1fd896e5f33b461c96c3ac31e/bot.go#L646-L666 |
31,380 | go-telegram-bot-api/telegram-bot-api | bot.go | GetChatMembersCount | func (bot *BotAPI) GetChatMembersCount(config ChatConfig) (int, error) {
v := url.Values{}
if config.SuperGroupUsername == "" {
v.Add("chat_id", strconv.FormatInt(config.ChatID, 10))
} else {
v.Add("chat_id", config.SuperGroupUsername)
}
resp, err := bot.MakeRequest("getChatMembersCount", v)
if err != nil {... | go | func (bot *BotAPI) GetChatMembersCount(config ChatConfig) (int, error) {
v := url.Values{}
if config.SuperGroupUsername == "" {
v.Add("chat_id", strconv.FormatInt(config.ChatID, 10))
} else {
v.Add("chat_id", config.SuperGroupUsername)
}
resp, err := bot.MakeRequest("getChatMembersCount", v)
if err != nil {... | [
"func",
"(",
"bot",
"*",
"BotAPI",
")",
"GetChatMembersCount",
"(",
"config",
"ChatConfig",
")",
"(",
"int",
",",
"error",
")",
"{",
"v",
":=",
"url",
".",
"Values",
"{",
"}",
"\n\n",
"if",
"config",
".",
"SuperGroupUsername",
"==",
"\"",
"\"",
"{",
... | // GetChatMembersCount gets the number of users in a chat. | [
"GetChatMembersCount",
"gets",
"the",
"number",
"of",
"users",
"in",
"a",
"chat",
"."
] | 87e7035a900c7cb1fd896e5f33b461c96c3ac31e | https://github.com/go-telegram-bot-api/telegram-bot-api/blob/87e7035a900c7cb1fd896e5f33b461c96c3ac31e/bot.go#L669-L689 |
31,381 | go-telegram-bot-api/telegram-bot-api | bot.go | GetChatMember | func (bot *BotAPI) GetChatMember(config ChatConfigWithUser) (ChatMember, error) {
v := url.Values{}
if config.SuperGroupUsername == "" {
v.Add("chat_id", strconv.FormatInt(config.ChatID, 10))
} else {
v.Add("chat_id", config.SuperGroupUsername)
}
v.Add("user_id", strconv.Itoa(config.UserID))
resp, err := bo... | go | func (bot *BotAPI) GetChatMember(config ChatConfigWithUser) (ChatMember, error) {
v := url.Values{}
if config.SuperGroupUsername == "" {
v.Add("chat_id", strconv.FormatInt(config.ChatID, 10))
} else {
v.Add("chat_id", config.SuperGroupUsername)
}
v.Add("user_id", strconv.Itoa(config.UserID))
resp, err := bo... | [
"func",
"(",
"bot",
"*",
"BotAPI",
")",
"GetChatMember",
"(",
"config",
"ChatConfigWithUser",
")",
"(",
"ChatMember",
",",
"error",
")",
"{",
"v",
":=",
"url",
".",
"Values",
"{",
"}",
"\n\n",
"if",
"config",
".",
"SuperGroupUsername",
"==",
"\"",
"\"",
... | // GetChatMember gets a specific chat member. | [
"GetChatMember",
"gets",
"a",
"specific",
"chat",
"member",
"."
] | 87e7035a900c7cb1fd896e5f33b461c96c3ac31e | https://github.com/go-telegram-bot-api/telegram-bot-api/blob/87e7035a900c7cb1fd896e5f33b461c96c3ac31e/bot.go#L692-L713 |
31,382 | go-telegram-bot-api/telegram-bot-api | bot.go | UnbanChatMember | func (bot *BotAPI) UnbanChatMember(config ChatMemberConfig) (APIResponse, error) {
v := url.Values{}
if config.SuperGroupUsername != "" {
v.Add("chat_id", config.SuperGroupUsername)
} else if config.ChannelUsername != "" {
v.Add("chat_id", config.ChannelUsername)
} else {
v.Add("chat_id", strconv.FormatInt(c... | go | func (bot *BotAPI) UnbanChatMember(config ChatMemberConfig) (APIResponse, error) {
v := url.Values{}
if config.SuperGroupUsername != "" {
v.Add("chat_id", config.SuperGroupUsername)
} else if config.ChannelUsername != "" {
v.Add("chat_id", config.ChannelUsername)
} else {
v.Add("chat_id", strconv.FormatInt(c... | [
"func",
"(",
"bot",
"*",
"BotAPI",
")",
"UnbanChatMember",
"(",
"config",
"ChatMemberConfig",
")",
"(",
"APIResponse",
",",
"error",
")",
"{",
"v",
":=",
"url",
".",
"Values",
"{",
"}",
"\n\n",
"if",
"config",
".",
"SuperGroupUsername",
"!=",
"\"",
"\"",... | // UnbanChatMember unbans a user from a chat. Note that this only will work
// in supergroups and channels, and requires the bot to be an admin. | [
"UnbanChatMember",
"unbans",
"a",
"user",
"from",
"a",
"chat",
".",
"Note",
"that",
"this",
"only",
"will",
"work",
"in",
"supergroups",
"and",
"channels",
"and",
"requires",
"the",
"bot",
"to",
"be",
"an",
"admin",
"."
] | 87e7035a900c7cb1fd896e5f33b461c96c3ac31e | https://github.com/go-telegram-bot-api/telegram-bot-api/blob/87e7035a900c7cb1fd896e5f33b461c96c3ac31e/bot.go#L717-L732 |
31,383 | go-telegram-bot-api/telegram-bot-api | bot.go | RestrictChatMember | func (bot *BotAPI) RestrictChatMember(config RestrictChatMemberConfig) (APIResponse, error) {
v := url.Values{}
if config.SuperGroupUsername != "" {
v.Add("chat_id", config.SuperGroupUsername)
} else if config.ChannelUsername != "" {
v.Add("chat_id", config.ChannelUsername)
} else {
v.Add("chat_id", strconv.... | go | func (bot *BotAPI) RestrictChatMember(config RestrictChatMemberConfig) (APIResponse, error) {
v := url.Values{}
if config.SuperGroupUsername != "" {
v.Add("chat_id", config.SuperGroupUsername)
} else if config.ChannelUsername != "" {
v.Add("chat_id", config.ChannelUsername)
} else {
v.Add("chat_id", strconv.... | [
"func",
"(",
"bot",
"*",
"BotAPI",
")",
"RestrictChatMember",
"(",
"config",
"RestrictChatMemberConfig",
")",
"(",
"APIResponse",
",",
"error",
")",
"{",
"v",
":=",
"url",
".",
"Values",
"{",
"}",
"\n\n",
"if",
"config",
".",
"SuperGroupUsername",
"!=",
"\... | // RestrictChatMember to restrict a user in a supergroup. The bot must be an
//administrator in the supergroup for this to work and must have the
//appropriate admin rights. Pass True for all boolean parameters to lift
//restrictions from a user. Returns True on success. | [
"RestrictChatMember",
"to",
"restrict",
"a",
"user",
"in",
"a",
"supergroup",
".",
"The",
"bot",
"must",
"be",
"an",
"administrator",
"in",
"the",
"supergroup",
"for",
"this",
"to",
"work",
"and",
"must",
"have",
"the",
"appropriate",
"admin",
"rights",
".",... | 87e7035a900c7cb1fd896e5f33b461c96c3ac31e | https://github.com/go-telegram-bot-api/telegram-bot-api/blob/87e7035a900c7cb1fd896e5f33b461c96c3ac31e/bot.go#L738-L769 |
31,384 | go-telegram-bot-api/telegram-bot-api | bot.go | PromoteChatMember | func (bot *BotAPI) PromoteChatMember(config PromoteChatMemberConfig) (APIResponse, error) {
v := url.Values{}
if config.SuperGroupUsername != "" {
v.Add("chat_id", config.SuperGroupUsername)
} else if config.ChannelUsername != "" {
v.Add("chat_id", config.ChannelUsername)
} else {
v.Add("chat_id", strconv.Fo... | go | func (bot *BotAPI) PromoteChatMember(config PromoteChatMemberConfig) (APIResponse, error) {
v := url.Values{}
if config.SuperGroupUsername != "" {
v.Add("chat_id", config.SuperGroupUsername)
} else if config.ChannelUsername != "" {
v.Add("chat_id", config.ChannelUsername)
} else {
v.Add("chat_id", strconv.Fo... | [
"func",
"(",
"bot",
"*",
"BotAPI",
")",
"PromoteChatMember",
"(",
"config",
"PromoteChatMemberConfig",
")",
"(",
"APIResponse",
",",
"error",
")",
"{",
"v",
":=",
"url",
".",
"Values",
"{",
"}",
"\n\n",
"if",
"config",
".",
"SuperGroupUsername",
"!=",
"\""... | // PromoteChatMember add admin rights to user | [
"PromoteChatMember",
"add",
"admin",
"rights",
"to",
"user"
] | 87e7035a900c7cb1fd896e5f33b461c96c3ac31e | https://github.com/go-telegram-bot-api/telegram-bot-api/blob/87e7035a900c7cb1fd896e5f33b461c96c3ac31e/bot.go#L772-L812 |
31,385 | go-telegram-bot-api/telegram-bot-api | bot.go | GetGameHighScores | func (bot *BotAPI) GetGameHighScores(config GetGameHighScoresConfig) ([]GameHighScore, error) {
v, _ := config.values()
resp, err := bot.MakeRequest(config.method(), v)
if err != nil {
return []GameHighScore{}, err
}
var highScores []GameHighScore
err = json.Unmarshal(resp.Result, &highScores)
return highSc... | go | func (bot *BotAPI) GetGameHighScores(config GetGameHighScoresConfig) ([]GameHighScore, error) {
v, _ := config.values()
resp, err := bot.MakeRequest(config.method(), v)
if err != nil {
return []GameHighScore{}, err
}
var highScores []GameHighScore
err = json.Unmarshal(resp.Result, &highScores)
return highSc... | [
"func",
"(",
"bot",
"*",
"BotAPI",
")",
"GetGameHighScores",
"(",
"config",
"GetGameHighScoresConfig",
")",
"(",
"[",
"]",
"GameHighScore",
",",
"error",
")",
"{",
"v",
",",
"_",
":=",
"config",
".",
"values",
"(",
")",
"\n\n",
"resp",
",",
"err",
":="... | // GetGameHighScores allows you to get the high scores for a game. | [
"GetGameHighScores",
"allows",
"you",
"to",
"get",
"the",
"high",
"scores",
"for",
"a",
"game",
"."
] | 87e7035a900c7cb1fd896e5f33b461c96c3ac31e | https://github.com/go-telegram-bot-api/telegram-bot-api/blob/87e7035a900c7cb1fd896e5f33b461c96c3ac31e/bot.go#L815-L827 |
31,386 | go-telegram-bot-api/telegram-bot-api | bot.go | AnswerShippingQuery | func (bot *BotAPI) AnswerShippingQuery(config ShippingConfig) (APIResponse, error) {
v := url.Values{}
v.Add("shipping_query_id", config.ShippingQueryID)
v.Add("ok", strconv.FormatBool(config.OK))
if config.OK == true {
data, err := json.Marshal(config.ShippingOptions)
if err != nil {
return APIResponse{}, ... | go | func (bot *BotAPI) AnswerShippingQuery(config ShippingConfig) (APIResponse, error) {
v := url.Values{}
v.Add("shipping_query_id", config.ShippingQueryID)
v.Add("ok", strconv.FormatBool(config.OK))
if config.OK == true {
data, err := json.Marshal(config.ShippingOptions)
if err != nil {
return APIResponse{}, ... | [
"func",
"(",
"bot",
"*",
"BotAPI",
")",
"AnswerShippingQuery",
"(",
"config",
"ShippingConfig",
")",
"(",
"APIResponse",
",",
"error",
")",
"{",
"v",
":=",
"url",
".",
"Values",
"{",
"}",
"\n\n",
"v",
".",
"Add",
"(",
"\"",
"\"",
",",
"config",
".",
... | // AnswerShippingQuery allows you to reply to Update with shipping_query parameter. | [
"AnswerShippingQuery",
"allows",
"you",
"to",
"reply",
"to",
"Update",
"with",
"shipping_query",
"parameter",
"."
] | 87e7035a900c7cb1fd896e5f33b461c96c3ac31e | https://github.com/go-telegram-bot-api/telegram-bot-api/blob/87e7035a900c7cb1fd896e5f33b461c96c3ac31e/bot.go#L830-L848 |
31,387 | go-telegram-bot-api/telegram-bot-api | bot.go | AnswerPreCheckoutQuery | func (bot *BotAPI) AnswerPreCheckoutQuery(config PreCheckoutConfig) (APIResponse, error) {
v := url.Values{}
v.Add("pre_checkout_query_id", config.PreCheckoutQueryID)
v.Add("ok", strconv.FormatBool(config.OK))
if config.OK != true {
v.Add("error", config.ErrorMessage)
}
bot.debugLog("answerPreCheckoutQuery", ... | go | func (bot *BotAPI) AnswerPreCheckoutQuery(config PreCheckoutConfig) (APIResponse, error) {
v := url.Values{}
v.Add("pre_checkout_query_id", config.PreCheckoutQueryID)
v.Add("ok", strconv.FormatBool(config.OK))
if config.OK != true {
v.Add("error", config.ErrorMessage)
}
bot.debugLog("answerPreCheckoutQuery", ... | [
"func",
"(",
"bot",
"*",
"BotAPI",
")",
"AnswerPreCheckoutQuery",
"(",
"config",
"PreCheckoutConfig",
")",
"(",
"APIResponse",
",",
"error",
")",
"{",
"v",
":=",
"url",
".",
"Values",
"{",
"}",
"\n\n",
"v",
".",
"Add",
"(",
"\"",
"\"",
",",
"config",
... | // AnswerPreCheckoutQuery allows you to reply to Update with pre_checkout_query. | [
"AnswerPreCheckoutQuery",
"allows",
"you",
"to",
"reply",
"to",
"Update",
"with",
"pre_checkout_query",
"."
] | 87e7035a900c7cb1fd896e5f33b461c96c3ac31e | https://github.com/go-telegram-bot-api/telegram-bot-api/blob/87e7035a900c7cb1fd896e5f33b461c96c3ac31e/bot.go#L851-L863 |
31,388 | go-telegram-bot-api/telegram-bot-api | bot.go | DeleteMessage | func (bot *BotAPI) DeleteMessage(config DeleteMessageConfig) (APIResponse, error) {
v, err := config.values()
if err != nil {
return APIResponse{}, err
}
bot.debugLog(config.method(), v, nil)
return bot.MakeRequest(config.method(), v)
} | go | func (bot *BotAPI) DeleteMessage(config DeleteMessageConfig) (APIResponse, error) {
v, err := config.values()
if err != nil {
return APIResponse{}, err
}
bot.debugLog(config.method(), v, nil)
return bot.MakeRequest(config.method(), v)
} | [
"func",
"(",
"bot",
"*",
"BotAPI",
")",
"DeleteMessage",
"(",
"config",
"DeleteMessageConfig",
")",
"(",
"APIResponse",
",",
"error",
")",
"{",
"v",
",",
"err",
":=",
"config",
".",
"values",
"(",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"... | // DeleteMessage deletes a message in a chat | [
"DeleteMessage",
"deletes",
"a",
"message",
"in",
"a",
"chat"
] | 87e7035a900c7cb1fd896e5f33b461c96c3ac31e | https://github.com/go-telegram-bot-api/telegram-bot-api/blob/87e7035a900c7cb1fd896e5f33b461c96c3ac31e/bot.go#L866-L875 |
31,389 | go-telegram-bot-api/telegram-bot-api | bot.go | GetInviteLink | func (bot *BotAPI) GetInviteLink(config ChatConfig) (string, error) {
v := url.Values{}
if config.SuperGroupUsername == "" {
v.Add("chat_id", strconv.FormatInt(config.ChatID, 10))
} else {
v.Add("chat_id", config.SuperGroupUsername)
}
resp, err := bot.MakeRequest("exportChatInviteLink", v)
if err != nil {
... | go | func (bot *BotAPI) GetInviteLink(config ChatConfig) (string, error) {
v := url.Values{}
if config.SuperGroupUsername == "" {
v.Add("chat_id", strconv.FormatInt(config.ChatID, 10))
} else {
v.Add("chat_id", config.SuperGroupUsername)
}
resp, err := bot.MakeRequest("exportChatInviteLink", v)
if err != nil {
... | [
"func",
"(",
"bot",
"*",
"BotAPI",
")",
"GetInviteLink",
"(",
"config",
"ChatConfig",
")",
"(",
"string",
",",
"error",
")",
"{",
"v",
":=",
"url",
".",
"Values",
"{",
"}",
"\n\n",
"if",
"config",
".",
"SuperGroupUsername",
"==",
"\"",
"\"",
"{",
"v"... | // GetInviteLink get InviteLink for a chat | [
"GetInviteLink",
"get",
"InviteLink",
"for",
"a",
"chat"
] | 87e7035a900c7cb1fd896e5f33b461c96c3ac31e | https://github.com/go-telegram-bot-api/telegram-bot-api/blob/87e7035a900c7cb1fd896e5f33b461c96c3ac31e/bot.go#L878-L896 |
31,390 | go-telegram-bot-api/telegram-bot-api | bot.go | PinChatMessage | func (bot *BotAPI) PinChatMessage(config PinChatMessageConfig) (APIResponse, error) {
v, err := config.values()
if err != nil {
return APIResponse{}, err
}
bot.debugLog(config.method(), v, nil)
return bot.MakeRequest(config.method(), v)
} | go | func (bot *BotAPI) PinChatMessage(config PinChatMessageConfig) (APIResponse, error) {
v, err := config.values()
if err != nil {
return APIResponse{}, err
}
bot.debugLog(config.method(), v, nil)
return bot.MakeRequest(config.method(), v)
} | [
"func",
"(",
"bot",
"*",
"BotAPI",
")",
"PinChatMessage",
"(",
"config",
"PinChatMessageConfig",
")",
"(",
"APIResponse",
",",
"error",
")",
"{",
"v",
",",
"err",
":=",
"config",
".",
"values",
"(",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
... | // PinChatMessage pin message in supergroup | [
"PinChatMessage",
"pin",
"message",
"in",
"supergroup"
] | 87e7035a900c7cb1fd896e5f33b461c96c3ac31e | https://github.com/go-telegram-bot-api/telegram-bot-api/blob/87e7035a900c7cb1fd896e5f33b461c96c3ac31e/bot.go#L899-L908 |
31,391 | go-telegram-bot-api/telegram-bot-api | bot.go | UnpinChatMessage | func (bot *BotAPI) UnpinChatMessage(config UnpinChatMessageConfig) (APIResponse, error) {
v, err := config.values()
if err != nil {
return APIResponse{}, err
}
bot.debugLog(config.method(), v, nil)
return bot.MakeRequest(config.method(), v)
} | go | func (bot *BotAPI) UnpinChatMessage(config UnpinChatMessageConfig) (APIResponse, error) {
v, err := config.values()
if err != nil {
return APIResponse{}, err
}
bot.debugLog(config.method(), v, nil)
return bot.MakeRequest(config.method(), v)
} | [
"func",
"(",
"bot",
"*",
"BotAPI",
")",
"UnpinChatMessage",
"(",
"config",
"UnpinChatMessageConfig",
")",
"(",
"APIResponse",
",",
"error",
")",
"{",
"v",
",",
"err",
":=",
"config",
".",
"values",
"(",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return... | // UnpinChatMessage unpin message in supergroup | [
"UnpinChatMessage",
"unpin",
"message",
"in",
"supergroup"
] | 87e7035a900c7cb1fd896e5f33b461c96c3ac31e | https://github.com/go-telegram-bot-api/telegram-bot-api/blob/87e7035a900c7cb1fd896e5f33b461c96c3ac31e/bot.go#L911-L920 |
31,392 | go-telegram-bot-api/telegram-bot-api | bot.go | SetChatTitle | func (bot *BotAPI) SetChatTitle(config SetChatTitleConfig) (APIResponse, error) {
v, err := config.values()
if err != nil {
return APIResponse{}, err
}
bot.debugLog(config.method(), v, nil)
return bot.MakeRequest(config.method(), v)
} | go | func (bot *BotAPI) SetChatTitle(config SetChatTitleConfig) (APIResponse, error) {
v, err := config.values()
if err != nil {
return APIResponse{}, err
}
bot.debugLog(config.method(), v, nil)
return bot.MakeRequest(config.method(), v)
} | [
"func",
"(",
"bot",
"*",
"BotAPI",
")",
"SetChatTitle",
"(",
"config",
"SetChatTitleConfig",
")",
"(",
"APIResponse",
",",
"error",
")",
"{",
"v",
",",
"err",
":=",
"config",
".",
"values",
"(",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"AP... | // SetChatTitle change title of chat. | [
"SetChatTitle",
"change",
"title",
"of",
"chat",
"."
] | 87e7035a900c7cb1fd896e5f33b461c96c3ac31e | https://github.com/go-telegram-bot-api/telegram-bot-api/blob/87e7035a900c7cb1fd896e5f33b461c96c3ac31e/bot.go#L923-L932 |
31,393 | go-telegram-bot-api/telegram-bot-api | bot.go | SetChatDescription | func (bot *BotAPI) SetChatDescription(config SetChatDescriptionConfig) (APIResponse, error) {
v, err := config.values()
if err != nil {
return APIResponse{}, err
}
bot.debugLog(config.method(), v, nil)
return bot.MakeRequest(config.method(), v)
} | go | func (bot *BotAPI) SetChatDescription(config SetChatDescriptionConfig) (APIResponse, error) {
v, err := config.values()
if err != nil {
return APIResponse{}, err
}
bot.debugLog(config.method(), v, nil)
return bot.MakeRequest(config.method(), v)
} | [
"func",
"(",
"bot",
"*",
"BotAPI",
")",
"SetChatDescription",
"(",
"config",
"SetChatDescriptionConfig",
")",
"(",
"APIResponse",
",",
"error",
")",
"{",
"v",
",",
"err",
":=",
"config",
".",
"values",
"(",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"re... | // SetChatDescription change description of chat. | [
"SetChatDescription",
"change",
"description",
"of",
"chat",
"."
] | 87e7035a900c7cb1fd896e5f33b461c96c3ac31e | https://github.com/go-telegram-bot-api/telegram-bot-api/blob/87e7035a900c7cb1fd896e5f33b461c96c3ac31e/bot.go#L935-L944 |
31,394 | go-telegram-bot-api/telegram-bot-api | bot.go | SetChatPhoto | func (bot *BotAPI) SetChatPhoto(config SetChatPhotoConfig) (APIResponse, error) {
params, err := config.params()
if err != nil {
return APIResponse{}, err
}
file := config.getFile()
return bot.UploadFile(config.method(), params, config.name(), file)
} | go | func (bot *BotAPI) SetChatPhoto(config SetChatPhotoConfig) (APIResponse, error) {
params, err := config.params()
if err != nil {
return APIResponse{}, err
}
file := config.getFile()
return bot.UploadFile(config.method(), params, config.name(), file)
} | [
"func",
"(",
"bot",
"*",
"BotAPI",
")",
"SetChatPhoto",
"(",
"config",
"SetChatPhotoConfig",
")",
"(",
"APIResponse",
",",
"error",
")",
"{",
"params",
",",
"err",
":=",
"config",
".",
"params",
"(",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
... | // SetChatPhoto change photo of chat. | [
"SetChatPhoto",
"change",
"photo",
"of",
"chat",
"."
] | 87e7035a900c7cb1fd896e5f33b461c96c3ac31e | https://github.com/go-telegram-bot-api/telegram-bot-api/blob/87e7035a900c7cb1fd896e5f33b461c96c3ac31e/bot.go#L947-L956 |
31,395 | go-telegram-bot-api/telegram-bot-api | bot.go | DeleteChatPhoto | func (bot *BotAPI) DeleteChatPhoto(config DeleteChatPhotoConfig) (APIResponse, error) {
v, err := config.values()
if err != nil {
return APIResponse{}, err
}
bot.debugLog(config.method(), v, nil)
return bot.MakeRequest(config.method(), v)
} | go | func (bot *BotAPI) DeleteChatPhoto(config DeleteChatPhotoConfig) (APIResponse, error) {
v, err := config.values()
if err != nil {
return APIResponse{}, err
}
bot.debugLog(config.method(), v, nil)
return bot.MakeRequest(config.method(), v)
} | [
"func",
"(",
"bot",
"*",
"BotAPI",
")",
"DeleteChatPhoto",
"(",
"config",
"DeleteChatPhotoConfig",
")",
"(",
"APIResponse",
",",
"error",
")",
"{",
"v",
",",
"err",
":=",
"config",
".",
"values",
"(",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",... | // DeleteChatPhoto delete photo of chat. | [
"DeleteChatPhoto",
"delete",
"photo",
"of",
"chat",
"."
] | 87e7035a900c7cb1fd896e5f33b461c96c3ac31e | https://github.com/go-telegram-bot-api/telegram-bot-api/blob/87e7035a900c7cb1fd896e5f33b461c96c3ac31e/bot.go#L959-L968 |
31,396 | go-telegram-bot-api/telegram-bot-api | configs.go | values | func (chat *BaseChat) values() (url.Values, error) {
v := url.Values{}
if chat.ChannelUsername != "" {
v.Add("chat_id", chat.ChannelUsername)
} else {
v.Add("chat_id", strconv.FormatInt(chat.ChatID, 10))
}
if chat.ReplyToMessageID != 0 {
v.Add("reply_to_message_id", strconv.Itoa(chat.ReplyToMessageID))
}
... | go | func (chat *BaseChat) values() (url.Values, error) {
v := url.Values{}
if chat.ChannelUsername != "" {
v.Add("chat_id", chat.ChannelUsername)
} else {
v.Add("chat_id", strconv.FormatInt(chat.ChatID, 10))
}
if chat.ReplyToMessageID != 0 {
v.Add("reply_to_message_id", strconv.Itoa(chat.ReplyToMessageID))
}
... | [
"func",
"(",
"chat",
"*",
"BaseChat",
")",
"values",
"(",
")",
"(",
"url",
".",
"Values",
",",
"error",
")",
"{",
"v",
":=",
"url",
".",
"Values",
"{",
"}",
"\n",
"if",
"chat",
".",
"ChannelUsername",
"!=",
"\"",
"\"",
"{",
"v",
".",
"Add",
"("... | // values returns url.Values representation of BaseChat | [
"values",
"returns",
"url",
".",
"Values",
"representation",
"of",
"BaseChat"
] | 87e7035a900c7cb1fd896e5f33b461c96c3ac31e | https://github.com/go-telegram-bot-api/telegram-bot-api/blob/87e7035a900c7cb1fd896e5f33b461c96c3ac31e/configs.go#L75-L99 |
31,397 | go-telegram-bot-api/telegram-bot-api | configs.go | values | func (config MessageConfig) values() (url.Values, error) {
v, err := config.BaseChat.values()
if err != nil {
return v, err
}
v.Add("text", config.Text)
v.Add("disable_web_page_preview", strconv.FormatBool(config.DisableWebPagePreview))
if config.ParseMode != "" {
v.Add("parse_mode", config.ParseMode)
}
re... | go | func (config MessageConfig) values() (url.Values, error) {
v, err := config.BaseChat.values()
if err != nil {
return v, err
}
v.Add("text", config.Text)
v.Add("disable_web_page_preview", strconv.FormatBool(config.DisableWebPagePreview))
if config.ParseMode != "" {
v.Add("parse_mode", config.ParseMode)
}
re... | [
"func",
"(",
"config",
"MessageConfig",
")",
"values",
"(",
")",
"(",
"url",
".",
"Values",
",",
"error",
")",
"{",
"v",
",",
"err",
":=",
"config",
".",
"BaseChat",
".",
"values",
"(",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"v",
","... | // values returns a url.Values representation of MessageConfig. | [
"values",
"returns",
"a",
"url",
".",
"Values",
"representation",
"of",
"MessageConfig",
"."
] | 87e7035a900c7cb1fd896e5f33b461c96c3ac31e | https://github.com/go-telegram-bot-api/telegram-bot-api/blob/87e7035a900c7cb1fd896e5f33b461c96c3ac31e/configs.go#L200-L212 |
31,398 | go-telegram-bot-api/telegram-bot-api | configs.go | values | func (config ForwardConfig) values() (url.Values, error) {
v, err := config.BaseChat.values()
if err != nil {
return v, err
}
v.Add("from_chat_id", strconv.FormatInt(config.FromChatID, 10))
v.Add("message_id", strconv.Itoa(config.MessageID))
return v, nil
} | go | func (config ForwardConfig) values() (url.Values, error) {
v, err := config.BaseChat.values()
if err != nil {
return v, err
}
v.Add("from_chat_id", strconv.FormatInt(config.FromChatID, 10))
v.Add("message_id", strconv.Itoa(config.MessageID))
return v, nil
} | [
"func",
"(",
"config",
"ForwardConfig",
")",
"values",
"(",
")",
"(",
"url",
".",
"Values",
",",
"error",
")",
"{",
"v",
",",
"err",
":=",
"config",
".",
"BaseChat",
".",
"values",
"(",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"v",
","... | // values returns a url.Values representation of ForwardConfig. | [
"values",
"returns",
"a",
"url",
".",
"Values",
"representation",
"of",
"ForwardConfig",
"."
] | 87e7035a900c7cb1fd896e5f33b461c96c3ac31e | https://github.com/go-telegram-bot-api/telegram-bot-api/blob/87e7035a900c7cb1fd896e5f33b461c96c3ac31e/configs.go#L228-L236 |
31,399 | go-telegram-bot-api/telegram-bot-api | configs.go | values | func (config DocumentConfig) values() (url.Values, error) {
v, err := config.BaseChat.values()
if err != nil {
return v, err
}
v.Add(config.name(), config.FileID)
if config.Caption != "" {
v.Add("caption", config.Caption)
if config.ParseMode != "" {
v.Add("parse_mode", config.ParseMode)
}
}
return v... | go | func (config DocumentConfig) values() (url.Values, error) {
v, err := config.BaseChat.values()
if err != nil {
return v, err
}
v.Add(config.name(), config.FileID)
if config.Caption != "" {
v.Add("caption", config.Caption)
if config.ParseMode != "" {
v.Add("parse_mode", config.ParseMode)
}
}
return v... | [
"func",
"(",
"config",
"DocumentConfig",
")",
"values",
"(",
")",
"(",
"url",
".",
"Values",
",",
"error",
")",
"{",
"v",
",",
"err",
":=",
"config",
".",
"BaseChat",
".",
"values",
"(",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"v",
",... | // values returns a url.Values representation of DocumentConfig. | [
"values",
"returns",
"a",
"url",
".",
"Values",
"representation",
"of",
"DocumentConfig",
"."
] | 87e7035a900c7cb1fd896e5f33b461c96c3ac31e | https://github.com/go-telegram-bot-api/telegram-bot-api/blob/87e7035a900c7cb1fd896e5f33b461c96c3ac31e/configs.go#L372-L387 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.