Added get channel logs

This commit is contained in:
hydrabolt
2015-10-31 23:58:47 +00:00
parent 3c16a9f2a4
commit 53ef5df10d
6 changed files with 154 additions and 6 deletions

View File

@@ -10,8 +10,23 @@ a.on("debug", function (m) {
});
a.on("message", function (m) {
if (m.content === "$$$") a.sendMessage(m.author, "hi!")["catch"](function (e) {
return console.log(e);
if (m.content === "$$$") a.getChannelLogs(m).then(function (logs) {
for (var _iterator = logs, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
var _ref;
if (_isArray) {
if (_i >= _iterator.length) break;
_ref = _iterator[_i++];
} else {
_i = _iterator.next();
if (_i.done) break;
_ref = _i.value;
}
var item = _ref;
console.log(item.author.username + "> " + item.content);
}
});
});