emoji.go
author Mikael Berthe <mikael@lilotux.net>
Mon, 29 Jul 2019 21:57:47 +0200
changeset 253 0e8c8026cf40
parent 238 1c0042e76902
permissions -rw-r--r--
Update dependencies
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
208
0b58780582d9 Add GetCustomEmojis
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
     1
/*
0b58780582d9 Add GetCustomEmojis
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
     2
Copyright 2018 Mikael Berthe
0b58780582d9 Add GetCustomEmojis
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
     3
0b58780582d9 Add GetCustomEmojis
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
     4
Licensed under the MIT license.  Please see the LICENSE file is this directory.
0b58780582d9 Add GetCustomEmojis
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
     5
*/
0b58780582d9 Add GetCustomEmojis
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
     6
0b58780582d9 Add GetCustomEmojis
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
     7
package madon
0b58780582d9 Add GetCustomEmojis
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
     8
0b58780582d9 Add GetCustomEmojis
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
     9
import (
0b58780582d9 Add GetCustomEmojis
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    10
	"github.com/sendgrid/rest"
0b58780582d9 Add GetCustomEmojis
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    11
)
0b58780582d9 Add GetCustomEmojis
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    12
0b58780582d9 Add GetCustomEmojis
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    13
// GetCustomEmojis returns a list with the server custom emojis
0b58780582d9 Add GetCustomEmojis
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    14
func (mc *Client) GetCustomEmojis(lopt *LimitParams) ([]Emoji, error) {
0b58780582d9 Add GetCustomEmojis
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    15
	var emojiList []Emoji
238
1c0042e76902 Do not use a global API version
Mikael Berthe <mikael@lilotux.net>
parents: 208
diff changeset
    16
	if err := mc.apiCall("v1/custom_emojis", rest.Get, nil, lopt, nil, &emojiList); err != nil {
208
0b58780582d9 Add GetCustomEmojis
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    17
		return nil, err
0b58780582d9 Add GetCustomEmojis
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    18
	}
0b58780582d9 Add GetCustomEmojis
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    19
	return emojiList, nil
0b58780582d9 Add GetCustomEmojis
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    20
}