(It's currently outdated and unavailable because of Mirai's rapid iteration)
This is a program used to provide tools for QQ and Telegram groups, written in Haskell for study purpose.
The Telegram part API is not fully implemented. It's unable to get images from updates. The image's url getting from Telegram updates contains bot token, and I have no idea handling this.
But it will still be able to send photos wherever on Telegram or QQ.
The program uses the mirai-api-http to communicate with Mirai, and get updates from Telegram through Webhook.
- Search entries from Baidu Baike (
/bk
) - Save notes (
/svnote
/note
) - Roll dice (
/dc
) - Search image by image using SauceNAO and Ascii2d(
/sp
/asc
) - Search anime using WAIT (
/am
) - Using pixiv.cat to get images by Pixiv id (
/pid
) - And some contents that may be not suitable to present..
Get all commands using /help
.
-
Download the pre-build binary file from release.
mirai-api-http uses userelative path to send images, so we need to put it under mirai-api-http's directory
mirai/plugins/MiraiAPIHTTP
. All local images will be stored underimages
. -
Create
config.json
under the same directory aswl-bot-exe
:{ "tg_token":"", "mirai_server":"", "webhook_server":"", "port":8443, "ws_host":"", "ws_port":6700, "mirai_auth_key": "", "mirai_qq_id": "" }
Key | Description | Example Value |
---|---|---|
port | The port this program listen | 8443 |
webhook_server | Server address used for Webhook | "https://yourserver/" |
mirai_server | Mirai server address for API calling | "http://localhost:5700/" |
tg_token | Token for Telegram Bot API | |
ws_host | Mirai WebSocket listening address | |
ws_port | Mirai WebSocket listening port | |
mirai_auth_key | mirai-api-http auth key | |
mirai_qq_id | QQ id used to get sessionkey |
-
Enable Mirai Http API plugin, set the config of the plugin:
enableWebsocket: true
-
Run
wl-bot-exe
:nohup ./wl-bot-exe &