Documentation
¶
Index ¶
Constants ¶
const ( GetLatestEventsAction = "get_latest_events" GetSupportedActionsAction = "get_supported_actions" GetStatusAction = "get_status" GetVersionAction = "get_version" SendMessageAction = "send_message" GetUserInfoAction = "get_user_info" CreateChannelAction = "create_channel" GetChannelInfoAction = "get_channel_info" GetChannelListAction = "get_channel_list" )
Variables ¶
var ErrAccessDenied = NewError(60007, "access denied")
ErrAccessDenied Access Denied
var ErrBadHandler = NewError(20001, "bad handler")
ErrBadHandler Response status not set correctly, etc.
var ErrBadParam = NewError(10003, "bad parameter")
ErrBadParam Missing parameter or wrong parameter type
var ErrBadRequest = NewError(10001, "bad request")
ErrBadRequest Formatting errors (including implementations that do not support MessagePack), missing required fields, or incorrect field types
var ErrBadSegmentData = NewError(10007, "bad segment data")
ErrBadSegmentData The Chatbot implementation does not implement the semantics of this parameter
var ErrBadSegmentType = NewError(10006, "bad segment type")
ErrBadSegmentType Missing parameter or wrong parameter type
var ErrDatabaseError = NewError(31001, "database error")
ErrDatabaseError Such as database query failure
var ErrDatabaseReadError = NewError(31002, "database read error")
ErrDatabaseReadError Such as database read failure
var ErrDatabaseWriteError = NewError(31003, "database write error")
ErrDatabaseWriteError Such as database write failure
var ErrEmitEventError = NewError(37001, "emit event error")
ErrEmitEventError Emit event error
var ErrFilesystemError = NewError(32001, "filesystem error")
ErrFilesystemError If reading or writing a file fails, etc.
var ErrFlagError = NewError(60003, "flag error")
ErrFlagError Flag error
var ErrFlagExpired = NewError(60004, "flag expired")
ErrFlagExpired Flag expired
var ErrIAmTired = NewError(36001, "i am tired")
ErrIAmTired A Chatbot realizes the decision to strike.
var ErrInternalHandler = NewError(20002, "internal handler")
ErrInternalHandler An uncaught and unexpected exception has occurred within the Chatbot implementation.
var ErrInternalServerError = NewError(10000, "internal server error")
ErrInternalServerError Internal server error
var ErrLoginError = NewError(35001, "login error")
ErrLoginError Such as trying to send a message to a non-existent user
var ErrMethodNotAllowed = NewError(10008, "invalid http method")
ErrMethodNotAllowed Invalid HTTP method
var ErrNetworkError = NewError(33001, "network error")
ErrNetworkError e.g. failed to download a file, etc.
var ErrNotAuthorized = NewError(60005, "not authorized")
ErrNotAuthorized Not authorized
var ErrNotFound = NewError(10009, "not found")
ErrNotFound not found
var ErrOAuthError = NewError(60006, "oauth error")
ErrOAuthError OAuth error
var ErrParamVerificationFailed = NewError(10031, "parameter verification failed")
ErrParamVerificationFailed Missing parameter or wrong parameter type
var ErrPlatformError = NewError(34001, "platform error")
ErrPlatformError e.g. failure to send messages due to bot platform limitations, etc.
var ErrSendMessageFailed = NewError(60002, "send message failed")
ErrSendMessageFailed Failed to send a message
var ErrShutdownError = NewError(38001, "shutdown error")
ErrShutdownError Shutdown error
var ErrTokenError = NewError(60001, "missing, invalid or expired access token")
ErrTokenError missing, invalid or expired access token
var ErrUnknownSelf = NewError(10102, "unknown self")
ErrUnknownSelf The bot account specified by the action request does not exist
var ErrUnsupported = NewError(10004, "unsupported")
ErrUnsupported The Chatbot implementation does not implement the semantics of this parameter
var ErrUnsupportedAction = NewError(10002, "unsupported action")
ErrUnsupportedAction The Chatbot implementation does not implement this action
var ErrUnsupportedSegment = NewError(10005, "unsupported segment")
ErrUnsupportedSegment The Chatbot implementation does not implement this segment type.
var ErrWhoAmI = NewError(10101, "who am i")
ErrWhoAmI Chatbot implements support for multiple bot accounts on a single Chatbot Connect connection, but the action request does not specify the account to be used
Functions ¶
This section is empty.
Types ¶
type Error ¶
func (Error) GetMessage ¶
type Response ¶
type Response struct {
// Execution status (success or failure), must be one of ok and failed,
// indicating successful and unsuccessful execution, respectively.
Status ResponseStatus `json:"status"`
// The return code, which must conform to the return code rules defined later on this page
RetCode int64 `json:"retcode,omitempty"`
// Response data
Data any `json:"data,omitempty"`
// Error message, it is recommended to fill in a human-readable error message when the action fails to execute,
// or an empty string when it succeeds.
Message string `json:"message,omitempty"`
}
func NewFailedResponse ¶
func NewSuccessResponse ¶
type ResponseStatus ¶
type ResponseStatus string
const ( Success ResponseStatus = "ok" Failed ResponseStatus = "failed" SuccessCode = int64(0) )