bot

package
v0.0.0-...-9c4fc95 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 12, 2023 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BotClient = SetLineBot()

Functions

func BillingAction

func BillingAction(lineId LineID, amount int, title string, note string) (billing.Billing, bot.LineBilling)

func CalculateAmount

func CalculateAmount(groupID string, amount float64) (float64, int)

func GetFlexMessageByLineFeatureNotification

func GetFlexMessageByLineFeatureNotification(lfn *bot.LineFeatureNotification) ([]linebot.SendingMessage, error)

func GetGroupMemberCount

func GetGroupMemberCount(groupID string) int

func GetMessageContent

func GetMessageContent(messageId string) (*linebot.MessageContentResponse, error)

func GroupHandleReceiveImageMessage

func GroupHandleReceiveImageMessage(
	lineId *LineID,
	messageContentResponse *linebot.MessageContentResponse,
) (interface{}, error)

func GroupParsePostBackGenTemplate

func GroupParsePostBackGenTemplate(lineId LineID, postBack *linebot.Postback) (interface{}, error)

func GroupParseTextGenTemplate

func GroupParseTextGenTemplate(lineId LineID, text string) (interface{}, error)

func LinePushMessage

func LinePushMessage(toID string, messages interface{}) error

func LineReplyMessage

func LineReplyMessage(replyToken string, messages interface{})

func NewNewRentHousesFlexTemplate

func NewNewRentHousesFlexTemplate(altText string, rhs []*rent_house.RentHouse) []linebot.SendingMessage

func RefreshTodoByAfterPushDateTime

func RefreshTodoByAfterPushDateTime() error

func SetLineBot

func SetLineBot() *linebot.Client

func UserParsePostBackGenTemplate

func UserParsePostBackGenTemplate(lineId LineID, postBack *linebot.Postback) (interface{}, error)

func UserParseTextGenTemplate

func UserParseTextGenTemplate(lineId LineID, text string) (interface{}, error)

Types

type BillingStrategy

type BillingStrategy struct{}

func (*BillingStrategy) Execute

func (s *BillingStrategy) Execute(lineId LineID, text string) (interface{}, error)

type DatetimePickerActionMode

type DatetimePickerActionMode string
const (
	DatetimePickerActionModeDateTime DatetimePickerActionMode = "datetime"
)

type DefaultStrategy

type DefaultStrategy struct{}

func (*DefaultStrategy) Execute

func (s *DefaultStrategy) Execute(lineId LineID, text string) (interface{}, error)

type GroupMemberLineAvatarStrategy

type GroupMemberLineAvatarStrategy struct{}

func (*GroupMemberLineAvatarStrategy) Execute

func (g *GroupMemberLineAvatarStrategy) Execute(lineId LineID, text string) (interface{}, error)

type HelpStrategy

type HelpStrategy struct{}

func (*HelpStrategy) Execute

func (s *HelpStrategy) Execute(lineId LineID, text string) (interface{}, error)

type InfoStrategy

type InfoStrategy struct{}

func (*InfoStrategy) Execute

func (s *InfoStrategy) Execute(lineId LineID, text string) (interface{}, error)

type LineBilling

type LineBilling struct {
	BillingID uint
	GroupID   string
	RoomID    string
	UserID    string

	Billing billing.Billing

	Page service.Page
}

func (*LineBilling) Add

func (lb *LineBilling) Add() (LineBilling, error)

func (*LineBilling) Get

func (lb *LineBilling) Get(where map[string]interface{}, not map[string]interface{}) ([]LineBilling, error)

type LineBotPushMessage

type LineBotPushMessage struct {
	PushID string `json:"pushId"`
	Token  string `json:"token"`
	Text   string `json:"text"`
}

type LineBotRequestService

type LineBotRequestService struct {
}

func (*LineBotRequestService) CreateOne

func (lbrService *LineBotRequestService) CreateOne(attributes map[string]interface{}) (string, error)

func (*LineBotRequestService) Get

func (lbrService *LineBotRequestService) Get(f map[string]interface{}) ([]modelBot.LineBotRequest, error)

type LineID

type LineID struct {
	GroupID string
	RoomID  string
	UserID  string
}

type LineMember

type LineMember struct {
	UserID        string `json:"userId"`
	DisplayName   string `json:"displayName"`
	PictureURL    string `json:"pictureUrl"`
	StatusMessage string `json:"statusMessage"`
	Language      string `json:"language"`
}

func GetGroupMemberProfile

func GetGroupMemberProfile(groupID string, userID string) (*LineMember, error)

type LinePostBackAction

type LinePostBackAction struct {
	Action string
	Data   map[string]interface{}
	Params LinePostBackActionParams
}

type LinePostBackActionParams

type LinePostBackActionParams struct {
	Date     string `json:"date,omitempty"`
	Time     string `json:"time,omitempty"`
	Datetime string `json:"datetime,omitempty"`
}

type MemberLineAvatarStrategy

type MemberLineAvatarStrategy struct{}

func (*MemberLineAvatarStrategy) Execute

func (s *MemberLineAvatarStrategy) Execute(lineId LineID, text string) (interface{}, error)

type ProxyStrategy

type ProxyStrategy struct{}

func (*ProxyStrategy) Execute

func (s *ProxyStrategy) Execute(lineId LineID, text string) (interface{}, error)

type RockPaperScissorStrategy

type RockPaperScissorStrategy struct{}

func (*RockPaperScissorStrategy) Execute

func (r *RockPaperScissorStrategy) Execute(lineId LineID, text string) (interface{}, error)

type TextParsingStrategy

type TextParsingStrategy interface {
	Execute(lineId LineID, text string) (interface{}, error)
}

type TodoStrategy

type TodoStrategy struct{}

func (*TodoStrategy) Execute

func (s *TodoStrategy) Execute(lineId LineID, text string) (interface{}, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL