mirror of
https://github.com/LBRYFoundation/lbry-wunderbot.git
synced 2025-08-23 09:37:27 +00:00
Update all dependencies
Reformat bot for latest discord.js Bump Node to v16 Fix embeds across the board Implement intents for new discord API Remove SupportBot module Remove WelcomeBot module Fixed !helpcommands and !price helptext logic Fix LBRYLinker for new embed system Remove ClaimBot completely (Unused) Remove RoleSetter (No longer used) Remove Speech Module (Spee.ch is deprecated)
This commit is contained in:
parent
0704193b4b
commit
a39139c0f1
11 changed files with 2155 additions and 766 deletions
22
bot/bot.js
22
bot/bot.js
|
@ -1,15 +1,14 @@
|
|||
'use strict';
|
||||
|
||||
// Load up libraries
|
||||
const Discord = require('discord.js');
|
||||
const { Client, Intents } = require('discord.js');
|
||||
const neededIntents = new Intents(32767);
|
||||
// Load config!
|
||||
let config = require('config');
|
||||
config = config.get('bot');
|
||||
let genconfig = require('config');
|
||||
//load modules
|
||||
const claimbot = require('./modules/claimbot.js');
|
||||
const commandsV2 = require('./modules/commandsV2.js');
|
||||
const supportbot = require('./modules/supportbot.js');
|
||||
|
||||
let aliases;
|
||||
try {
|
||||
|
@ -30,7 +29,7 @@ let commands = {
|
|||
description: 'responds pong, useful for checking if bot is alive',
|
||||
process: async function(bot, msg, suffix) {
|
||||
let m = await msg.channel.send(msg.author + ' Ping?');
|
||||
m.edit(`Pong! Latency is ${m.createdTimestamp - msg.createdTimestamp}ms. API Latency is ${Math.round(bot.ping)}ms`);
|
||||
m.edit(`Pong! Latency is ${m.createdTimestamp - msg.createdTimestamp}ms. WebSocket Latency is ${bot.ws.ping}ms`);
|
||||
if (suffix) {
|
||||
msg.channel.send('note that !ping takes no arguments!');
|
||||
}
|
||||
|
@ -38,22 +37,16 @@ let commands = {
|
|||
}
|
||||
};
|
||||
|
||||
let bot = new Discord.Client();
|
||||
const bot = new Client({ intents: [neededIntents] });
|
||||
|
||||
bot.on('ready', function() {
|
||||
console.log('Logged in! Serving in ' + bot.guilds.cache.size + ' servers');
|
||||
require('./plugins.js').init();
|
||||
console.log('type ' + config.prefix + 'help in Discord for a commands list.');
|
||||
bot.user.setActivity(config.prefix + 'help', { type: 'LISTENING' }).catch(console.error);
|
||||
|
||||
//initialize the claimbot (content bot)
|
||||
if (genconfig.get('claimbot').enabled) {
|
||||
claimbot.init(bot);
|
||||
}
|
||||
bot.user.setActivity(config.prefix + 'help', { type: 'LISTENING' });
|
||||
|
||||
//initialize the commandsBot
|
||||
commandsV2.init(bot);
|
||||
//initialize the support bot
|
||||
supportbot.init(bot);
|
||||
});
|
||||
|
||||
process.on('unhandledRejection', err => {
|
||||
|
@ -82,7 +75,6 @@ function checkMessageForCommand(msg, isEdit) {
|
|||
suffix = msg.content.substring(bot.user.mention().length + cmdTxt.length + config.prefix.length + 1);
|
||||
} catch (e) {
|
||||
//no command
|
||||
msg.channel.send('Yes?');
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -177,7 +169,7 @@ function checkMessageForCommand(msg, isEdit) {
|
|||
}
|
||||
}
|
||||
|
||||
bot.on('message', msg => checkMessageForCommand(msg, false));
|
||||
bot.on('messageCreate', msg => checkMessageForCommand(msg, false));
|
||||
bot.on('messageUpdate', (oldMessage, newMessage) => {
|
||||
checkMessageForCommand(newMessage, true);
|
||||
});
|
||||
|
|
|
@ -1,135 +0,0 @@
|
|||
'use strict';
|
||||
|
||||
let discordBot;
|
||||
let moment = require('moment');
|
||||
let config = require('config');
|
||||
let channels = config.get('claimbot').channels;
|
||||
const Discord = require('discord.js');
|
||||
const request = require('request');
|
||||
|
||||
module.exports = {
|
||||
init: init
|
||||
};
|
||||
|
||||
function init(discordBot_) {
|
||||
if (discordBot) {
|
||||
throw new Error('init was already called once');
|
||||
}
|
||||
discordBot = discordBot_;
|
||||
console.log('Activating claimbot');
|
||||
discordBot.channels.get(channels[0]).send('activating claimbot');
|
||||
setInterval(announceClaims, 60 * 1000);
|
||||
announceClaims();
|
||||
}
|
||||
|
||||
function announceClaims() {
|
||||
let currentBlock = lastProcessedBlock;
|
||||
getClaimsForLastBlock()
|
||||
.then(claims => {
|
||||
claims.forEach(c => {
|
||||
if (c.height <= lastProcessedBlock) return;
|
||||
currentBlock = Math.max(currentBlock, c.height);
|
||||
|
||||
//filter claims that we don't want to announce
|
||||
if (c.bid_state === 'Expired' || c.bid_state === 'Spent') return;
|
||||
|
||||
discordPost(embedFromClaim(c));
|
||||
});
|
||||
lastProcessedBlock = currentBlock;
|
||||
})
|
||||
.catch(console.error);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {Object} claim
|
||||
* @returns {RichEmbed} discordEmbed
|
||||
*/
|
||||
function embedFromClaim(claim) {
|
||||
let e = new Discord.RichEmbed();
|
||||
const typeClaim = 1,
|
||||
typeChannel = 2;
|
||||
switch (claim.claim_type) {
|
||||
case typeClaim:
|
||||
let channelName = claim.channel_name ? claim.channel_name : 'Anonymous';
|
||||
let channelPermalink = claim.channel_name ? `${claim.channel_name}#${claim.publisher_id}` : '';
|
||||
let claimPermalink = `${claim.name}#${claim.claim_id}`;
|
||||
let metadata = JSON.parse(claim.value_as_json).Claim.stream.metadata;
|
||||
e.setAuthor(`New claim from ${channelName}`, 'http://barkpost-assets.s3.amazonaws.com/wp-content/uploads/2013/11/3dDoge.gif', `https://open.lbry.com/${claimPermalink}`)
|
||||
.setTitle(`lbry://${claimPermalink}`)
|
||||
.setURL(`https://open.lbry.com/${claimPermalink}`)
|
||||
.setColor(1399626)
|
||||
.setFooter(`Block ${claim.height} • Claim ID ${claim.claim_id} • Data from Chainquery`);
|
||||
if (metadata.title) e.addField('Title', metadata.title);
|
||||
if (claim.channel_name) e.addField('Channel', claim.channel_name);
|
||||
if (metadata.description) {
|
||||
e.addField('Description', metadata.description.substring(0, 1020));
|
||||
}
|
||||
if (metadata.fee) e.addField('Fee', `${metadata.fee.amount} ${metadata.fee.currency}`);
|
||||
if (metadata.license && metadata.license.length > 2) e.addField('License', metadata.license);
|
||||
if (!metadata.nsfw && metadata.thumbnail) e.setImage(metadata.thumbnail);
|
||||
if (claim.bid_state !== 'Controlling' && claim.height < claim.valid_at_height) {
|
||||
// Claim have not taken over the old claim, send approx time to event.
|
||||
let blockTime = 150 * 1000;
|
||||
let takeoverTime = Date.now() + (claim.valid_at_height - claim.height) * blockTime;
|
||||
e.addField('Takes effect on approx', `${moment(takeoverTime, 'x').format('MMMM Do [at] HH:mm [UTC]')} • at block height ${claim.valid_at_height}`);
|
||||
}
|
||||
e.addField('Claimed for', `${Number.parseFloat(claim.bid_amount)} LBC`);
|
||||
break;
|
||||
case typeChannel:
|
||||
e.setAuthor('New channel claim', 'http://barkpost-assets.s3.amazonaws.com/wp-content/uploads/2013/11/3dDoge.gif', `https://open.lbry.com/${claim.name}#${claim.claim_id}`)
|
||||
.setTitle(`lbry://${claim.name}`)
|
||||
.setURL(`https://open.lbry.com/${claim.name}#${claim.claim_id}`)
|
||||
.setColor(1399626)
|
||||
.setFooter(`Block ${claim.height} • Claim ID ${claim.claim_id} • Data from Chainquery`)
|
||||
.addField('Channel Name', claim.name);
|
||||
break;
|
||||
}
|
||||
return e;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @returns {Promise} claims in last block
|
||||
*/
|
||||
function getClaimsForLastBlock() {
|
||||
return new Promise((resolve, reject) => {
|
||||
let blockSelectQuery = 'SELECT height FROM block where height > ' + lastProcessedBlock;
|
||||
if (lastProcessedBlock === 0) {
|
||||
blockSelectQuery = 'SELECT MAX(height) AS height FROM block';
|
||||
}
|
||||
let query =
|
||||
'SELECT t1.*, t3.name AS channel_name, t4.value AS bid_amount FROM claim t1 INNER JOIN (' +
|
||||
blockSelectQuery +
|
||||
') t2 ON t1.height = t2.height ' +
|
||||
'LEFT JOIN claim t3 ON t1.publisher_id = t3.claim_id LEFT JOIN output t4 ON (t1.transaction_hash_id = t4.transaction_hash AND t1.vout = t4.vout)';
|
||||
let options = {
|
||||
method: 'GET',
|
||||
url: 'https://chainquery.lbry.com/api/sql',
|
||||
qs: { query: query },
|
||||
headers: { 'Cache-Control': 'no-cache' }
|
||||
};
|
||||
|
||||
request(options, function(error, response, body) {
|
||||
if (error) return reject(error);
|
||||
if (response.statusCode !== 200 || body === null) return reject(response);
|
||||
try {
|
||||
body = JSON.parse(body);
|
||||
} catch (e) {
|
||||
return reject(e);
|
||||
}
|
||||
if (body.success === false || body.error !== null) return reject(body);
|
||||
let claimsInBlock = body.data;
|
||||
return resolve(claimsInBlock);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function discordPost(embed) {
|
||||
channels.forEach(channel => {
|
||||
discordBot.channels
|
||||
.get(channel)
|
||||
.send('', embed)
|
||||
.catch(console.error);
|
||||
});
|
||||
}
|
|
@ -16,7 +16,7 @@ function init(discordBot_) {
|
|||
|
||||
discordBot = discordBot_;
|
||||
|
||||
discordBot.on('message', checkForCommand);
|
||||
discordBot.on('messageCreate', checkForCommand);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -35,7 +35,12 @@ let checkForCommand = function(message) {
|
|||
//if a command is found
|
||||
if (!message.author.bot && message.content.toLowerCase().indexOf(command.toLowerCase()) >= 0 && commands[command].operation === 'send') {
|
||||
//send a message to the channel according to the config
|
||||
message.channel.send('', new Discord.RichEmbed(commands[command].bundle));
|
||||
try {
|
||||
//message.channel.send('test1', new Discord.MessageEmbed(commands[command].bundle));
|
||||
message.channel.send({embeds: [commands[command].bundle]})
|
||||
} catch (e) {
|
||||
console.log(e);
|
||||
}
|
||||
}
|
||||
});
|
||||
if (firstRun) {
|
||||
|
@ -47,6 +52,8 @@ let checkForCommand = function(message) {
|
|||
if (!message.author.bot && message.content.toLowerCase().indexOf('!helpcommands') >= 0) {
|
||||
let bundle = commands['!helpcommands'].bundle;
|
||||
bundle.description = '**' + commandsList + '**';
|
||||
message.channel.send('', new Discord.RichEmbed(bundle));
|
||||
console.log(bundle);
|
||||
console.log(bundle.description);
|
||||
message.channel.send({embeds: [bundle]});
|
||||
}
|
||||
};
|
||||
|
|
|
@ -84,7 +84,7 @@ exports.hash = {
|
|||
});
|
||||
let profitcommand = words[0];
|
||||
let myhashrate = words[1];
|
||||
if (profitcommand == 'power') {
|
||||
if (profitcommand === 'power') {
|
||||
sendProfitInfo(bot, msg, suffix);
|
||||
return;
|
||||
} else {
|
||||
|
@ -142,7 +142,7 @@ exports.hash = {
|
|||
icon_url: 'https://spee.ch/2/pinkylbryheart.png'
|
||||
}
|
||||
};
|
||||
msg.channel.send({ embed });
|
||||
msg.channel.send({ embeds: [embed] });
|
||||
return;
|
||||
});
|
||||
}
|
||||
|
@ -197,7 +197,7 @@ exports.hash = {
|
|||
icon_url: 'https://spee.ch/6/nKHVQgq.png'
|
||||
}
|
||||
};
|
||||
msg.channel.send({ embed });
|
||||
msg.channel.send({ embeds: [embed] });
|
||||
return;
|
||||
}
|
||||
});
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
let inPrivate = require('../helpers.js').inPrivate;
|
||||
let { RichEmbed } = require('discord.js');
|
||||
let { MessageEmbed } = require('discord.js');
|
||||
exports.custom = [
|
||||
'lbrylink' //change this to your function name
|
||||
];
|
||||
|
||||
exports.lbrylink = async function(bot, msg, suffix) {
|
||||
bot.on('message', msg => {
|
||||
bot.on('messageCreate', msg => {
|
||||
if (inPrivate(msg)) {
|
||||
return;
|
||||
}
|
||||
|
@ -32,13 +32,13 @@ exports.lbrylink = async function(bot, msg, suffix) {
|
|||
.replace(/\W+$/g, '')
|
||||
.replace(/#/g, ':');
|
||||
}
|
||||
const linkEmbed = new RichEmbed();
|
||||
const linkEmbed = new MessageEmbed();
|
||||
linkEmbed
|
||||
.setAuthor('LBRY Linker')
|
||||
.setDescription("I see you tried to post a LBRY URL, here's a friendly link to share and for others to access your content with a single click:")
|
||||
.setColor(7976557);
|
||||
urls.forEach(url => linkEmbed.addField('Open with LBRY or LBRY TV:', url, true));
|
||||
return msg.channel.send({ embed: linkEmbed });
|
||||
return msg.channel.send({ embeds: [linkEmbed] });
|
||||
}
|
||||
});
|
||||
};
|
||||
|
|
|
@ -76,7 +76,10 @@ exports.releasenotes = {
|
|||
return;
|
||||
}
|
||||
if ((hasPerms(msg) && suffix === 'android post') || (hasPerms(msg) && suffix === 'desktop post')) {
|
||||
bot.channels.get(ChannelID).send(message);
|
||||
bot.channels
|
||||
.fetch(ChannelID)
|
||||
.then(channel => channel.send(message))
|
||||
.catch(console.error);
|
||||
} else {
|
||||
let authorMention = msg.author.toString();
|
||||
msg.channel.send(`${authorMention}, Release notes sent via DM`);
|
||||
|
|
|
@ -75,7 +75,7 @@ exports.stats = {
|
|||
icon_url: 'https://spee.ch/2/pinkylbryheart.png'
|
||||
}
|
||||
};
|
||||
msg.channel.send({ embed });
|
||||
msg.channel.send({ embeds: [embed] });
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -1,32 +0,0 @@
|
|||
'use strict';
|
||||
let initialized = false;
|
||||
let discordBot = null;
|
||||
|
||||
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) {
|
||||
//if the close command is found
|
||||
if (!message.author.bot && message.content.toLowerCase().indexOf('!close') >= 0) {
|
||||
//send the -close command twice with a 4 seconds timeout
|
||||
message.channel.send('-close').catch(console.error);
|
||||
setTimeout(() => {
|
||||
message.channel.send('-close').catch(console.error);
|
||||
}, 4000);
|
||||
}
|
||||
};
|
|
@ -1,283 +0,0 @@
|
|||
let hasPerms = require('../helpers.js').hasPerms;
|
||||
let inPrivate = require('../helpers.js').inPrivate;
|
||||
|
||||
/* Disabled Temporarily
|
||||
exports.custom = ['onUserJoin'];
|
||||
exports.onUserJoin = function(bot) {
|
||||
bot.on('guildMemberAdd', member => {
|
||||
member
|
||||
.send({
|
||||
embed: {
|
||||
title: '*Click here for more info about LBRY!*',
|
||||
description:
|
||||
'**Welcome to LBRY Discord Community, you are now officially a LBRYian!** \n' +
|
||||
'If you are new to LBRY and would like to learn more, see the links at the end of this message. \n' +
|
||||
'This community allows LBRYians to interact with the team directly and for us to engage users in order to grow the LBRY platform! \n' +
|
||||
'**Looking for *Rewards Approval*? Please make a request in the #rewards-approval channel by sending a direct message (DM) to @RewardsBot#0287. You can do this by right clicking on the name. A mod will reach out to you, please be patient . **Note: DO NOT message any team members or post in other channels about rewards approval concerns.**. Only 1 Reward account is allowed per household** \n',
|
||||
url: 'https://lbry.com/what',
|
||||
color: 7976557,
|
||||
author: {
|
||||
name: 'Welcome to LBRY Discord Community',
|
||||
icon_url: 'https://spee.ch/2/pinkylbryheart.png'
|
||||
}
|
||||
}
|
||||
})
|
||||
.catch(function(error) {
|
||||
bot.channels
|
||||
.get('369896313082478594')
|
||||
.send(
|
||||
member +
|
||||
', Please enable Direct Messages from server members to communicate fully with our bot, it is located in the user setting area under Privacy & Safety tab, select the option allow direct messages from server members\nSince the bot could not send you our Welcome message please check the posts in <#431211007050776577> and see the Wunderbot and tipbot commands by typing `!help` in <#369896313082478594>'
|
||||
);
|
||||
});
|
||||
member
|
||||
.send({
|
||||
embed: {
|
||||
description:
|
||||
'1. Be respectful to other community members. Harassment and vulgarity will not be tolerated \n' +
|
||||
'2. Do not spam, advertise or post referral links \n' +
|
||||
'3. Use appropriate channels for your discussions/questions. If you are looking for help with LBRY, use #help, for price talk, use #market-and-trading \n' +
|
||||
'4. #general discussions should be at least somewhat related to LBRY, otherwise there is #random \n' +
|
||||
'5. Do not post **not safe for work (NFSW)** content in any non-marked channels, there is #random-nsfw for that \n' +
|
||||
'6. Do not direct message and LBRY team or mods without being asked to do so \n' +
|
||||
'7. Do not request free LBC, begging will not be tolerated \n',
|
||||
color: 7976557,
|
||||
author: {
|
||||
name: 'Ground rules',
|
||||
icon_url: 'https://spee.ch/2/pinkylbryheart.png'
|
||||
}
|
||||
}
|
||||
})
|
||||
.catch(function(error) {
|
||||
console.log('could not send dm');
|
||||
});
|
||||
member
|
||||
.send({
|
||||
embed: {
|
||||
description:
|
||||
'1. Type !tip help in the #bot-sandbox channel to interact with our Tipbot which can be used to send and receive LBRY Credits (LBC). **Enable 2FA in your Discord account settings!** \n' +
|
||||
'2. See the Frequently Asked Questions (FAQ) section below prior to asking for help or information on LBRY \n' +
|
||||
'3. Backing up your LBRY wallet is your responsibility, see FAQ link below \n' +
|
||||
'4. You can find the LBRY Block explorer at https://explorer.lbry.com \n' +
|
||||
'5. Want to contribute more? Check out https://lbry.tech/contribute \n' +
|
||||
'6. Are you a dev? Check out the #dev channel \n' +
|
||||
'7. Want to share something you published? Post it on the #publishers channel \n',
|
||||
color: 7976557,
|
||||
author: {
|
||||
name: 'Helpful hints',
|
||||
icon_url: 'https://spee.ch/2/pinkylbryheart.png'
|
||||
}
|
||||
}
|
||||
})
|
||||
.catch(function(error) {
|
||||
console.log('could not send dm');
|
||||
});
|
||||
member
|
||||
.send({
|
||||
embed: {
|
||||
title: '*Click here for more info about LBRY!*',
|
||||
description:
|
||||
'[**LBRY**](https://lbry.com) is a protocol providing fully decentralized network for the discovery, distribution, and payment of data. It utilizes the [**LBRY blockchain**](https://lbry.com/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[_**Download the LBRY App here**_](https://lbry.com/get)',
|
||||
url: 'https://lbry.com/what',
|
||||
color: 7976557,
|
||||
author: {
|
||||
name: 'What is LBRY?',
|
||||
url: 'https://lbry.com/what',
|
||||
icon_url: 'https://spee.ch/2/pinkylbryheart.png'
|
||||
}
|
||||
}
|
||||
})
|
||||
.catch(function(error) {
|
||||
console.log('could not send dm');
|
||||
});
|
||||
member
|
||||
.send({
|
||||
embed: {
|
||||
title: '*Click here to see all LBRY Frequently Asked Questions (FAQ)!*',
|
||||
description:
|
||||
'Want to backup your LBRY wallet? [**Backup**](https://lbry.com/faq/how-to-backup-wallet) \nLooking for LBRY data? [**Behind the scenes files**](https://lbry.com/faq/lbry-directories) \nTrouble starting LBRY? [**Startup troubleshooting**](https://lbry.com/faq/startup-troubleshooting) \nNeed help finding your log files (will help us troubleshoot!)? [**Find logs**](https://lbry.com/faq/how-to-find-lbry-log-file) \nNot able to stream any content? [**Troubleshoot streaming**](https://lbry.com/faq/unable-to-stream)\nNeed help with publishing? [**How to Publish**](https://lbry.com/faq/how-to-publish) \nWant more LBRY Credits (LBC)? [**Get LBC**](https://lbry.com/faq/earn-credits) \nLooking for referral information? [**Referrals**](https://lbry.com/faq/referrals)',
|
||||
url: 'https://lbry.com/faq',
|
||||
color: 7976557,
|
||||
author: {
|
||||
name: 'LBRY FAQ',
|
||||
url: 'https://lbry.com/faq',
|
||||
icon_url: 'https://spee.ch/8/Id5Qoc3w.png'
|
||||
}
|
||||
}
|
||||
})
|
||||
.catch(function(error) {
|
||||
console.log('could not send dm');
|
||||
});
|
||||
member
|
||||
.send({
|
||||
embed: {
|
||||
title: '*Have you checked out spee.ch yet?!*',
|
||||
description:
|
||||
"[**spee.ch**](https://spee.ch) runs on top of the LBRY network - it's essentially an open source, censorship resistant and decentralized image and video sharing site with the added benefit of being a web-based (works on mobile too!) gateway into the LBRY network. spee.ch can be used to retrieve LBRY images/videos that are free by accessing them through a web browser. \nFor example, if content is located at lbry://loose-cannons-episode1#12c87bb42dd8832167b1e54edf72bbd37bc47622, you can view it on spee.ch at: https://spee.ch/12c87bb42dd8832167b1e54edf72bbd37bc47622/loose-cannons-episode1. You can also view channels on spee.ch, such as: https://spee.ch/@copchronicles:5c039dc7423657e59d78939df72c186e43273675 or https://spee.ch/@MinutePhysics:589276465a23c589801d874f484cc39f307d7ec7 \n\nspee.ch also allows you to create a channel to group your uploads and retrieve them easily. These channels are separate from any you may have in the LBRY app since they exist on the spee.ch site via a login process. You can even share your channel name and password so that others can contribute to it.",
|
||||
url: 'https://spee.ch/about',
|
||||
color: 7976557,
|
||||
author: {
|
||||
name: 'spee.ch',
|
||||
url: 'https://spee.ch',
|
||||
icon_url: 'https://spee.ch/e/flag-green-blue-purple-indigo-bars-background.png'
|
||||
}
|
||||
}
|
||||
})
|
||||
.catch(function(error) {
|
||||
console.log('could not send dm');
|
||||
console.log(error);
|
||||
});
|
||||
});
|
||||
};
|
||||
*/
|
||||
exports.commands = [
|
||||
'welcome' // command that is in this file, every command needs it own export as shown below
|
||||
];
|
||||
|
||||
exports.welcome = {
|
||||
usage: '<@username>',
|
||||
description: 'send welcome message to specified user',
|
||||
process: function(bot, msg, suffix) {
|
||||
if (inPrivate(msg)) {
|
||||
msg.channel.send('command cannot be used in a DM');
|
||||
return;
|
||||
}
|
||||
if (suffix === '') {
|
||||
msg.channel.send('no user defined');
|
||||
return;
|
||||
}
|
||||
if (!hasPerms(msg)) {
|
||||
msg.channel.send('You Dont Have Permission To Use This Command!');
|
||||
return;
|
||||
}
|
||||
msg.mentions.members
|
||||
.first()
|
||||
.send({
|
||||
embed: {
|
||||
title: '*Click here for more info about LBRY!*',
|
||||
description:
|
||||
'**Welcome to LBRY Discord Community, you are now officially a LBRYian!** \n' +
|
||||
'If you are new to LBRY and would like to learn more, see the links at the end of this message. \n' +
|
||||
'This community allows LBRYians to interact with the team directly and for us to engage users in order to grow the LBRY platform! \n' +
|
||||
'**Looking for *Rewards Approval*? Please make a request in the #rewards-approval channel by sending a direct message (DM) to @RewardsBot#0287. You can do this by right clicking on the name. A mod will reach out to you, please be patient, **Note: DO NOT message any team members or post in other channels about rewards approval concerns.**. Only 1 Reward account is allowed per household** \n',
|
||||
url: 'https://lbry.com/what',
|
||||
color: 7976557,
|
||||
author: {
|
||||
name: 'Welcome to LBRY Discord Community',
|
||||
icon_url: 'https://spee.ch/2/pinkylbryheart.png'
|
||||
}
|
||||
}
|
||||
})
|
||||
.catch(function(error) {
|
||||
msg.channel.send(
|
||||
msg.mentions.members.first() +
|
||||
', Please enable Direct Messages from server members to communicate fully with our bot, it is located in the user setting area under Privacy & Safety tab, select the option allow direct messages from server members'
|
||||
);
|
||||
});
|
||||
msg.mentions.members
|
||||
.first()
|
||||
.send({
|
||||
embed: {
|
||||
description:
|
||||
'1. Be respectful to other community members. Harassment and vulgarity will not be tolerated \n' +
|
||||
'2. Do not spam, advertise or post referral links \n' +
|
||||
'3. Use appropriate channels for your discussions/questions. If you are looking for help with LBRY, use #help, for price talk, use #market-and-trading \n' +
|
||||
'4. #general discussions should be at least somewhat related to LBRY, otherwise there is #random \n' +
|
||||
'5. Do not post **not safe for work (NFSW)** content in any non-marked channels, there is #random-nsfw for that \n' +
|
||||
'6. Do not direct message and LBRY team or mods without being asked to do so \n' +
|
||||
'7. Do not request free LBC, begging will not be tolerated \n',
|
||||
color: 7976557,
|
||||
author: {
|
||||
name: 'Ground rules',
|
||||
icon_url: 'https://spee.ch/2/pinkylbryheart.png'
|
||||
}
|
||||
}
|
||||
})
|
||||
.catch(function(error) {
|
||||
console.log('could not send dm');
|
||||
console.log(error);
|
||||
});
|
||||
msg.mentions.members
|
||||
.first()
|
||||
.send({
|
||||
embed: {
|
||||
description:
|
||||
'1. Type !tip help in the #bot-sandbox channel to interact with our Tipbot which can be used to send and receive LBRY Credits (LBC). **Enable 2FA in your Discord account settings!** \n' +
|
||||
'2. See the Frequently Asked Questions (FAQ) section below prior to asking for help or information on LBRY \n' +
|
||||
'3. Backing up your LBRY wallet is your responsibility, see FAQ link below \n' +
|
||||
'4. You can find the LBRY Block explorer at https://explorer.lbry.com \n' +
|
||||
'5. Want to contribute more? Check out https://lbry.com/faq/contributing \n' +
|
||||
'6. Are you a dev? Check out the #dev channel \n' +
|
||||
'7. Want to share something you published? Post it on the #publishers channel \n',
|
||||
color: 7976557,
|
||||
author: {
|
||||
name: 'Helpful hints',
|
||||
icon_url: 'https://spee.ch/2/pinkylbryheart.png'
|
||||
}
|
||||
}
|
||||
})
|
||||
.catch(function(error) {
|
||||
console.log('could not send dm');
|
||||
console.log(error);
|
||||
});
|
||||
msg.mentions.members
|
||||
.first()
|
||||
.send({
|
||||
embed: {
|
||||
title: '*Click here for more info about LBRY!*',
|
||||
description:
|
||||
'[**LBRY**](https://lbry.com) is a protocol providing fully decentralized network for the discovery, distribution, and payment of data. It utilizes the [**LBRY blockchain**](https://lbry.com/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[_**Download the LBRY App here**_](https://lbry.com/get)',
|
||||
url: 'https://lbry.com/what',
|
||||
color: 7976557,
|
||||
author: {
|
||||
name: 'What is LBRY?',
|
||||
url: 'https://lbry.com/what',
|
||||
icon_url: 'https://spee.ch/2/pinkylbryheart.png'
|
||||
}
|
||||
}
|
||||
})
|
||||
.catch(function(error) {
|
||||
console.log('could not send dm');
|
||||
console.log(error);
|
||||
});
|
||||
msg.mentions.members
|
||||
.first()
|
||||
.send({
|
||||
embed: {
|
||||
title: '*Click here to see all LBRY Frequently Asked Questions (FAQ)!*',
|
||||
description:
|
||||
'Want to backup your LBRY wallet? [**Backup**](https://lbry.com/faq/how-to-backup-wallet) \nLooking for LBRY data? [**Behind the scenes files**](https://lbry.com/faq/lbry-directories) \nTrouble starting LBRY? [**Startup troubleshooting**](https://lbry.com/faq/startup-troubleshooting) \nNeed help finding your log files (will help us troubleshoot!)? [**Find logs**](https://lbry.com/faq/how-to-find-lbry-log-file) \nNot able to stream any content? [**Troubleshoot streaming**](https://lbry.com/faq/unable-to-stream)\nNeed help with publishing? [**How to Publish**](https://lbry.com/faq/how-to-publish) \nWant more LBRY Credits (LBC)? [**Get LBC**](https://lbry.com/faq/earn-credits) \nLooking for referral information? [**Referrals**](https://lbry.com/faq/referrals)',
|
||||
url: 'https://lbry.com/faq',
|
||||
color: 7976557,
|
||||
author: {
|
||||
name: 'LBRY FAQ',
|
||||
url: 'https://lbry.com/faq',
|
||||
icon_url: 'https://spee.ch/8/Id5Qoc3w.png'
|
||||
}
|
||||
}
|
||||
})
|
||||
.catch(console.error)
|
||||
console.log('could not send dm');
|
||||
console.log(error);
|
||||
msg.mentions.members
|
||||
.first()
|
||||
.send({
|
||||
embed: {
|
||||
title: '*Have you checked out spee.ch yet?!*',
|
||||
description:
|
||||
"[**spee.ch**](https://spee.ch) runs on top of the LBRY network - it's essentially an open source, censorship resistant and decentralized image and video sharing site with the added benefit of being a web-based (works on mobile too!) gateway into the LBRY network. spee.ch can be used to retrieve LBRY images/videos that are free by accessing them through a web browser. \nFor example, if content is located at lbry://loose-cannons-episode1#12c87bb42dd8832167b1e54edf72bbd37bc47622, you can view it on spee.ch at: https://spee.ch/12c87bb42dd8832167b1e54edf72bbd37bc47622/loose-cannons-episode1. You can also view channels on spee.ch, such as: https://spee.ch/@copchronicles:5c039dc7423657e59d78939df72c186e43273675 or https://spee.ch/@MinutePhysics:589276465a23c589801d874f484cc39f307d7ec7 \n\nspee.ch also allows you to create a channel to group your uploads and retrieve them easily. These channels are separate from any you may have in the LBRY app since they exist on the spee.ch site via a login process. You can even share your channel name and password so that others can contribute to it.",
|
||||
url: 'https://spee.ch/about',
|
||||
color: 7976557,
|
||||
author: {
|
||||
name: 'spee.ch',
|
||||
url: 'https://spee.ch',
|
||||
icon_url: 'https://spee.ch/e/flag-green-blue-purple-indigo-bars-background.png'
|
||||
}
|
||||
}
|
||||
})
|
||||
.catch(function(error) {
|
||||
console.log('could not send dm');
|
||||
console.log(error);
|
||||
});
|
||||
}
|
||||
};
|
2389
package-lock.json
generated
2389
package-lock.json
generated
File diff suppressed because it is too large
Load diff
26
package.json
26
package.json
|
@ -1,21 +1,21 @@
|
|||
{
|
||||
"dependencies": {
|
||||
"app-root-path": "^2.2.1",
|
||||
"app-root-path": "^3.0.0",
|
||||
"braces": "^3.0.2",
|
||||
"chrono-node": "^2.2.4",
|
||||
"config": "^3.3.1",
|
||||
"discord.js": "^12.5.3",
|
||||
"chrono-node": "^2.3.1",
|
||||
"config": "^3.3.6",
|
||||
"discord.js": "^13.1.0",
|
||||
"file-exists": "^5.0.1",
|
||||
"jsonfile": "^5.0.0",
|
||||
"jsonpath": "^1.0.1",
|
||||
"moment": "^2.26.0",
|
||||
"mongodb": "^3.5.8",
|
||||
"mongoose": "^5.12.3",
|
||||
"needle": "^2.5.0",
|
||||
"jsonfile": "^6.1.0",
|
||||
"jsonpath": "^1.1.1",
|
||||
"moment": "^2.29.1",
|
||||
"mongodb": "^4.1.1",
|
||||
"mongoose": "^6.0.5",
|
||||
"needle": "^3.0.0",
|
||||
"numeral": "^2.0.6",
|
||||
"request": "^2.88.2",
|
||||
"request-promise": "^4.2.5",
|
||||
"sleep": "^6.2.0",
|
||||
"request-promise": "^4.2.6",
|
||||
"sleep": "^6.3.0",
|
||||
"wget": "^0.0.1"
|
||||
},
|
||||
"scripts": {
|
||||
|
@ -28,7 +28,7 @@
|
|||
"prettier": "^1.19.1"
|
||||
},
|
||||
"name": "wunderbot-discord",
|
||||
"version": "1.0.6",
|
||||
"version": "1.0.7",
|
||||
"description": "LBRY bot for Discord",
|
||||
"main": "bot/bot.js",
|
||||
"repository": "https://github.com/lbryio/lbry-wunderbot",
|
||||
|
|
Loading…
Add table
Reference in a new issue