|
|
@ -5,6 +5,8 @@ import ( |
|
|
|
"fmt" |
|
|
|
"fmt" |
|
|
|
"strings" |
|
|
|
"strings" |
|
|
|
"time" |
|
|
|
"time" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"samhofi.us/x/keybase/types/chat1" |
|
|
|
) |
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
// RunOptions holds a set of options to be passed to Run
|
|
|
|
// RunOptions holds a set of options to be passed to Run
|
|
|
@ -15,8 +17,8 @@ type RunOptions struct { |
|
|
|
HideExploding bool // Ignore exploding messages
|
|
|
|
HideExploding bool // Ignore exploding messages
|
|
|
|
Dev bool // Subscribe to dev channel messages
|
|
|
|
Dev bool // Subscribe to dev channel messages
|
|
|
|
Wallet bool // Subscribe to wallet events
|
|
|
|
Wallet bool // Subscribe to wallet events
|
|
|
|
FilterChannel Channel // Only subscribe to messages from specified channel
|
|
|
|
FilterChannel chat1.ChatChannel // Only subscribe to messages from specified channel
|
|
|
|
FilterChannels []Channel // Only subscribe to messages from specified channels
|
|
|
|
FilterChannels []chat1.ChatChannel // Only subscribe to messages from specified channels
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// ChatAPI holds information about a message received by the `keybase chat api-listen` command
|
|
|
|
// ChatAPI holds information about a message received by the `keybase chat api-listen` command
|
|
|
@ -231,7 +233,7 @@ type content struct { |
|
|
|
type msg struct { |
|
|
|
type msg struct { |
|
|
|
ID int `json:"id"` |
|
|
|
ID int `json:"id"` |
|
|
|
ConversationID string `json:"conversation_id"` |
|
|
|
ConversationID string `json:"conversation_id"` |
|
|
|
Channel Channel `json:"channel"` |
|
|
|
Channel chat1.ChatChannel `json:"channel"` |
|
|
|
Sender sender `json:"sender"` |
|
|
|
Sender sender `json:"sender"` |
|
|
|
SentAt int `json:"sent_at"` |
|
|
|
SentAt int `json:"sent_at"` |
|
|
|
SentAtMs int64 `json:"sent_at_ms"` |
|
|
|
SentAtMs int64 `json:"sent_at_ms"` |
|
|
@ -296,15 +298,6 @@ type notification struct { |
|
|
|
Details details `json:"details"` |
|
|
|
Details details `json:"details"` |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Channel holds information about a conversation
|
|
|
|
|
|
|
|
type Channel struct { |
|
|
|
|
|
|
|
Name string `json:"name,omitempty"` |
|
|
|
|
|
|
|
Public bool `json:"public,omitempty"` |
|
|
|
|
|
|
|
MembersType string `json:"members_type,omitempty"` |
|
|
|
|
|
|
|
TopicType string `json:"topic_type,omitempty"` |
|
|
|
|
|
|
|
TopicName string `json:"topic_name,omitempty"` |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
type BotCommand struct { |
|
|
|
type BotCommand struct { |
|
|
|
Name string `json:"name"` |
|
|
|
Name string `json:"name"` |
|
|
|
Description string `json:"description"` |
|
|
|
Description string `json:"description"` |
|
|
@ -342,7 +335,7 @@ func (d *duration) MarshalJSON() (b []byte, err error) { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
type options struct { |
|
|
|
type options struct { |
|
|
|
Channel *Channel `json:"channel,omitempty"` |
|
|
|
Channel *chat1.ChatChannel `json:"channel,omitempty"` |
|
|
|
MessageID int `json:"message_id,omitempty"` |
|
|
|
MessageID int `json:"message_id,omitempty"` |
|
|
|
Message *mesg `json:"message,omitempty"` |
|
|
|
Message *mesg `json:"message,omitempty"` |
|
|
|
Pagination *pagination `json:"pagination,omitempty"` |
|
|
|
Pagination *pagination `json:"pagination,omitempty"` |
|
|
@ -438,7 +431,7 @@ type rateLimits struct { |
|
|
|
|
|
|
|
|
|
|
|
type conversation struct { |
|
|
|
type conversation struct { |
|
|
|
ID string `json:"id"` |
|
|
|
ID string `json:"id"` |
|
|
|
Channel Channel `json:"channel"` |
|
|
|
Channel chat1.ChatChannel `json:"channel"` |
|
|
|
Unread bool `json:"unread"` |
|
|
|
Unread bool `json:"unread"` |
|
|
|
ActiveAt int `json:"active_at"` |
|
|
|
ActiveAt int `json:"active_at"` |
|
|
|
ActiveAtMs int64 `json:"active_at_ms"` |
|
|
|
ActiveAtMs int64 `json:"active_at_ms"` |
|
|
@ -831,7 +824,7 @@ type Keybase struct { |
|
|
|
// Chat holds basic information about a specific conversation
|
|
|
|
// Chat holds basic information about a specific conversation
|
|
|
|
type Chat struct { |
|
|
|
type Chat struct { |
|
|
|
keybase *Keybase |
|
|
|
keybase *Keybase |
|
|
|
Channel Channel |
|
|
|
Channel chat1.ChatChannel |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
type chat interface { |
|
|
|
type chat interface { |
|
|
@ -900,10 +893,10 @@ type kvInterface interface { |
|
|
|
type keybase interface { |
|
|
|
type keybase interface { |
|
|
|
AdvertiseCommand(advertisement BotAdvertisement) (ChatAPI, error) |
|
|
|
AdvertiseCommand(advertisement BotAdvertisement) (ChatAPI, error) |
|
|
|
AdvertiseCommands(advertisements []BotAdvertisement) (ChatAPI, error) |
|
|
|
AdvertiseCommands(advertisements []BotAdvertisement) (ChatAPI, error) |
|
|
|
ChatList(opts ...Channel) (ChatAPI, error) |
|
|
|
ChatList(opts ...chat1.ChatChannel) (ChatAPI, error) |
|
|
|
ClearCommands() (ChatAPI, error) |
|
|
|
ClearCommands() (ChatAPI, error) |
|
|
|
CreateTeam(name string) (TeamAPI, error) |
|
|
|
CreateTeam(name string) (TeamAPI, error) |
|
|
|
NewChat(channel Channel) Chat |
|
|
|
NewChat(channel chat1.ChatChannel) Chat |
|
|
|
NewTeam(name string) Team |
|
|
|
NewTeam(name string) Team |
|
|
|
NewKV(team string) KV |
|
|
|
NewKV(team string) KV |
|
|
|
NewWallet() Wallet |
|
|
|
NewWallet() Wallet |
|
|
|