@ionjs/adapter-cqhttp
@ionjs/adapter-cqhttp is a combination of message receiver and sender for @richardchien/coolq-http-api.
Getting Started
@ionjs/adapter-cqhttp can be included in your codes like this:
npm install --save @ionjs/adapter-cqhttp
import { Receiver, Sender, CQCode } from '@ionjs/adapter-cqhttp'
const secret = 'my-secret', receiverPort = 8080
const token = 'my-token', sendURL = 'https://localhost:5700'
const receiver = new CQReceiver(secret)
const sender = new CQSender(sendURL, token)
receiver.listen(receiverPort)
receiver.on('message', msg => {
sender.to(msg).send(CQCode.Anonymous(), 'testing message sending through ionjs!', CQCode.Emoji(137))
})
The full explanation of the codes above is in the docs.
Contribution
- Become a stargazer if you are interested!
- ionjs currently have only few contributors, so PRs and issues are very welcomed.