Example #1
0
func (r *Room) message(b, t string) error {
	var wrapper struct {
		Message Message `json:"message"`
	}

	wrapper.Message.Body = n.String(strings.Replace(b, "\n", "
", -1))

	if t != "" {
		wrapper.Message.Type = n.String(t)
	}

	return r.connection.post("/room/%d/speak", r.ID, wrapper)
}
Example #2
0
func (r *Room) SetTopic(topic string) error {
	var wrapper struct {
		Room Room `json:"room"`
	}

	wrapper.Room.Topic = n.String(topic)

	return r.connection.put("/room/%d", r.ID, wrapper)
}
Example #3
0
func (r *Room) Rename(name string) error {
	var wrapper struct {
		Room Room `json:"room"`
	}

	wrapper.Room.Name = n.String(name)

	return r.connection.put("/room/%d", r.ID, wrapper)
}