Remove old advertisement types as they are no longer used
This commit is contained in:
4
chat.go
4
chat.go
@ -750,7 +750,9 @@ func (c Chat) Mark(messageID int) (ChatAPI, error) {
|
|||||||
return r, nil
|
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 {
|
func (k *Keybase) AdvertiseCommands(options AdvertiseCommandsOptions) error {
|
||||||
type res struct {
|
type res struct {
|
||||||
Error *Error `json:"error,omitempty"`
|
Error *Error `json:"error,omitempty"`
|
||||||
|
|||||||
24
keybase.go
24
keybase.go
@ -40,30 +40,6 @@ func NewKeybase(path ...string) *Keybase {
|
|||||||
return k
|
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
|
// Exec executes the given Keybase command
|
||||||
func (k *Keybase) Exec(command ...string) ([]byte, error) {
|
func (k *Keybase) Exec(command ...string) ([]byte, error) {
|
||||||
out, err := exec.Command(k.Path, command...).Output()
|
out, err := exec.Command(k.Path, command...).Output()
|
||||||
|
|||||||
20
types.go
20
types.go
@ -453,25 +453,6 @@ type notification struct {
|
|||||||
Details details `json:"details"`
|
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 {
|
type mesg struct {
|
||||||
Body string `json:"body"`
|
Body string `json:"body"`
|
||||||
}
|
}
|
||||||
@ -490,7 +471,6 @@ type options struct {
|
|||||||
ReplyTo int `json:"reply_to,omitempty"`
|
ReplyTo int `json:"reply_to,omitempty"`
|
||||||
GameID string `json:"game_id,omitempty"`
|
GameID string `json:"game_id,omitempty"`
|
||||||
Alias string `json:"alias,omitempty"`
|
Alias string `json:"alias,omitempty"`
|
||||||
BotAdvertisements []BotAdvertisement `json:"advertisements,omitempty"`
|
|
||||||
//ExplodingLifetime duration `json:"exploding_lifetime,omitempty"`
|
//ExplodingLifetime duration `json:"exploding_lifetime,omitempty"`
|
||||||
|
|
||||||
Name string `json:"name,omitempty"`
|
Name string `json:"name,omitempty"`
|
||||||
|
|||||||
Reference in New Issue
Block a user