Documentation for newly introduced methods.

pull/76/head
Ian Byrd 8 years ago
parent a6c1dce4e0
commit acbbb524dc
No known key found for this signature in database
GPG Key ID: 598F598CA3B8055F

@ -79,6 +79,10 @@ type InlineQueryResult interface {
// InlineQueryResults is a slice wrapper for convenient marshalling.
type InlineQueryResults []InlineQueryResult
// MarshalJSON makes sure IQRs have proper IDs and Type variables set.
//
// If ID of some result appears empty, it gets set to a new hash.
// JSON-specific Type gets infered from the actual (specific) IQR type.
func (results *InlineQueryResults) MarshalJSON() ([]byte, error) {
for i, result := range *results {
if result.GetID() == "" {

@ -16,7 +16,7 @@ func (result *InlineQueryResultBase) GetID() string {
return result.ID
}
// GetID is part of IQRBase's implementation of IQR interface.
// SetID is part of IQRBase's implementation of IQR interface.
func (result *InlineQueryResultBase) SetID(id string) {
result.ID = id
}

Loading…
Cancel
Save