Mirai

package
v0.0.0-...-3e87f45 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2022 License: MPL-2.0 Imports: 8 Imported by: 0

Documentation

Overview

* @Author: NyanCatda * @Date: 2022-04-03 16:49:40 * @LastEditTime: 2022-04-03 20:38:20 * @LastEditors: NyanCatda * @Description: 文件操作API * @FilePath: \Momizi\Internal\MessageSend\ChatSoftwareAPI\Mirai\File.go

* @Author: NyanCatda * @Date: 2022-04-03 17:49:08 * @LastEditTime: 2022-04-03 17:51:11 * @LastEditors: NyanCatda * @Description: Mirai APi封装 * @FilePath: \Momizi\Internal\MessageSend\ChatSoftwareAPI\Mirai\Mirai.go

* @Author: NyanCatda * @Date: 2022-04-03 16:56:12 * @LastEditTime: 2022-04-03 21:03:52 * @LastEditors: NyanCatda * @Description: SessionKey处理 * @FilePath: \Momizi\Internal\MessageSend\ChatSoftwareAPI\Mirai\SessionKey.go

Index

Constants

This section is empty.

Variables

View Source
var (
	SessionKeyCacheFile = Controller.BotFilePath + "Mirai/SessionKey"
)

Functions

func CreateSessionKey

func CreateSessionKey() (string, error)

*

  • @description: 创建SessionKey
  • @param {*}
  • @return {string} SessionKey
  • @return {error} 错误信息

func GetSessionKey

func GetSessionKey() (string, error)

*

  • @description: 获取SessionKey
  • @param {*}
  • @return {string} SessionKey
  • @return {error} 错误信息

Types

type FileInfo

type FileInfo struct {
	ResponseTemplate
	Data struct {
		Name    string      `json:"name"`   // 文件名
		ID      string      `json:"id"`     // 文件ID
		Path    string      `json:"path"`   // 文件路径
		Parent  interface{} `json:"parent"` // 文件对象, 递归类型. null 为存在根目录
		Contact struct {
			ID         int    `json:"id"`         // 文件来源聊天ID
			Name       string `json:"name"`       // 文件来源聊天名称
			Permission string `json:"permission"` // 文件来源聊天权限
		} `json:"contact"`
		IsFile       bool `json:"isFile"`      // 是否为文件
		IsDirectory  bool `json:"isDirectory"` // 是否为目录
		DownloadInfo struct {
			Sha1           string `json:"sha1"`           // 文件SHA1
			Md5            string `json:"md5"`            // 文件MD5
			DownloadTimes  int    `json:"downloadTimes"`  // 下载次数
			UploaderID     int    `json:"uploaderId"`     // 上传者ID
			UploadTime     int    `json:"uploadTime"`     // 上传时间
			LastModifyTime int    `json:"lastModifyTime"` // 最后修改时间
			URL            string `json:"url"`            // 文件下载地址
		} `json:"downloadInfo"`
	} `json:"data"`
}

func GetFileInfo

func GetFileInfo(FileID string, Target string) (FileInfo, error)

*

  • @description: 获取文件信息
  • @param {string} FileID 文件ID
  • @param {string} Target 聊天ID
  • @return {FileInfo} 文件信息
  • @return {error} 错误信息

type ResponseTemplate

type ResponseTemplate struct {
	Code int    `json:"code"`
	Msg  string `json:"msg"`
}

Jump to

Keyboard shortcuts

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