mirror of
https://github.com/reality/dbot.git
synced 2025-01-24 02:54:16 +01:00
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(),
|
var key = event.input[1].toLowerCase().trim(),
|
||||||
quote = event.input[2];
|
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) {
|
this.api.addQuote(key, quote, event.user, function(newCount) {
|
||||||
if(newCount) {
|
if(newCount) {
|
||||||
dbot.api.event.emit('~qadd', [ key, quote ]);
|
dbot.api.event.emit('~qadd', [ key, quote ]);
|
||||||
@ -22,6 +26,10 @@ var commands = function(dbot) {
|
|||||||
event.reply(dbot.t('quote_exists'));
|
event.reply(dbot.t('quote_exists'));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
event.reply(dbot.t('You have no permissions to add quotes. :('));
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
/*** Quote Retrieval ***/
|
/*** Quote Retrieval ***/
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"ignorable": false,
|
"ignorable": false,
|
||||||
"dependencies": [ "event" ],
|
"dependencies": [ "event" , "users"],
|
||||||
"dbKeys": [ "knownUsers" ],
|
"dbKeys": [ "knownUsers" ],
|
||||||
"dbType": "redis"
|
"dbType": "redis"
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user