Advertisement
Guest User

Untitled

a guest
Sep 21st, 2019
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.30 KB | None | 0 0
  1. const Discord = require("discord.js");
  2. const axios = require('axios');
  3.  
  4. module.exports.run = async (bot,message,args) => {
  5.  
  6. let cc = message.content.split(';chk ')[1];
  7. if(!cc){
  8. ccs.forEach(function(cc) {
  9. if (ccs.length > 5) return message.channel.send(`Apenas 5 cc's por vez`)
  10. axios.get('#' + cc)
  11. .then(function(response){
  12. if(response.data.split(' ')[0] == '#') {
  13. aprovadas.push(response.data)
  14. if(ccs.length == aprovadas.length + reprovadas.length) {
  15. if(aprovadas.length > 0) {aprovada()}
  16. if(reprovadas.length > 0) {reprovada()}
  17. }
  18.  
  19. message.channel.send({
  20. "embed": {
  21. "title": "``❗`` Informações:",
  22. "description": "``💳`` Insira sua lista de cartões\n\nOs separadores aceitos são: ``|`` ``,`` ``;`` ``:`` ``/``",
  23. "color": Math.floor(Math.random() * 16777214) + 1,
  24. "footer": {
  25. "icon_url": message.author.avatarURL,
  26. "text": "Pedido por "+message.author.tag
  27. }
  28. }
  29. });
  30. return;
  31. }
  32.  
  33.  
  34. process.env["NODE_TLS_REJECT_UNAUTHORIZED"] = 0;
  35.  
  36.  
  37. axios.get('http://localhost/apibot.php?key=72RJD9DLT13UBNAGH4VPB6LZT&lista=' + cc)
  38. .then(function(response){
  39.  
  40. message.channel.send({
  41. "embed": {
  42. "title": "``❗`` Informações:",
  43. "description": response.data,
  44. "color": Math.floor(Math.random() * 16777214) + 1,
  45. "footer": {
  46. "icon_url": message.author.avatarURL,
  47. "text": "Pedido por "+message.author.tag
  48. }
  49. }
  50. }).then(function (messagee) {
  51. messagee.react("🗑");
  52.  
  53. const filter = (reaction, user) => {
  54. return reaction.emoji.name === '🗑' && user.id === message.author.id;
  55. };
  56.  
  57. const collector = messagee.createReactionCollector(filter, { time: 15000 });
  58.  
  59. collector.on('collect', (reaction, reactionCollector) => {
  60. messagee.delete();
  61. });
  62.  
  63. });
  64.  
  65. });
  66.  
  67.  
  68. }
  69.  
  70. module.exports.help = {
  71. name: "chk"
  72. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement