-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplugin.js
More file actions
55 lines (44 loc) · 1.4 KB
/
plugin.js
File metadata and controls
55 lines (44 loc) · 1.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
var path = require('path');
var TennuAdvancedSay = {
requiresRoles: ['dblogger', 'dbcore'],
init: function(client, imports) {
const knex = imports.dbcore.knex;
const helps = {
"aseen": [
"{{!}}aseen <nick>"
]
};
var errorResponse = {
intent: 'notice',
query: true
};
// dbcore is a promise. It is returned after migrations are complete.
var aseen = require('./lib/aseen')(knex);
var lastSeen = (function() {
return function(command) {
if (command.args.length !== 1) {
helps.aseen.push('Not enough arguments. Usage:');
errorResponse.message = helps.aseen;
return errorResponse;
}
if (command.isQuery) {
errorResponse.message = 'This command is not avalible as a PM.';
return errorResponse;
}
return aseen.find(command.args[0], command.channel).then(function(result) {
return result;
});
}
})();
return {
handlers: {
"!aseen": lastSeen
},
help: {
"aseen": helps.aseen
},
commands: ["aseen"]
}
}
};
module.exports = TennuAdvancedSay;