Future sendMessage(String channel, String content)

Sends a message to channel

sendmessage("channelid", "My message!");

Source

sendMessage(String channel, String content) async {
  var r = await this._api.post('channels/$channel/messages', {"content": content});
  Map res = JSON.decode(r.body);

  if (r.statusCode == 200) {
    return new Message(res);
  } else {
    throw new Exception("${res['code']}: ${res['message']}");
  }
}