cleaned up commands

made is to that they get triggered even inbetween the messages
UNTESTED and not fully configured yet
This commit is contained in:
Niko Storni 2017-12-13 02:01:35 +01:00
parent 8f33a9ce6c
commit df8258ea75
2 changed files with 109 additions and 0 deletions

31
bot/modules/commandsV2.js Normal file
View file

@ -0,0 +1,31 @@
'use strict';
let commands = require("../../config/commands");
const Discord = require("discord.js");
let initialized = false;
module.exports = {
init: init
};
function init(discordBot_) {
if (initialized) {
throw new Error("init was already called once");
}
discordBot = discordBot_;
discordBot.on("message", checkForCommand);
}
/**
*
* @param {String} message
*/
let checkForCommand = function (message) {
Object.keys(commands).forEach(command => {
if (message.indexOf(command) && commands[command].operation === 'send') {
msg.channel.send(commands[command].bundle);
}
});
}

78
config/commands.json Normal file
View file

@ -0,0 +1,78 @@
{
"!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",
"operation": "send",
"bundle": {
"url": "",
"title": "",
"message": "**!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**",
"color": 7976557,
"author": {
"name": "List of Helpful LBRY Commands",
"url": "",
"icon_url": "https://i.imgur.com/yWf5USu.png"
}
}
},
"!what": {
"usage": "",
"description": "What is Lbry?",
"operation": "send",
"bundle": {
"url": "https://lbry.io/what",
"title": "*Click Here for more Info!*",
"message": "[**LBRY**](https://lbry.io) is a protocol providing fully decentralized network for the discovery, distribution, and payment of data. It utilizes the [**LBRY blockchain**](https://lbry.io/what#the-network) as a global namespace and database of digital content. Blockchain entries contain searchable content metadata, identities, and rights and access rules. \n[_**Get the App here**_](https://lbry.io/get)",
"color": 7976557,
"author": {
"name": "What is LBRY?",
"url": "https://lbry.io/what",
"icon_url": "https://i.imgur.com/yWf5USu.png"
}
}
},
"!begging": {
"usage": "",
"description": "Dont Request Free Coins Message",
"operation": "send",
"bundle": {
"url": "",
"title": "",
"message": "**Please don't request free coins or invites, we have a strict policy against begging. Further offenses will result in removal from the chat.**",
"color": 7976557,
"author": {
"name": "BEGGING!",
"url": "https://i.imgur.com/yWf5USu.png",
"icon_url": ""
}
}
},
"!beta": {},
"!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": {}
}