this.commands: {
'ping': {
method: 'onCommandPing',
acl: function(from, to, host) {
// e.g.:
// from: 'kamal_', to: '#modubot', host: 'freq.in'
return host == 'freq.in'; // Allow access from @freq.in users only
}
}
}
Proposal 2
The plugin would check for permissions itself.
Example:
onCommandPing(from:any, to:any, message:any, args:any) {
this.bot.hasAccess(from, to, {
channel: '+', // Only allow voiced only if the command was run in a channel
query: false, // Do not allow running the command in a query window
admin: false // Admin override, defaults to true
}, function(hasAccess){
if (!hasAccess) return;
// user has access
});
}
Proposal 1
Define ACLs in the commands key of the plugin (https://github.com/Modubot/Modubot.js/blob/master/src/plugins/kamaln7/plugin/plugin.ts#L12)
Allow access to everyone:
Voiced-only access (available access levels: https://github.com/Modubot/Modubot.js/blob/master/src/Modubot/Bot.ts#L177 ):
Customization?
Proposal 2
The plugin would check for permissions itself.
Example: