Skip to content

Repository files navigation

MacArthurGo

Go Report Card GitHub release (latest by date) Build Release Build Dev FOSSA Status

MacArthurGo is a chatbot developed for the OneBot V11 protocol using Golang. It provides plugin loading to support various functions.

If you have any comments or suggestions, you are welcome to discuss and provide feedback in the issues section

Highly recommend using NapCatQQ as the OneBot server

How to use

  • Stable version: Download the archive for your system and architecture from the release. Extract it, fill in config.json.default, rename it to config.json, and run the program from the extracted directory so it can find jieba_dict.
  • Dev version: Download compressed package from the newest github actions

Attention: Cannot guarantee the availability of the Dev version

Architecture

Startup is explicit and ordered: configuration is loaded and validated first, then shared infrastructure is opened, plugins are registered, background workers are started, and finally the OneBot WebSocket client begins running. Plugins no longer depend on package init() side effects.

The WebSocket client keeps a bounded event queue, a bounded worker pool, and a persistent outbound queue. A disconnected OneBot server is reconnected with bounded exponential backoff. Plugin callbacks are serialized per plugin while different plugins can still run concurrently, which keeps stateful plugins safe without allowing unbounded goroutine growth. Shutdown cancellation is shared by the WebSocket client, plugin schedulers, cache cleanup, database cleanup, and statistics flushing.

Development

CGO is required. Enable it before building or testing:

$env:CGO_ENABLED = "1"
go test ./...
go build ./...

Integration tests live in the top-level test/ directory. Package-level tests live alongside the code they exercise.

Plugins

  • Essential Plugins
    • Help
    • Info
    • Database (sqlite3)
    • Update (dev version only)
  • Chat AI
    • ChatGPT
    • Alibaba QianWen
    • Google Gemini
    • Github Models
  • Music url parser
    • Netease Cloud Music
    • QQ Music
  • BiliBili
    • Url parser (video, live)
    • AI Summarize
  • Picture Search
    • SauceNao
    • Ascii2d
    • SoutuBot
    • Google Lens (SerpApi)
  • Poke
  • Roll
  • Repeat
  • Corpus reply
  • Daily waifu
  • JM comic downloader

CloudflareBypassForScraping

Run CloudflareBypassForScraping alongside MacArthurGo:

docker run -d --name=cf-bypass -p 127.0.0.1:8000:8000 --restart unless-stopped ghcr.io/sarperavci/cloudflarebypassforscraping:latest

The default configuration connects to the service at http://127.0.0.1:8000. MacArthurGo uses it for:

  • ascii2d: loading color and feature search result pages and downloading protected thumbnails.
  • SoutuBot: loading the homepage state and forwarding image-search requests through mirror mode.

TODO

  • Add more plugins

Thanks to the following projects or services

Special thanks

JetBrains

Special thanks to JetBrains for providing the open source license for this project.

License

FOSSA Status

About

MacArthurGo is a chatbot developed for the OneBot V11 protocol using Golang. It provides plugin loading to support various functions.

Resources

Stars

2 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages