暫無描述

kpmy e63aae851e фикс ссылки на логи 9 年之前
hookexecutor c6ab3b11d9 do not send error field when there are no error 9 年之前
jsexecutor 3d358d7349 > panic: FIXME TypeError [recovered] 9 年之前
luaexecutor 898c40e65b switch to shopify/go-lua 9 年之前
muc d459917b49 ревизия импортов 9 年之前
static e63aae851e фикс ссылки на логи 9 年之前
tpl bbd1c74a83 доп эскейпинг 9 年之前
.gitattributes 8a648318de .gitattibutes чтобы переопределить детект языка 9 年之前
.gitignore 5361eadfa3 самшит 9 年之前
DOCU.md 7b126c4228 поправил командную строку 9 年之前
LICENSE c0caced673 LICENSE 9 年之前
README.md 5361eadfa3 самшит 9 年之前
bot.go 2835343e6c багфикс и favicon 9 年之前
db.go 16a465c7e6 стата по словам (заготовка) 9 年之前
ico.go 2835343e6c багфикс и favicon 9 年之前
main.go b73bc8f478 список трупов 9 年之前
misc.go e3ae18458f небольшой рефакторинг и функция xep (бывш. say) 9 年之前
neo.go 2835343e6c багфикс и favicon 9 年之前
room.go b73bc8f478 список трупов 9 年之前
stat.go 16a465c7e6 стата по словам (заготовка) 9 年之前
stem.go f2a75e54a2 фикс 9 年之前
xmpp.go 1732ed1b6e реорганизация 9 年之前

README.md

Build Status

xep

golang@c.j.r chat-bot

Bot provides a remote chat API, for sake of microservice flamewar.

The API is dead-simple. There are a socket you connect to and start receiving messages. You may send messages back in same format - they will be said by bot. When you recieve message with Type: "ping" please reply with message with Type: "pong" or your client will be disconnected.

Message schema:

Type: string -- type of message. Currently contains "message" or "ping" or "pong" or "ack" ID: int -- serial id of message Error: string -- contains error message when some error occured Data: map[string]string -- message payload

body: string -- message body
sender: string -- nickname of message sender

There are two supported wire protocols: binary msgpack-based and textual json-based. They share a schema.

Binary: listen on port 1984. Every message starts with 2 byte big-endian unsigned integer, the length of packed message. Then follows the byte blob of denotes size which contains msgpack-encoded message. Text: listen on port 1985. messages are encoded into compact json and delimeted with newlines.

Restrictions:

Bot limits the rate of messages (scored by lines) client can deliver to conference. There are hard per-minute limit of lines and soft per-10-second limit. Current default limit can be found in hookexecutor/executor.go. When client exceeds his quota bot will reject messages. When bot rejects a message it sends it back to client with Error field set to corresponding reason of delivery fail. When client accepts the message, it will send the message with Type: "ack" and copied ID to notify client that message was accepted to delivery.

Good luck writing your own client!