Add an option to hide unsupported notifications

This commit is contained in:
r 2021-12-13 13:58:15 +00:00
parent 1c8c661abb
commit db29c3d874
5 changed files with 60 additions and 37 deletions

View file

@ -23,9 +23,12 @@ type Notification struct {
}
// GetNotifications return notifications.
func (c *Client) GetNotifications(ctx context.Context, pg *Pagination, excludes []string) ([]*Notification, error) {
func (c *Client) GetNotifications(ctx context.Context, pg *Pagination, includes, excludes []string) ([]*Notification, error) {
var notifications []*Notification
params := url.Values{}
for _, include := range includes {
params.Add("include_types[]", include)
}
for _, exclude := range excludes {
params.Add("exclude_types[]", exclude)
}