forked from GitHub/dbot
Only known users can add quotes
May not work due to callback inside dbot.users.api.isKnownUser(…)
This commit is contained in:
parent
df87621241
commit
f21745305e
@ -11,6 +11,10 @@ var commands = function(dbot) {
|
||||
var key = event.input[1].toLowerCase().trim(),
|
||||
quote = event.input[2];
|
||||
|
||||
var server=event.server,
|
||||
user=event.rUser;
|
||||
if (dbot.users.api.isKnownUser(server,user,function(x) {return x})==true)
|
||||
{
|
||||
this.api.addQuote(key, quote, event.user, function(newCount) {
|
||||
if(newCount) {
|
||||
dbot.api.event.emit('~qadd', [ key, quote ]);
|
||||
@ -22,6 +26,10 @@ var commands = function(dbot) {
|
||||
event.reply(dbot.t('quote_exists'));
|
||||
}
|
||||
});
|
||||
}
|
||||
else{
|
||||
event.reply(dbot.t('You have no permissions to add quotes. :('));
|
||||
}
|
||||
},
|
||||
|
||||
/*** Quote Retrieval ***/
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"ignorable": false,
|
||||
"dependencies": [ "event" ],
|
||||
"dependencies": [ "event" , "users"],
|
||||
"dbKeys": [ "knownUsers" ],
|
||||
"dbType": "redis"
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user