gomirai

package module
v0.2.0-snap Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2020 License: AGPL-3.0 Imports: 8 Imported by: 7

README

Go-Mirai

Go ReportGitHub top languageGitHubGitHub go.mod Go versionGitHub contributors

适配MiraiHttpApiMirai的Go SDK

目前仍处于开发阶段,部分功能仍未测试,暂未发布Go Module

如何使用

请参照example

所有导出函数、变量、结构均有详细注释


package main

import (
    "github.com/Logiase/gomirai"
)

func main() {
    //...
}
    
不了解Go?

(安利狂魔) Go急速入门

目前问题

暂无

功能

HTTP Api的所有基础功能

Websocket支持目前还在计划中

仍需改进的部分
  1. InEvent的更详细分类及自动归类,现在仍需手动调用OperatorDetail()与SenderDetail()

维护者

Logiase

许可证

AGPL-3.0 © Logiase

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bot

type Bot struct {
	QQ         uint
	SessionKey string

	Client *Client

	Logger *logrus.Entry

	Chan chan message.Event
	// contains filtered or unexported fields
}

func (*Bot) FetchMessages

func (b *Bot) FetchMessages() error

func (*Bot) SendFriendMessage

func (b *Bot) SendFriendMessage(qq, quote uint, msg ...message.Message) (uint, error)

func (*Bot) SendGroupMessage

func (b *Bot) SendGroupMessage(group, quote uint, msg ...message.Message) (uint, error)

func (*Bot) SetChannel

func (b *Bot) SetChannel(time time.Duration, size int)

type Client

type Client struct {
	Name    string
	AuthKey string

	HttpClient *gentleman.Client
	Bots       map[uint]*Bot

	Logger *logrus.Entry
}

Client 与Mirai进行沟通

func NewClient

func NewClient(name, url, authKey string) *Client

NewClient 新建Client

func (*Client) Auth

func (c *Client) Auth() (string, error)

func (*Client) Release

func (c *Client) Release(qq uint) error

func (*Client) Verify

func (c *Client) Verify(qq uint, sessionKey string) (*Bot, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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