Documentation ¶
Index ¶
- Constants
- func GetWeekday() string
- func Title(meal string) string
- type Block
- type BlockMsg
- func (b *BlockMsg) AddBlock(blocks ...Block)
- func (b *BlockMsg) AddDividerBlock()
- func (b *BlockMsg) AddImageBlock(text string, imageURL string)
- func (b *BlockMsg) AddMenuBlock(menu []response.Menu, title string, image bool, takeout bool)
- func (b *BlockMsg) AddPollBlock()
- func (b *BlockMsg) AddTextBlock(text string)
- func (b *BlockMsg) Init(text string)
- type ImageBlock
- type Slack
- type SlackResponse
- type TextBlock
Constants ¶
View Source
const ( Notification = 1 DM = 2 Mention = 3 // Message Type, Meal Type Morning = "morning" Lunch = "lunch" Dinner = "dinner" )
Message Type, Meal Type
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Block ¶
type Block struct { // section, divider Type string `json:"type"` Text *TextBlock `json:"text,omitempty"` Accessory *ImageBlock `json:"accessory,omitempty"` BlockID *string `json:"block_id,omitempty"` // response only }
type BlockMsg ¶
type BlockMsg struct { Channel string `json:"channel"` As_user bool `json:"as_user"` Text string `json:"text"` UserName string `json:"username"` IconEmoji string `json:"icon_emoji"` Blocks *[]Block `json:"blocks,omitempty"` }
func (*BlockMsg) AddDividerBlock ¶
func (b *BlockMsg) AddDividerBlock()
func (*BlockMsg) AddImageBlock ¶
func (*BlockMsg) AddMenuBlock ¶
func (*BlockMsg) AddPollBlock ¶
func (b *BlockMsg) AddPollBlock()
func (*BlockMsg) AddTextBlock ¶
type ImageBlock ¶
type ImageBlock struct { Type string `json:"type"` ImageURL string `json:"image_url"` AltText string `json:"alt_text"` // response only Fallback *string `json:"fallback,omitempty"` ImageWidth *uint `json:"image_width,omitempty"` ImageHeight *uint `json:"image_height,omitempty"` ImageBytes *uint `json:"image_bytes,omitempty"` }
type Slack ¶
type Slack struct {
// contains filtered or unexported fields
}
Slack have info of bots. like token, ...
func (*Slack) SendMembersMsg ¶
SendMembersMsg is send number of meal members.
type SlackResponse ¶
type SlackResponse struct { Ok bool `json:"ok,omitempty"` Channel string `json:"channel,omitempty"` Timestamp string `json:"ts,omitempty"` Message struct { Bot_id string `json:"bot_id,omitempty"` Type string `json:"type,omitempty"` Text string `json:"text,omitempty"` User string `json:"user,omitempty"` Timestamp string `json:"ts,omitempty"` Team string `json:"team,omitempty"` Blocks []Block `json:"blocks,omitempty"` } `json:"message,omitempty"` Error *string `json:"error,omitempty"` Warning *string `json:"warning,omitempty"` Response_metadata *struct { Warnings []string `json:"warnings,omitempty"` } `json:"response_metadata,omitempty"` }
Click to show internal directories.
Click to hide internal directories.