middleware

package module
v0.0.0-...-9016ecc Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2024 License: MIT Imports: 11 Imported by: 0

README

middleware

autMan的golang中间件 go get -u github.com/hdbjlizhe/middleware

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Port string

///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////////

Functions

func AddMsgListener

func AddMsgListener(imtype, chatid, userid string, exitChannel chan struct{}, function func(string))

*

  • @description: 添加消息监听句柄
  • @param {string} chatid 群组ID
  • @param {string} userid 用户ID
  • @param {func(string)} func 消息监听句柄,回调函数

func BucketAllKeys

func BucketAllKeys(bucket string) []string

*

  • @description: 获取指定数据桶所有的key集合
  • @param {string} bucket

func BucketDelete

func BucketDelete(bucket, key string) error

*

  • @description: 删除数据库key-value的value值
  • @param {string} bucket
  • @param {string} key

func BucketGet

func BucketGet(bucket, key string) string

*

  • @description: 获取数据库key-value的value值
  • @param {string} bucket
  • @param {string} key

func BucketKeys

func BucketKeys(bucket, value string) []string

*

  • @description: 获取指定数据库的所有为value的keys
  • @param {string} bucket
  • @param {string} value

func BucketSet

func BucketSet(bucket, key, value string) error

*

  • @description: 设置数据库key-value的value值
  • @param {string} bucket
  • @param {string} key
  • @param {string} value

func Coffee

func Coffee() bool

*

  • @description: 当前系统授权的激活状态

func Delete

func Delete(key string) error

*

  • @description: 删除用户otto数据库key-value的value值
  • @param {string} key

func Get

func Get(key string) string

*

  • @description: 获取用户otto数据库key-value的value值
  • @param {string} key

func GetSenderID

func GetSenderID() string

*

  • @description: 获取消息发送者ID
  • @return {string}

func MachineId

func MachineId() string

*

  • @description: 获取autMan机器码

func Name

func Name() string

*

  • @description: 获取autMan名字

func NotifyMasters

func NotifyMasters(content string, imtypes []string) error

*

  • @description: 通知管理员
  • @param {string} content
  • @param {string} imtypes

func Promotion

func Promotion(msg string) string

*

  • @description: 京东、淘宝、拼多多的转链推广
  • @param {string} msg
  • @return {string} 转链后的信息

func Push

func Push(imType, groupCode, userID, title, content string) error

*

  • @description: 推送消息
  • @param {string} imtType 包括:qq/qb/wx/wb/tg/tb/wxmp/wxsv
  • @param {string} groupCode 群号
  • @param {string} userID 用户ID
  • @param {string} title 标题
  • @param {string} content 内容
  • @return {*}

func Set

func Set(key, value string) error

*

  • @description: 设置用户otto数据库key-value的value值
  • @param {string} key
  • @param {string} value

func SetPort

func SetPort()

*

  • @description: 设置端口号

func Version

func Version() string

*

  • @description: 获取autMan版本,结果是json字符串{"sn":"1.9.8","content":["版本更新内容1","版本更新内容2"]}

Types

type Sender

type Sender struct {
	SenderID string
}

func (*Sender) AtWaitPay

func (s *Sender) AtWaitPay() bool

* @description: 判断当前是否处于等待用户支付状态

func (*Sender) BreakIn

func (s *Sender) BreakIn(content string) error

* @description: 即,模拟当前用户的身份,修改用户输入的内容,将新内容注入到消息队列中,多用于通过关键词拉起其他插件或任务 * @param {string} content 消息内容

func (*Sender) GetChatID

func (s *Sender) GetChatID() string

func (*Sender) GetChatName

func (s *Sender) GetChatName() string

func (*Sender) GetImtype

func (s *Sender) GetImtype() string

func (*Sender) GetMessage

func (s *Sender) GetMessage() string

func (*Sender) GetMessageID

func (s *Sender) GetMessageID() string

* @description: 获取消息ID * @return {string} 消息ID

func (*Sender) GetPluginName

func (s *Sender) GetPluginName() string

func (*Sender) GetPluginVersion

func (s *Sender) GetPluginVersion() string

func (*Sender) GetUserAvatarUrl

func (s *Sender) GetUserAvatarUrl() string

func (*Sender) GetUserID

func (s *Sender) GetUserID() string

func (*Sender) GetUsername

func (s *Sender) GetUsername() string

func (*Sender) GroupBan

func (s *Sender) GroupBan(userid string, timeout int) error

func (*Sender) GroupInviteIn

func (s *Sender) GroupInviteIn(friend, group string) error

func (*Sender) GroupKick

func (s *Sender) GroupKick(userid string) error

func (*Sender) GroupNoticeSend

func (s *Sender) GroupNoticeSend(notice string) error

func (*Sender) GroupUnban

func (s *Sender) GroupUnban(userid string) error

func (*Sender) GroupWholeBan

func (s *Sender) GroupWholeBan(userid string) error

func (*Sender) GroupWholeUnban

func (s *Sender) GroupWholeUnban(userid string) error

func (*Sender) IsAdmin

func (s *Sender) IsAdmin() bool

func (*Sender) Listen

func (s *Sender) Listen(timeout int) string

* @description: 等待用户输入 * @param {string} timeout 超时,单位:毫秒 * @return {string} 用户输入的消息

func (*Sender) Param

func (s *Sender) Param(index int) string

* @description: 获取用户触发的关键词,对应头注中rule规则中的小括号或问号 * @param {int} index 参数索引 * @return {string} 参数值

func (*Sender) RecallMessage

func (s *Sender) RecallMessage(messageid string) error

* @description: 撤回用户消息 * @param {string} messageid 消息ID

func (*Sender) Reply

func (s *Sender) Reply(text string) ([]string, error)

* @description: 回复文本 * @param {string} text 文本内容,文本中可以使用CQ码,例如:[CQ:at,qq=123456],[CQ:image,file=xxx.jpg]

func (*Sender) ReplyImage

func (s *Sender) ReplyImage(imageurl string) ([]string, error)

* @description: 回复图片 * @param {string} imageurl 图片链接 * @return {[]string} 消息ID

func (*Sender) ReplyMarkdown

func (s *Sender) ReplyMarkdown(text string) ([]string, error)

* @description: 回复markdown * @param {string} text markdown字符串

func (*Sender) ReplyVideo

func (s *Sender) ReplyVideo(videourl string) ([]string, error)

* @description: 回复视频 * @param {string} videourl 视频链接 * @return {[]string} 消息ID

func (*Sender) ReplyVoice

func (s *Sender) ReplyVoice(voiceurl string) ([]string, error)

* @description: 回复语音 * @param {string} voiceurl 语音链接 * @return {[]string} 消息ID

func (*Sender) SetContinue

func (s *Sender) SetContinue() bool

func (*Sender) WaitPay

func (s *Sender) WaitPay(exitCode string, timeout int) string

* @description: 等待用户支付 * @param {string} timeout 超时,单位:毫秒 * @return {string} 用户支付信息json字符串

Jump to

Keyboard shortcuts

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