CoolQ Socket API written in VC++.
- Place
org.dazzyd.cqsocketapi.cpkinto CoolQ app folder. - Enable CQSocketAPI in CoolQ APP management window.
- Restart CoolQ.
You can write your owned bot based on my cqbot in Python 3.
The communication between server and clients is sending UDP frame to each other.
The server listens on port 11235.
Clients should send ClientHello frame to inform server of client port.
ClientHello frame must be sent on startup and every (at most) 5 minutes.
A UDP frame contains one Prefix and multiple Fields. Prefix and Fields are joined by one space.
Frame = Prefix (max 256) + Payload (max 32768)
Prefix = 'PrivateMessage'
Payload = QQ + EncodedText
Prefix = 'GroupMessage'
Payload = GroupID + QQ + EncodedText
Prefix = 'DiscussMessage'
Payload = DiscussID + QQ + EncodedText
Prefix = 'GroupMemberDecrease'
Payload = GroupID + QQ + OperatedQQ
Prefix = 'GroupMemberIncrease'
Payload = GroupID + QQ + OperatedQQ
EncodedText = base64_encode( GBK_encode( text ) )
Frame = Prefix (max 256) + Payload (max 32768)
Prefix = 'ClientHello'
Payload = Port
Prefix = 'PrivateMessage'
Payload = QQ + EncodedText
Prefix = 'GroupMessage'
Payload = GroupID + EncodedText
Prefix = 'DiscussMessage'
Payload = DiscussID + EncodedText
EncodedText = base64_encode( GBK_encode( text ) )
GroupMessage 123456 10000 dGVzdCCy4srU