No Description

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

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!