mirror of
https://github.com/LBRYFoundation/lbry-wunderbot.git
synced 2025-08-23 17:47:27 +00:00
move stuff to config json[done]
This commit is contained in:
parent
8bee710104
commit
0380acc5fe
11 changed files with 199 additions and 109 deletions
12
README.md
12
README.md
|
@ -7,13 +7,19 @@
|
|||
- Price bot displays price of lbc for currency given. Responds to `!price <cur> <amount>`
|
||||
- Stats bot display current market stats of lbc. Responds to `!stats`
|
||||
- Hash bot displays current hashrate of network. Responds to `!hash`
|
||||
- Github Release Notes bot displays release notes for current lbry-app release. Responds to `!releasenotes`
|
||||
- Purge Bot (moderator only) deletes X amount of messages. Responds to `!purge <X>`
|
||||
- Github Release Notes bot displays release notes for current lbry-app release.
|
||||
|
||||
Responds to `!releasenotes`
|
||||
|
||||
User with Defined Perms `!releasenotes post` to send to specified channel
|
||||
|
||||
- Purge Bot (moderator only) deletes X amount of messages. User with Defined Perms Responds to `!purge <X>`
|
||||
- Speech bot displays top claim from provided image name(coming soon posting to speech).
|
||||
|
||||
Responds to `!speech <imagename>`
|
||||
|
||||
- Welcome bot sends Direct Message for new users
|
||||
- Welcome bot sends Direct Message when new users join, User with Defined Perms can send using `!welcome <@username>`
|
||||
- Spam Detection Bot to Prevent Discord Raids and Spammers
|
||||
- Dynamic plugin loading with permission support.
|
||||
|
||||
|
||||
|
|
|
@ -1,6 +1,10 @@
|
|||
let config = require('config');
|
||||
let permRanks = config.get('moderation');
|
||||
let speechChannels = config.get('speechbot');
|
||||
let speechBotChannels = config.get('speechbot');
|
||||
let priceBotChannels = config.get('pricebot');
|
||||
let ExcludedSpam = config.get('spamdetection');
|
||||
let hashBotChannels = config.get('hashbot');
|
||||
let statsBotChannels = config.get('statsbot');
|
||||
|
||||
// Checks if user is allowed to use a command only for mods/team members
|
||||
exports.hasPerms = function(msg){
|
||||
|
@ -11,12 +15,66 @@ if(msg.member.roles.some(r=>permRanks.perms.includes(r.name)) ) {
|
|||
}
|
||||
}
|
||||
|
||||
exports.hasSpeechChannels = function(msg){
|
||||
console.log(msg.channel.id)
|
||||
console.log(msg)
|
||||
if(speechChannels.channelsIDs.includes(msg.channel.id) ) {
|
||||
// Check if command was sent in dm
|
||||
exports.inPrivate = function(msg){
|
||||
if(msg.channel.type == 'dm'){
|
||||
return true;
|
||||
}else{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// Checks if Message was sent from a channel in speechBot Channels list
|
||||
exports.hasSpeechBotChannels = function(msg){
|
||||
if(speechBotChannels.channels.includes(msg.channel.id) ) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// Checks if Message was sent from a channel in priceBot Channels list
|
||||
exports.hasPriceBotChannels = function(msg){
|
||||
if(priceBotChannels.channels.includes(msg.channel.id) ) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// Checks if Message was sent from a Excluded channel
|
||||
exports.hasExcludedSpamChannels = function(msg){
|
||||
if(ExcludedSpam.channels.includes(msg.channel.id) ) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// Checks if Message was sent from a Excluded user
|
||||
exports.hasExcludedSpamUsers = function(msg){
|
||||
if(ExcludedSpam.users.includes(msg.author.id) ) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// Checks if Message was sent from a channel in hashBot Channels list
|
||||
exports.hasHashBotChannels = function(msg){
|
||||
if(hashBotChannels.channels.includes(msg.channel.id) ) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// Checks if Message was sent from a channel in statsBot Channels list
|
||||
exports.hasStatsBotChannels = function(msg){
|
||||
if(statsBotChannels.channels.includes(msg.channel.id) ) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,13 +1,14 @@
|
|||
'use strict';
|
||||
var verificationChannelID = "363050496023592961"
|
||||
var miningChannelID = "363049669636390913"
|
||||
var randomChannelID = "363084227518136322"
|
||||
let config = require('config');
|
||||
let miningChannel = config.get('Channels').mining;
|
||||
let randomChannel = config.get('Channels').random;
|
||||
let verificationChannel = config.get('Channels').verification;
|
||||
|
||||
exports.commands = [
|
||||
"helpcommands",
|
||||
"what",
|
||||
"beta",
|
||||
"begging",
|
||||
"beta",
|
||||
"github",
|
||||
"appdownload",
|
||||
"daemondownload",
|
||||
|
@ -33,21 +34,21 @@ exports.commands = [
|
|||
"migrate",
|
||||
"tipping",
|
||||
"email",
|
||||
"cli"
|
||||
"cli",
|
||||
"ipfstorrent"
|
||||
]
|
||||
|
||||
exports.helpcommands = {
|
||||
usage: " ",
|
||||
description: 'Displays Helpful Commands:\n!what, !beta, !begging, !github, !appdownload, !daemondownload, !directories, !faq, !name, !mining, !pricestance, !publisher, !publish, !random, !referrals, !rewards, !rewardsvsreferrals, !cc, !verify, !verification, !logfile, !backup, !startup, !streamingissues, !ports, !migrate, !tipping, !email, !cli, !ipfstorrent',
|
||||
description: 'Displays Helpful Commands:\n!what, !beta, !begging, !github, !appdownload, !daemondownload, !directories, !faq, !name, !mining, !pricestance, !publisher, !publish, !random, !referrals, !rewards, !rewardsvsreferrals, !cc, !verify, !verification, !logfile, !backup, !startup, !streamingissues, !ports, !migrate, !tipping, !email, !cli',
|
||||
process: function(bot,msg){
|
||||
msg.channel.send(
|
||||
{
|
||||
"embed":{
|
||||
"description": "!what, !beta, !begging, !github, !appdownload, !daemondownload, !directories, !faq, !name, !mining, !pricestance, !publisher, !publish, !random, !referrals, !rewards, !rewardsvsreferrals, !cc, !verify, !verification, !logfile, !backup, !startup, !streamingissues, !ports, !migrate, !tipping, !email, !cli, !ipfstorrent",
|
||||
"description": "**!what, !beta, !begging, !github, !appdownload, !daemondownload, !directories, !faq, !name, !mining, !pricestance, !publisher, !publish, !random, !referrals, !rewards, !rewardsvsreferrals, !cc, !verify, !verification, !logfile, !backup, !startup, !streamingissues, !ports, !migrate, !tipping, !email, !cli**",
|
||||
"color": 7976557,
|
||||
"author": {
|
||||
"name": "List of Helpful Commands",
|
||||
"name": "List of Helpful LBRY Commands",
|
||||
"icon_url": "https://i.imgur.com/yWf5USu.png"
|
||||
}}}
|
||||
);
|
||||
|
@ -210,7 +211,7 @@ exports.mining = {
|
|||
usage: " ",
|
||||
description: 'Mining LBRY Credits (LBC)',
|
||||
process: function(bot,msg){
|
||||
var message = "We have a dedicated channel for mining discussion, feel free to join <#" + miningChannelID + ">"
|
||||
var message = "We have a dedicated channel for mining discussion, feel free to join <#" + miningChannel + ">"
|
||||
msg.channel.send( message );
|
||||
}
|
||||
}
|
||||
|
@ -270,7 +271,7 @@ exports.random = {
|
|||
usage: " ",
|
||||
description: 'Off-Topic Message',
|
||||
process: function(bot,msg){
|
||||
var message = "Please keep conversation on topic, or move random conversations to #" + randomChannelID + " if you wish to continue"
|
||||
var message = "Please keep conversation on topic, or move random conversations to #" + randomChannel + " if you wish to continue"
|
||||
msg.channel.send( message );
|
||||
}
|
||||
}
|
||||
|
@ -329,7 +330,7 @@ exports.cc = {
|
|||
usage: " ",
|
||||
description: 'Credit Card Verification?',
|
||||
process: function(bot,msg){
|
||||
var message = "In an effort to limit abuse, newly invited LBRY users will be required to verify their identity via a Credit Card or by a manual verification process in order to be eligible for Rewards. Prepaid or Virtual credit cards are disallowed. Certain countries (where we've previously seen abuse) are being denied, but that list may expand later on. If you use Tor/Proxy/VPN, you also may be denied. If credit card verification does not work for you, please go to the <#" + verificationChannelID + "> channel for assistance.\n**Verification is purely optional and ONLY relevant for Rewards, the app can be used without providing CC information**\n**Please See:https://lbry.io/faq/identity-requirements**"
|
||||
var message = "In an effort to limit abuse, newly invited LBRY users will be required to verify their identity via a Credit Card or by a manual verification process in order to be eligible for Rewards. Prepaid or Virtual credit cards are disallowed. Certain countries (where we've previously seen abuse) are being denied, but that list may expand later on. If you use Tor/Proxy/VPN, you also may be denied. If credit card verification does not work for you, please go to the <#" + verificationChannel + "> channel for assistance.\n**Verification is purely optional and ONLY relevant for Rewards, the app can be used without providing CC information**\n**Please See:https://lbry.io/faq/identity-requirements**"
|
||||
msg.channel.send( message );
|
||||
}
|
||||
}
|
||||
|
@ -339,7 +340,7 @@ exports.verify = {
|
|||
description: 'How to Verify?',
|
||||
process: function(bot,msg){
|
||||
const embed = {
|
||||
"description": "Please download the latest version from [HERE](https://lbry.io/get) Upon install, you'll be greeted with a welcome message. If you already had the App installed, then go to the wallet (bank icon in the top right) > Rewards - this should show your current status. New users will need to verify in order to access rewards. Type ?cc or ?verification for more information.",
|
||||
"description": "Please download the latest version from [HERE](https://lbry.io/get) Upon install, you'll be greeted with a welcome message. If you already had the App installed, then go to the wallet (bank icon in the top right) > Rewards - this should show your current status. New users will need to verify in order to access rewards. Type !cc or !verification for more information.",
|
||||
"color": 7976557,
|
||||
"author": {
|
||||
"name": "How To Verify?",
|
||||
|
@ -354,7 +355,7 @@ exports.verification = {
|
|||
usage: " ",
|
||||
description: 'Verification Help Message',
|
||||
process: function(bot,msg){
|
||||
var message = "If you would like to be verified goto this channel <#" + verificationChannelID + ">. After joining, post that you would like verification and a mod will get to your request as soon as possible. We appreciate your patience. Only one account per person is allowed access to LBRY Rewards. This channel is not for YouTube sync, which is a separate process that requires a minimum number of views on Youtube (If you restarted LBRY and didn't get verified, you most likely don't qualify)."
|
||||
var message = "If you would like to be verified goto this channel <#" + verificationChannel + ">. After joining, post that you would like verification and a mod will get to your request as soon as possible. We appreciate your patience. Only one account per person is allowed access to LBRY Rewards. This channel is not for YouTube sync, which is a separate process that requires a minimum number of views on Youtube (If you restarted LBRY and didn't get verified, you most likely don't qualify)."
|
||||
msg.channel.send( message );
|
||||
}
|
||||
}
|
||||
|
@ -517,7 +518,7 @@ exports.ipfstorrent = {
|
|||
description: 'How is LBRY different from IPFS / BitTorrent?',
|
||||
process: function(bot,msg){
|
||||
const embed = {
|
||||
"description": "If you are interested in how LBRY is different from IPFS or BitTorrent, check out [lbry.io/faq/different-ipfs](https://lbry.io/faq/different-ipfs)",
|
||||
"description": "If you are interested in how is LBRY different from IPFS or BitTorrent, check out [lbry.io/faq/different-ipfs](https://lbry.io/faq/different-ipfs)",
|
||||
"color": 7976557,
|
||||
"author": {
|
||||
"name": "How is LBRY different from IPFS / BitTorrent?",
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
var needle = require('needle');
|
||||
var ChannelID = "363049669636390913"
|
||||
let needle = require('needle');
|
||||
let config = require('config');
|
||||
let hasHashBotChannels = require('../helpers.js').hasHashBotChannels;
|
||||
let inPrivate = require('../helpers.js').inPrivate;
|
||||
let ChannelID = config.get('hashbot').mainchannel;
|
||||
exports.commands = [
|
||||
"hash" // command that is in this file, every command needs it own export as shown below
|
||||
]
|
||||
|
@ -49,7 +52,7 @@ exports.hash = {
|
|||
|
||||
|
||||
function sendMiningInfo(bot, msg) {
|
||||
if(!inPrivateOrBotSandbox(msg)){
|
||||
if(!inPrivate(msg) && !hasHashBotChannels(msg)){
|
||||
msg.channel.send('Please use <#' + ChannelID + '> or DMs to talk to hash bot.');
|
||||
return;
|
||||
}
|
||||
|
@ -78,18 +81,10 @@ function sendMiningInfo(bot, msg) {
|
|||
});
|
||||
}
|
||||
|
||||
function inPrivateOrBotSandbox(msg){
|
||||
if((msg.channel.type == 'dm') || (msg.channel.id === ChannelID)){
|
||||
return true;
|
||||
}else{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function numberWithCommas(x) {
|
||||
return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,9 +1,12 @@
|
|||
'use strict';
|
||||
var jp = require('jsonpath');
|
||||
var moment = require('moment');
|
||||
var numeral = require('numeral');
|
||||
var request = require('request');
|
||||
|
||||
let jp = require('jsonpath');
|
||||
let moment = require('moment');
|
||||
let numeral = require('numeral');
|
||||
let request = require('request');
|
||||
let config = require('config');
|
||||
let hasPriceBotChannels = require('../helpers.js').hasPriceBotChannels;
|
||||
let inPrivate = require('../helpers.js').inPrivate;
|
||||
let ChannelID = config.get('pricebot').mainchannel;
|
||||
|
||||
|
||||
exports.commands = [
|
||||
|
@ -15,8 +18,6 @@ exports.price = {
|
|||
description: 'displays price of lbc',
|
||||
process: function(bot,msg,suffix){
|
||||
|
||||
var ChannelID = '369896313082478594'
|
||||
|
||||
var options = {
|
||||
defaultCurrency: 'BTC',
|
||||
|
||||
|
@ -98,7 +99,7 @@ var command = "!price"
|
|||
if (showHelp) {
|
||||
doHelp(bot,msg,suffix);
|
||||
} else {
|
||||
if(!inPrivateOrBotSandbox(msg)){
|
||||
if(!hasPriceBotChannels(msg) && !inPrivate(msg)){
|
||||
msg.channel.send('Please use <#' + ChannelID + '> or DMs to talk to price bot.');
|
||||
return;
|
||||
}
|
||||
|
@ -106,7 +107,7 @@ var command = "!price"
|
|||
}
|
||||
|
||||
function doHelp(bot,msg,suffix) {
|
||||
if(!inPrivateOrBotSandbox(msg)){
|
||||
if(!hasPriceBotChannels(msg) && !inPrivate(msg)){
|
||||
msg.channel.send('Please use <#' + ChannelID + '> or DMs to talk to price bot.');
|
||||
return;
|
||||
}
|
||||
|
@ -191,13 +192,5 @@ function processSteps(bot, currency, rate, amount, steps, option) {
|
|||
}
|
||||
}
|
||||
|
||||
function inPrivateOrBotSandbox(msg){
|
||||
if((msg.channel.type == 'dm') || (msg.channel.id === ChannelID)){
|
||||
return true;
|
||||
}else{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,4 +1,5 @@
|
|||
let hasPerms = require('../helpers.js').hasPerms;
|
||||
let inPrivate = require('../helpers.js').inPrivate;
|
||||
|
||||
exports.commands = [
|
||||
"purge" // command that is in this file, every command needs it own export as shown below
|
||||
|
@ -8,7 +9,11 @@ exports.purge = {
|
|||
usage: "<number of messages>",
|
||||
description: 'Deletes Messages',
|
||||
process: function(bot,msg,suffix){
|
||||
if (hasPerms(msg) === true ) {
|
||||
if (inPrivate(msg)) {
|
||||
msg.channel.send("You Cant Purge Message In DM's!");
|
||||
return
|
||||
}
|
||||
if (hasPerms(msg)) {
|
||||
if (!suffix) {
|
||||
var newamount = "2"
|
||||
} else {
|
||||
|
@ -22,7 +27,7 @@ exports.purge = {
|
|||
msg.channel.bulkDelete(messages);
|
||||
// Logging the number of messages deleted on both the channel and console.
|
||||
msg.channel
|
||||
.send("Deletion of messages successful. Total messages deleted: "+ newamount)
|
||||
.send("Deletion of messages successful. \n Total messages deleted including command: "+ newamount)
|
||||
.then(message => message.delete(5000));
|
||||
console.log('Deletion of messages successful. \n Total messages deleted including command: '+ newamount)
|
||||
})
|
||||
|
@ -31,7 +36,9 @@ exports.purge = {
|
|||
console.log(err);
|
||||
});
|
||||
} else {
|
||||
msg.channel.send('only moderators can use this command!')
|
||||
msg.channel
|
||||
.send('only moderators can use this command!')
|
||||
.then(message => message.delete(5000));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,6 +1,8 @@
|
|||
var request = require('request');
|
||||
let request = require('request');
|
||||
let config = require('config');
|
||||
let hasPerms = require('../helpers.js').hasPerms;
|
||||
|
||||
let inPrivate = require('../helpers.js').inPrivate;
|
||||
let ChannelID = config.get('gitrelease').channel;
|
||||
|
||||
exports.commands = [
|
||||
"releasenotes" // command that is in this file, every command needs it own export as shown below
|
||||
|
@ -30,9 +32,12 @@ exports.releasenotes = {
|
|||
releasedate = JSON.parse(body).published_at
|
||||
releaseurl = JSON.parse(body).html_url
|
||||
message = {"embed": {"title": "*Download " + releasename + " here!*","description": releasemessage,"url": releaseurl,"color": 7976557,"timestamp": releasedate,"author": {"name": "Lbry-app Release Notes for " + releasename,"icon_url": "http://www.pngall.com/wp-content/uploads/2016/04/Github-PNG-Image.png"},"footer": {"icon_url": "https://i.imgur.com/yWf5USu.png","text": "Lbry-app Updated "}}}
|
||||
if ( hasPerms(msg) === true && suffix === "post") {
|
||||
var channelID = "370779899650375681"
|
||||
bot.channels.get(channelID).send(message)
|
||||
if (inPrivate(msg)) {
|
||||
msg.channel.send(message);
|
||||
return;
|
||||
}
|
||||
if (hasPerms(msg) && suffix === "post") {
|
||||
bot.channels.get(ChannelID).send(message)
|
||||
} else {
|
||||
msg.channel.send(msg.author + " Release notes sent via DM")
|
||||
msg.author.send(message)
|
||||
|
@ -40,4 +45,4 @@ exports.releasenotes = {
|
|||
})
|
||||
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,8 +1,11 @@
|
|||
const authors = [];
|
||||
var warned = [];
|
||||
var banned = [];
|
||||
var messagelog = [];
|
||||
let warned = [];
|
||||
let banned = [];
|
||||
let messagelog = [];
|
||||
let hasPerms = require('../helpers.js').hasPerms;
|
||||
let inPrivate = require('../helpers.js').inPrivate;
|
||||
let hasExcludedSpamChannels = require('../helpers.js').hasExcludedSpamChannels;
|
||||
let hasExcludedSpamUsers = require('../helpers.js').hasExcludedSpamUsers;
|
||||
|
||||
/**
|
||||
* Add simple spam protection to your discord server.
|
||||
|
@ -18,15 +21,15 @@ exports.custom = [
|
|||
exports.antiSpam = function(bot) {
|
||||
const warnBuffer = 5;
|
||||
const maxBuffer = 10;
|
||||
const interval = 1500;
|
||||
const interval = 2000;
|
||||
const warningMessage = ", Stop spamming or you will be banned! This is your warning!";
|
||||
const banMessage = "has been banned for spamming.";
|
||||
const maxDuplicatesWarning = 4;
|
||||
const maxDuplicatesBan = 7;
|
||||
const banMessage = "has been banned for spamming!";
|
||||
const maxDuplicatesWarning = 5;
|
||||
const maxDuplicatesBan = 10;
|
||||
|
||||
|
||||
bot.on('message', msg => {
|
||||
if(hasPerms(msg) == true || msg.author.id == "372832162572926987" || msg.author.id == "363343989442609152" || msg.channel.id == "363044275363119105" || msg.channel.id == "363044260938776576" || msg.channel.id == "363086719391629326") {
|
||||
if(!inPrivate(msg) && hasPerms(msg) || hasExcludedSpamChannels(msg) || hasExcludedSpamUsers(msg)) {
|
||||
return
|
||||
}
|
||||
if(msg.author.id != bot.user.id){
|
||||
|
@ -118,4 +121,4 @@ exports.antiSpam = function(bot) {
|
|||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,13 +1,16 @@
|
|||
var request = require('request');
|
||||
var wget = require('wget');
|
||||
var fs = require('fs')
|
||||
let hasSpeechChannels = require('../helpers.js').hasSpeechChannels;
|
||||
let request = require('request');
|
||||
let wget = require('wget');
|
||||
let fs = require('fs');
|
||||
let config = require('config');
|
||||
let hasSpeechBotChannels = require('../helpers.js').hasSpeechBotChannels;
|
||||
let inPrivate = require('../helpers.js').inPrivate;
|
||||
let ChannelID = config.get('speechbot').mainchannel;
|
||||
//debug output "true/false" outputs same error as slack message in console if set to true
|
||||
//if set to false console will be left blank like normal
|
||||
//some have more info on file details of error
|
||||
var FullDebug = "true"
|
||||
let FullDebug = "true"
|
||||
//outputs response from speech, very bulk reply
|
||||
var ResponseDebug = "false"
|
||||
let ResponseDebug = "false"
|
||||
|
||||
|
||||
exports.commands = [
|
||||
|
@ -18,8 +21,7 @@ exports.speech = {
|
|||
usage: "<name>",
|
||||
description: "gets top claim from spee.ch, coming soon post to spee.ch",
|
||||
process: function(bot,msg,suffix){
|
||||
var ChannelID = "373251793498406912"
|
||||
if(!hasSpeechChannels(msg) && !inPrivate(msg)){
|
||||
if(!hasSpeechBotChannels(msg) && !inPrivate(msg)){
|
||||
msg.channel.send('Please use <#' + ChannelID + '> or DMs to talk to speech bot.');
|
||||
return;
|
||||
}
|
||||
|
@ -218,11 +220,11 @@ request.post(
|
|||
if (body.message === "no name field found in request") {
|
||||
if (FullDebug === "true") {
|
||||
console.log("no name field found: " + imagename);
|
||||
var message = '`Failed to upload file internally!!`\n please contact <#244245498746241025> or another moderator if the issue persists';
|
||||
var message = '`Failed to upload file internally!!`\n please contact <@244245498746241025> or another moderator if the issue persists';
|
||||
msg.channel.send(message);
|
||||
return
|
||||
} else {
|
||||
var message = '`Failed to upload file internally!!`\n please contact <#244245498746241025> or another moderator if the issue persists';
|
||||
var message = '`Failed to upload file internally!!`\n please contact <@244245498746241025> or another moderator if the issue persists';
|
||||
msg.channel.send(message);
|
||||
return
|
||||
}
|
||||
|
@ -239,6 +241,5 @@ request.post(
|
|||
}
|
||||
);
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,8 +1,11 @@
|
|||
var jp = require('jsonpath');
|
||||
var moment = require('moment');
|
||||
var numeral = require('numeral');
|
||||
var request = require('request');
|
||||
var ChannelID = "363050205043621908"
|
||||
let jp = require('jsonpath');
|
||||
let moment = require('moment');
|
||||
let numeral = require('numeral');
|
||||
let request = require('request');
|
||||
let config = require('config');
|
||||
let hasStatsBotChannels = require('../helpers.js').hasStatsBotChannels;
|
||||
let inPrivate = require('../helpers.js').inPrivate;
|
||||
let ChannelID = config.get('statsbot').mainchannel;
|
||||
exports.commands = [
|
||||
"stats" // command that is in this file, every command needs it own export as shown below
|
||||
]
|
||||
|
@ -50,7 +53,7 @@ var command = '!stats';
|
|||
|
||||
var currency = options.defaultCurrency;
|
||||
var amount = 1;
|
||||
if(!inPrivateOrBotSandbox(msg)){
|
||||
if(!inPrivate(msg) && !hasStatsBotChannels(msg)){
|
||||
msg.channel.send('Please use <#' + ChannelID + '> or DMs to talk to stats bot.');
|
||||
return;
|
||||
} else {
|
||||
|
@ -190,14 +193,6 @@ function processSteps(bot, msg, currency, rate, amount, steps, option) {
|
|||
});
|
||||
}
|
||||
}
|
||||
|
||||
function inPrivateOrBotSandbox(msg){
|
||||
if((msg.channel.type == 'dm') || (msg.channel.id === ChannelID)){
|
||||
return true;
|
||||
}else{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,26 +1,52 @@
|
|||
{
|
||||
// Bot configuration
|
||||
"bot": {
|
||||
"token":"discordbottoken",
|
||||
"prefix": "!",
|
||||
"debug": false
|
||||
"token":"discordbottoken",
|
||||
"prefix": "!",
|
||||
"debug": false
|
||||
},
|
||||
"lbrycrd": {
|
||||
"port": 9245,
|
||||
"user": "lbry",
|
||||
"pass": "lbry"
|
||||
"port": 9245,
|
||||
"user": "lbry",
|
||||
"pass": "lbry"
|
||||
},
|
||||
"mongodb": {
|
||||
"url":"mongodb://localhost:27017/wunderbot"
|
||||
"url":"mongodb://localhost:27017/wunderbot"
|
||||
},
|
||||
"moderation":{
|
||||
"perms": ["LBRY MODS","LBRY TEAM"], // Roles that have access to all commands.
|
||||
"logchannel": "371620338263523328" // Channel to log the bots moderation..
|
||||
"perms": ["LBRY MODS","LBRY TEAM"], // Roles that have access to all commands.
|
||||
"logchannel": "371620338263523328" // Channel to log the bots moderation..
|
||||
},
|
||||
//define channels for Commands.js usage
|
||||
"Channels":{
|
||||
"verification": "374345193320611851",
|
||||
"mining": "374221161367601152",
|
||||
"random": "375030404198957056"
|
||||
},
|
||||
"speechbot":{
|
||||
"channelIDs": ["363085078403874823","363086945976320010","363088045366312962","363084262028607488","369896313082478594","363084227518136322"]
|
||||
},
|
||||
"channels": ["324399471087714315","373251793498406912","324400517075959808"], // Channels speech bot is allowed to post in
|
||||
"mainchannel": "373251793498406912" // Main Speech Bot channel for directing with help message
|
||||
},
|
||||
"pricebot":{
|
||||
"channels": ["373172043652268032","373251793498406912"], // Channels price bot is allowed to post in
|
||||
"mainchannel": "373172043652268032" // Main Price Bot channel for directing with help message
|
||||
},
|
||||
"gitrelease":{
|
||||
"channel": "373172043652268032" // Channel to send release info to using <!releasenotes post>
|
||||
},
|
||||
"spamdetection":{
|
||||
"channels": ["324400517075959808","373251793498406912"], // Channels excluded from Spam Detection
|
||||
"users" : ["244245498746241025"] // Users to exclude from Spam Detection (include other bots here)
|
||||
},
|
||||
"hashbot":{
|
||||
"channels": ["374221161367601152"], // Channels Hash Bot is allowed to post in
|
||||
"mainchannel" : "374221161367601152" // Main Hash Bot channel for directing with help message
|
||||
},
|
||||
"statsbot":{
|
||||
"channels": ["373172043652268032","373172043652268032"], // Channels Stats Bot is allowed to post in
|
||||
"mainchannel" : "373172043652268032" // Main Stats Bot channel for directing with help message
|
||||
},
|
||||
"rolelist":{
|
||||
"allowedroles": ["Role1","Role2"]
|
||||
"allowedroles": ["Role1","Role2"]
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue