2018-02-24 14:25:33 -05:00
exports . run = async ( bot , msg ) => {
msg . guild . fetchMembers ( ) . then ( guild =>
{
const membersList = guild . members . array ( ) ;
const selectedUser1 = membersList [ Math . floor ( Math . random ( ) * membersList . length ) ] . user ;
const selectedUser2 = membersList [ Math . floor ( Math . random ( ) * membersList . length ) ] . user ;
const selectedUser3 = membersList [ Math . floor ( Math . random ( ) * membersList . length ) ] . user ;
2018-02-24 14:14:13 -05:00
2018-02-24 14:25:33 -05:00
const stories =
2018-02-24 14:14:13 -05:00
[
2018-02-24 20:40:21 -05:00
` ${ selectedUser1 . username } bought ${ selectedUser2 . username } his favorite video game. This game is called "Pokemon". Then, they became best friends. ` ,
2018-02-24 20:39:22 -05:00
` ${ selectedUser1 . username } jumps out the window. Then, ${ selectedUser2 . username } saves ${ selectedUser1 . username } , and ${ selectedUser3 . username } claps. ` ,
2018-02-24 14:14:13 -05:00
] ;
2018-02-24 14:25:33 -05:00
const storySelected = [ Math . floor ( Math . random ( ) * stories . length ) ] ;
2018-02-24 20:33:30 -05:00
const { RichEmbed } = require ( 'discord.js' ) ;
const embed = new RichEmbed ( )
2018-02-24 20:27:58 -05:00
. setColor ( 0x00ae86 )
2018-02-24 20:39:22 -05:00
. setTitle ( 'PokeBot Storytime' )
2018-02-24 20:27:58 -05:00
. setDescription ( stories [ storySelected ] )
. setFooter ( 'PokeBot Beta' ) ;
2018-02-24 20:33:30 -05:00
msg . channel . send ( { embed } ) ;
2018-02-24 14:25:33 -05:00
} ) ;
2018-02-24 14:14:13 -05:00
} ;
exports . conf = {
2018-02-24 14:25:33 -05:00
aliases : [ ] ,
guildOnly : true ,
} ;
exports . help = {
name : 'story' ,
description : 'Tells you a story.' ,
} ;