Sin descripción

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

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!