Advertisement
Guest User

Untitled

a guest
Jul 17th, 2018
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.85 KB | None | 0 0
  1. const Discord = require("discord.js");
  2. var moment = require('moment');
  3. moment().format();
  4. moment.locale('pt-BR');
  5. exports.run = (bot, message, args) => {
  6. let parts = message.content.split(' ');
  7. let argsJunto = message.content.split(" ").slice(1).join(' ')
  8. let alvo = message.mentions.members.first();
  9.  
  10.  
  11. if (message.mentions.users.first() === undefined) {
  12. message.channel.sendMessage(':pushpin: | O usuário mencionado não foi reconhecido pelo bot, ou você não mencionou ninguém.').then(message => {
  13. setTimeout(() => {message.delete()}, 5000)
  14. })
  15. } else {
  16. let cargos = alvo.roles.map(a => a.name).slice(1);
  17. const whoIs = new Discord.RichEmbed();
  18. whoIs.setAuthor('Solicitado por ' + message.author.username, message.author.avatarURL);
  19. if (alvo.presence.game !== null) {
  20. if (alvo.presence.game.streaming) {
  21. whoIs.setDescription('Transmitindo: **', + alvo.presence.game.name + '**.');
  22. } else {
  23. whoIs.setDescription('Jogando: **', + alvo.presence.game.name + '**.');
  24. }
  25. }
  26. whoIs.addField('Nome de Usuário', alvo.user.username, true)
  27. whoIs.addField('ID', alvo.user.id, true);
  28. whoIs.setThumbnail(alvo.user.avatarURL);
  29. whoIs.addField('Status', alvo.presence.status, true)
  30. .addField('Cargos', `\`${cargos}\``)
  31. whoIs.addField("Tag do Usuário", message.mentions.users.first().tag, true)
  32. whoIs.addField("Usúario BOT :robot: :", message.mentions.users.first().bot.toString().toUpperCase(), true)
  33.  
  34. whoIs.addField('Conta criada', moment(alvo.user.createdAt).format('LL'), true);
  35. whoIs.setTimestamp();
  36.  
  37. if (message.channel.type === 'dm') {
  38. message.channel.sendEmbed(whoIs);
  39. } else if (message.channel.permissionsFor(message.guild.member(bot.user)).hasPermission('EMBED_LINKS')) {
  40. whoIs.addField('Entrou no server', moment(alvo.joinedAt).format('LL'), true);
  41. if (message.member.highestRole.color !== undefined) {
  42. whoIs.setColor(message.member.highestRole.color)
  43. }
  44. message.channel.sendEmbed(whoIs);
  45. } else {
  46. whoIs.addField('Entrou no server', moment(message.guild.member(user).joinedAt).format('LL'), true);
  47. if (message.member.highestRole.color !== undefined) {
  48. whoIs.setColor(message.member.highestRole.color)
  49. }
  50. message.author.sendEmbed(whoIs);
  51. message.channel.sendMessage(':warning: | Eu não tenho a permissão `EMBED_LINKS` neste servidor. O resultado foi enviado por privado.');
  52. }
  53.  
  54. }
  55. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement