emoji.go
author Mikael Berthe <mikael@lilotux.net>
Mon, 28 May 2018 20:51:10 +0200
changeset 226 212a0e74e719
parent 208 0b58780582d9
child 238 1c0042e76902
permissions -rw-r--r--
Don't use base64 encoding for header & avatar uploads This should fix https://github.com/McKael/madonctl/issues/14.
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
0b58780582d9 Add GetCustomEmojis
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    16
	if err := mc.apiCall("custom_emojis", rest.Get, nil, lopt, nil, &emojiList); err != nil {
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
}