mirror of
https://github.com/LBRYFoundation/lbry-tipbot.git
synced 2025-08-23 16:57:24 +00:00
added channel limitation for normal users
moved trigger check further back in the function
This commit is contained in:
parent
f06b8a5dcb
commit
68230b25e6
1 changed files with 9 additions and 5 deletions
|
@ -31,14 +31,18 @@ function respond(bot, data) {
|
||||||
channel = data.channel,
|
channel = data.channel,
|
||||||
words = data.text.trim().split(' ').filter( function(n){return n !== "";} );
|
words = data.text.trim().split(' ').filter( function(n){return n !== "";} );
|
||||||
|
|
||||||
|
if (words[0] !== command) {
|
||||||
|
// if the received message isn't starting with the trigger -> ignore
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (!lbry) {
|
if (!lbry) {
|
||||||
bot.postMessage(channel, 'Failed to connect to lbrycrd', {icon_emoji: ':exclamation:'});
|
bot.postMessage(channel, 'Failed to connect to lbrycrd', {icon_emoji: ':exclamation:'});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (words[0] !== command) {
|
if (!tipper.is_admin || !tipper.is_owner || channel.name !== "bot-sandbox" ){
|
||||||
// wtf?
|
bot.postMessage(channel, 'Please help keep the channel clean: use #bot-sandbox', globalSlackParams);
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var subcommand = words.length >= 2 ? words[1] : 'help';
|
var subcommand = words.length >= 2 ? words[1] : 'help';
|
||||||
|
|
Loading…
Add table
Reference in a new issue