Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require('dotenv').config();
- const Discord = require('discord.js');
- const client = new Discord.Client();
- const yg = require('./yg');
- const mrhaircut = require('./mrhaircut');
- const snoowrap = require('snoowrap');
- const r = new snoowrap({
- userAgent: 'discord-reddit',
- clientId: process.env.ID,
- clientSecret: process.env.SECRET,
- username: process.env.USERNAME,
- password: process.env.PASSWORD
- })
- client.on('ready', () => {
- console.log('i am ready');
- });
- client.on('message', (message) => {
- let arr = [];
- function handleArray(arr) {
- message.channel.send(arr[Math.floor(Math.random() * arr.length)]);
- }
- function whichUser() {
- let users = ['mrhaircut33', 'staticeruption', 'skb96', 'ibolightweightchamp', 'wrong_ladder', 'whiterangerrollins', 'lIlIlIlIIlIIl', 'thelastemp', 'bestchestinthewest69', 'ken_milawski'];
- return users[Math.floor(Math.random() * users.length)];
- }
- if (message.content.startsWith('rr')) {
- let data = r.getUser(whichUser())
- .getComments()
- .map(comment => {
- if (comment.subreddit_name_prefixed === 'r/Boxing') {
- arr.push(comment.body)
- }
- })
- .then(() => handleArray(arr))
- }
- if (message.content.startsWith('skb')) {
- let data = r.getUser('skb96')
- .getComments()
- .map(comment => {
- if (comment.subreddit_name_prefixed === 'r/Boxing') {
- arr.push(comment)
- }
- })
- .then(() => handleArray(arr))
- }
- if (message.content.startsWith('wrr')) {
- let data = r.getUser('whiterangerrollins')
- .getComments()
- .map(comment => arr.push(comment.body))
- .then(() => handleArray(arr));
- }
- if (message.content.startsWith('hh')) {
- let data = r.getUser('Chris_Jericho')
- .getComments()
- .map(comment => arr.push(comment.body))
- .then(() => handleArray(arr));
- }
- if (message.content.startsWith('stu')) {
- let data = r.getUser('wrong_ladder')
- .getComments()
- .map(comment => arr.push(comment.body))
- .then(() => handleArray(arr));
- }
- if (message.content.startsWith('mr')) {
- let data = r.getUser('mrhaircut33')
- .getComments()
- .map(comment => arr.push(comment.body))
- .then(() => handleArray(arr));
- }
- if (message.content.startsWith('rob')) {
- let data = r.getUser('thelastemp')
- .getComments()
- .map(comment => arr.push(comment.body))
- .then(() => handleArray(arr));
- }
- if (message.content.startsWith('ry')) {
- let data = r.getUser('ryang_123')
- .getComments()
- .map(comment => arr.push(comment.body))
- .then(() => handleArray(arr));
- }
- if (message.content.startsWith('josh')) {
- let data = r.getUser('bestchestinthewest69')
- .getComments()
- .map(comment => arr.push(comment.body))
- .then(() => handleArray(arr));
- }
- if (message.content.startsWith('ken')) {
- let data = r.getUser('ken_milawski')
- .getComments()
- .map(comment => {
- if (comment.subreddit_name_prefixed === 'r/Boxing') {
- arr.push(comment)
- }
- })
- .then(() => handleArray(arr));
- }
- if (message.content.startsWith('yg')) {
- message.channel.send('4hunnid');
- }
- if (message.content.startsWith('suu')) {
- message.channel.send('whoop');
- }
- if (message.content.startsWith('fdt')) {
- message.channel.send('fuck donald trump');
- }
- if (message.content === '@ everyone') {
- message.channel.send('<@&426446423513497600>')
- }
- if (message.content.startsWith(':vince1:')) {
- message.channel.send(':vince0:');
- }
- // if (message.content) {
- // //grab the actual message
- // let msg = message.content;
- // //check if the message isn't null and the author isn't the bot (keeps him from repeating himself)
- // if (msg.length > 0 && message.author.id !== '459015311275065365' && /^c|(?<=\s)[c]/g.test(msg)) {
- // //yg-ify the message
- // let ygSpeak = yg(msg);
- // //send the yg message to the channel
- // message.channel.send(`<@${message.author.id}> show some respect. it's ${ygSpeak}`);
- // }
- // }
- if (message.content === 'bompton') {
- message.react('🔴');
- }
- if (message.content === 'what time is the fight') {
- message.channel.send('use the fucking calendar you jabroni')
- }
- })
- client.login(process.env.DISCORD_TOKEN);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement