Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.
/ wl-bot Public archive

A bot program used to provide tools for QQ and Telegram groups.

License

Notifications You must be signed in to change notification settings

u2x1/wl-bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

82 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

wl-bot

(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.

NOTE

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.

How it works

The program uses the mirai-api-http to communicate with Mirai, and get updates from Telegram through Webhook.

What it can do

  • 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.

How to use it

  1. 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 under images.

  2. Create config.json under the same directory as wl-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
  1. Enable Mirai Http API plugin, set the config of the plugin:

    enableWebsocket: true
  2. Run wl-bot-exe:

    nohup ./wl-bot-exe &

Acknowledgements

About

A bot program used to provide tools for QQ and Telegram groups.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published