Documentation
¶
Index ¶
- Constants
- Variables
- type CreateTopicAttrs
- type CreateTopicFeedbackAttrs
- type FeedbackTemplatePayload
- type MessageKey
- type TicketDecisionPayload
- type TicketPayload
- type Topic
- type TopicCreator
- type TopicFeedback
- type TopicMessage
- type TopicRoom
- type TopicSupport
- type TopicTable
- type UserInfoPayload
- type UserMessage
- type UserOptions
Constants ¶
View Source
const ( // DefaultState if sender don't have active topic or not in queue or just any message DefaultState = "default-state" // QueueState add user to queue when topic created but wait decision QueueState = "queue-state" // RoomState when support accept topic and start "chat" with user RoomState = "room-state" // UnknownState something wrong UnknownState = "unknown-state" )
View Source
const ( StartBotCommand = "/start" BreakTopicCommand = "/break" )
View Source
const ( AcceptHelp = "accept" DeclineHelp = "decline" NoRight = "no_right" Rating = "rating" )
View Source
const (
// BotWasBlockedError telegram api message
BotWasBlockedError = "Forbidden: bot was blocked by the user"
)
View Source
const (
TopicsTable = "public.topics"
)
Variables ¶
View Source
var ( ActiveTopic = 1 ClosedTopic = 0 )
Functions ¶
This section is empty.
Types ¶
type CreateTopicAttrs ¶
type CreateTopicAttrs struct {
Message TopicMessage `json:"message" db:"-"`
Creator TopicCreator `json:"creator" db:"-"`
}
type FeedbackTemplatePayload ¶
type FeedbackTemplatePayload struct {
TicketId int64 `template:"TicketID"`
}
type MessageKey ¶
type MessageKey string
const ( // HelloMessageKey greeting message HelloMessageKey MessageKey = "hello" // QueueStartMessageKey user in queue state QueueStartMessageKey MessageKey = "queue_start" // RoomStartMessageKey user in room state RoomStartMessageKey MessageKey = "room_start" // GotTicketKey service got user question GotTicketKey MessageKey = "got_ticket" // NewTicketCreatedMessageKey send message to support group NewTicketCreatedMessageKey MessageKey = "new_ticket" // TicketAcceptedMessageKey when request accepted TicketAcceptedMessageKey MessageKey = "ticket_accepted" // TicketDeclinedMessageKey when request declined TicketDeclinedMessageKey MessageKey = "ticket_declined" // SuccessAcceptTicketMessageKey when help accepted SuccessAcceptTicketMessageKey MessageKey = "success_accept_ticket" // SuccessDeclineTicketMessageKey when help declined SuccessDeclineTicketMessageKey MessageKey = "success_decline_ticket" // AcceptTicketMessageKey accept help button text AcceptTicketMessageKey MessageKey = "accept_ticket" // DeclineTicketMessageKey decline help button text DeclineTicketMessageKey MessageKey = "decline_ticket" // NewTicketMessageKey new message topic (for user) NewTicketMessageKey MessageKey = "new_message" // NewTicketCommentMessageKey new comment (for support) NewTicketCommentMessageKey MessageKey = "new_comment" // CompletePrevTicketMessageKey suggestion for support CompletePrevTicketMessageKey MessageKey = "complete_last_ticket" // UserNoExpectHelpMessageKey if user already got help UserNoExpectHelpMessageKey MessageKey = "user_no_expect" // LeaveFeedbackMessageKey leave feedback message LeaveFeedbackMessageKey MessageKey = "leave_rating" // FeedbackSendMessageKey feedback send success FeedbackSendMessageKey MessageKey = "feedback_received" RatingOk MessageKey = "rating_ok" RatingNormal MessageKey = "rating_normal" RatingBad MessageKey = "rating_bad" NoRating MessageKey = "no_rating" TicketClosedMessageKey MessageKey = "ticket_end" NoRightMessageKey MessageKey = "no_rights" )
type TicketDecisionPayload ¶
type TicketPayload ¶
type Topic ¶
type Topic struct {
Id int64 `json:"id"`
Message TopicMessage `json:"message" db:"-"`
Creator TopicCreator `json:"creator" db:"-"`
Support TopicSupport `json:"support"`
FeedbackId string `json:"f_id"`
Status int `json:"status"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
func (*Topic) IsNeedFeedback ¶
type TopicCreator ¶
type TopicFeedback ¶
type TopicFeedback struct {
CreateTopicFeedbackAttrs
Id string `json:"id"`
CreatedAt time.Time `json:"created_at"`
}
type TopicMessage ¶
type TopicSupport ¶
type TopicTable ¶
type TopicTable struct {
Id int64 `db:"id"`
FeedbackId pgtype.Text `db:"feedback_id"`
AuthorTelegramId int64 `db:"author_tid"`
AuthorTelegramUsername string `db:"author_tun"`
SupportTelegramId int64 `db:"support_tid"`
SupportTelegramUsername pgtype.Text `db:"support_tun"`
MessageTelegramId int `db:"msg_tid"`
MessageContent string `db:"content"`
Status int `db:"status"`
CreatedAt time.Time `db:"created_at"`
UpdatedAt time.Time `db:"updated_at"`
}
type UserInfoPayload ¶
type UserInfoPayload struct {
Username string `template:"Username"`
}
type UserMessage ¶
type UserOptions ¶
type UserOptions struct {
TelegramId int64 `json:"t_id"`
ChatId int64 `json:"chat_id"`
Lang string `json:"lang"`
}
func (*UserOptions) SaveLang ¶
func (uo *UserOptions) SaveLang(lang string)
Click to show internal directories.
Click to hide internal directories.