apis

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2023 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApiBase

type ApiBase struct {
	Base models.BotBase
	// contains filtered or unexported fields
}

func MakeAPIBase added in v0.4.6

func MakeAPIBase(base models.BotBase, timeout time.Duration) *ApiBase

func (*ApiBase) Audit

func (api *ApiBase) Audit(villa_id uint64, audit_input models.UserInputAudit) (models.AuditModel, int, error)

func (*ApiBase) CheckMemberBotAccessToken

func (api *ApiBase) CheckMemberBotAccessToken(villa_id uint64, token string) (models.CheckMemberBotAccessTokenModel, int, error)

func (*ApiBase) CreateGroup

func (api *ApiBase) CreateGroup(villa_id uint64, group_name string) (models.CreateRoomModel, int, error)

func (*ApiBase) CreateMemberRole

func (api *ApiBase) CreateMemberRole(villa_id uint64, name, color string, permissions []string) (models.CreateRoleModel, int, error)

func (*ApiBase) DeleteGroup

func (api *ApiBase) DeleteGroup(villa_id uint64, group_id uint64) (models.EmptyModel, int, error)

func (*ApiBase) DeleteMemberRole

func (api *ApiBase) DeleteMemberRole(villa_id uint64, id uint64) (models.EmptyModel, int, error)

func (*ApiBase) DeleteRoom

func (api *ApiBase) DeleteRoom(villa_id uint64, room_id uint64) (models.EmptyModel, int, error)

func (*ApiBase) DeleteVillaMember

func (api *ApiBase) DeleteVillaMember(villa_id uint64, uid uint64) (models.EmptyModel, int, error)

func (*ApiBase) EditGroup

func (api *ApiBase) EditGroup(villa_id uint64, group_id uint64, group_name string) (models.EmptyModel, int, error)

func (*ApiBase) EditMemberRole

func (api *ApiBase) EditMemberRole(villa_id uint64, id uint64, name, color string, permissions []string) (models.EmptyModel, int, error)

func (*ApiBase) EditRoom

func (api *ApiBase) EditRoom(villa_id uint64, room_id uint64, room_name string) (models.EmptyModel, int, error)

func (*ApiBase) GetAllEmoticons

func (api *ApiBase) GetAllEmoticons(villa_id uint64) (models.GetAllEmoticonsModel, int, error)

func (*ApiBase) GetGroupList

func (api *ApiBase) GetGroupList(villa_id uint64) (models.GetGroupListModel, int, error)

func (*ApiBase) GetMember

func (api *ApiBase) GetMember(villa_id uint64, uid uint64) (models.GetMemberModel, int, error)

func (*ApiBase) GetMemberRoleInfo

func (api *ApiBase) GetMemberRoleInfo(villa_id uint64, role_id uint64) (models.GetRoleInfoModel, int, error)

func (*ApiBase) GetRoom

func (api *ApiBase) GetRoom(villa_id uint64, room_id uint64) (models.GetRoomModel, int, error)

func (*ApiBase) GetVilla

func (api *ApiBase) GetVilla(villa_id uint64) (models.GetVillaModel, int, error)

func (*ApiBase) GetVillaGroupRoomList

func (api *ApiBase) GetVillaGroupRoomList(villa_id uint64) (models.GetVillaGroupRoomListModel, int, error)

func (*ApiBase) GetVillaMemberRoles

func (api *ApiBase) GetVillaMemberRoles(villa_id uint64) (models.GetVillaMemberRolesModel, int, error)

func (*ApiBase) GetVillaMembers

func (api *ApiBase) GetVillaMembers(villa_id uint64, offset_str string, size uint64) (models.GetVillaMembersModel, int, error)

func (*ApiBase) GetVillaMembersDefault

func (api *ApiBase) GetVillaMembersDefault(villa_id uint64) (models.GetVillaMembersModel, int, error)

func (*ApiBase) MessageParser added in v0.4.13

func (api *ApiBase) MessageParser(msg *models.MsgInputModel, villa_id uint64, _msg_parts ...string) error

func (*ApiBase) OperateMemberToRole

func (api *ApiBase) OperateMemberToRole(villa_id uint64, role_id, uid uint64, is_add bool) (models.EmptyModel, int, error)

func (*ApiBase) PinMessage

func (api *ApiBase) PinMessage(villa_id uint64, msg_uid string, is_cancel bool, room_id uint64, send_at int64) (models.EmptyModel, int, error)

func (*ApiBase) RecallMessage

func (api *ApiBase) RecallMessage(villa_id uint64, msg_uid string, room_id uint64, msg_time int64) (models.EmptyModel, int, error)

func (*ApiBase) Request

func (api *ApiBase) Request(villa_id uint64, request *http.Request) (*http.Response, error)

func (*ApiBase) RequestHandler

func (api *ApiBase) RequestHandler(villa_id uint64, request *http.Request, build_req_err error, resp_data interface{}) (int, error)

func (*ApiBase) SendMessage

func (api *ApiBase) SendMessage(villa_id uint64, room_id uint64, _msg_parts ...string) (models.SendMessageModel, int, error)

使用内嵌格式发送消息,并自动处理内部Entity(<@xxx>为艾特机器人或用户,<@everyone>为艾特全体,<#xxx>为跳转房间,<$xxx>为跳转连接) 艾特用户会自动获取用户昵称,跳转房间会自动获取房间名称;艾特机器人会显示文字“机器人”,艾特全体会显示“全体成员”,跳转连接会显示链接自身 使用\< 和 \> 可转义 < 和 >,不会被解析为Entity

func (*ApiBase) SendMessageCustomize added in v0.3.0

func (api *ApiBase) SendMessageCustomize(villa_id uint64, room_id uint64, _msg models.MsgInputModel) (models.SendMessageModel, int, error)

使用models.NewMsg创建消息,然后使用models.SetText等方法加入内容,最后使用此函数发送

func (*ApiBase) SetTimeout added in v0.4.6

func (api *ApiBase) SetTimeout(timeout time.Duration)

func (*ApiBase) UploadFileImage added in v0.5.2

func (api *ApiBase) UploadFileImage(villa_id uint64, file_path string) (models.UploadFileImageModel, int, error)

func (*ApiBase) UploadImage added in v0.4.0

func (api *ApiBase) UploadImage(villa_id uint64, url string) (models.UploadImageModel, int, error)

Jump to

Keyboard shortcuts

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