1
0
mirror of synced 2024-11-21 20:46:05 +03:00

Merge pull request #4 from gwinn/master

MG Webhook structs
This commit is contained in:
Alex Lushpai 2018-05-29 13:46:58 +03:00 committed by GitHub
commit cf9726db9d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -93,3 +93,25 @@ type MessagesResponse struct {
MessageID int `json:"message_id"`
Time time.Time `json:"time"`
}
// Webhook request
type WebhookRequest struct {
Type string `json:"type"`
Meta TransportRequestMeta `json:"meta"`
Data WebhookData `json:"data"`
}
// WebhookData request data
type WebhookData struct {
ExternalUserID string `json:"external_user_id"`
ExternalMessageID string `json:"external_message_id,omitempty"`
ChannelID uint64 `json:"channel_id"`
ChatID int64 `json:"channel_id"` // TODO: add to webhook request
Content string `json:"content"`
QuoteMessageExternalID string `json:"quote_message_external_id,omitempty"`
}
type TransportRequestMeta struct {
ID uint64 `json:"id"`
Timestamp int64 `json:"timestamp"`
}