From dd6726911e422890045651d0ceba3242801925d8 Mon Sep 17 00:00:00 2001 From: Sam Date: Thu, 12 Mar 2020 00:15:07 -0400 Subject: [PATCH] Remove old advertisement types as they are no longer used --- chat.go | 4 +++- keybase.go | 24 ------------------------ types.go | 20 -------------------- 3 files changed, 3 insertions(+), 45 deletions(-) diff --git a/chat.go b/chat.go index 303a591..93c3f25 100644 --- a/chat.go +++ b/chat.go @@ -750,7 +750,9 @@ func (c Chat) Mark(messageID int) (ChatAPI, error) { return r, nil } -// AdvertiseCommands sends bot command advertisements +// AdvertiseCommands sends bot command advertisements. +// Valid values for the `Typ` field in chat1.AdvertiseCommandAPIParam are +// "public", "teamconvs", and "teammembers" func (k *Keybase) AdvertiseCommands(options AdvertiseCommandsOptions) error { type res struct { Error *Error `json:"error,omitempty"` diff --git a/keybase.go b/keybase.go index 5720ed4..71722c0 100644 --- a/keybase.go +++ b/keybase.go @@ -40,30 +40,6 @@ func NewKeybase(path ...string) *Keybase { return k } -// NewBotCommand returns a new BotCommand instance -func NewBotCommand(name, description, usage string, extendedDescription ...BotCommandExtendedDescription) BotCommand { - result := BotCommand{ - Name: name, - Description: description, - Usage: usage, - } - - if len(extendedDescription) > 0 { - result.ExtendedDescription = &extendedDescription[0] - } - - return result -} - -// NewBotCommandExtendedDescription -func NewBotCommandExtendedDescription(title, desktopBody, mobileBody string) BotCommandExtendedDescription { - return BotCommandExtendedDescription{ - Title: title, - DesktopBody: desktopBody, - MobileBody: mobileBody, - } -} - // Exec executes the given Keybase command func (k *Keybase) Exec(command ...string) ([]byte, error) { out, err := exec.Command(k.Path, command...).Output() diff --git a/types.go b/types.go index 8aee86d..411683a 100644 --- a/types.go +++ b/types.go @@ -453,25 +453,6 @@ type notification struct { Details details `json:"details"` } -type BotCommand struct { - Name string `json:"name"` - Description string `json:"description"` - Usage string `json:"usage"` - ExtendedDescription *BotCommandExtendedDescription `json:"extended_description,omitempty"` -} - -type BotCommandExtendedDescription struct { - Title string `json:"title"` - DesktopBody string `json:"desktop_body"` - MobileBody string `json:"mobile_body"` -} - -type BotAdvertisement struct { - Type string `json:"type"` // "public", "teamconvs", "teammembers" - TeamName string `json:"team_name,omitempty"` // required if Type is not "public" - BotCommands []BotCommand `json:"commands"` -} - type mesg struct { Body string `json:"body"` } @@ -490,7 +471,6 @@ type options struct { ReplyTo int `json:"reply_to,omitempty"` GameID string `json:"game_id,omitempty"` Alias string `json:"alias,omitempty"` - BotAdvertisements []BotAdvertisement `json:"advertisements,omitempty"` //ExplodingLifetime duration `json:"exploding_lifetime,omitempty"` Name string `json:"name,omitempty"`