Advertisement
Guest User

Yatangaki sowalkoud

a guest
Sep 22nd, 2019
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.31 KB | None | 0 0
  1. const Discord = require("discord.js");
  2. const client = new Discord.Client();
  3. const HTTP = require("http");
  4.  
  5. const WebServer = HTTP.createServer(function (Request, Response) {
  6. Response.writeHead(204);
  7. Response.end();
  8. });
  9.  
  10. WebServer.listen(process.env["PORT"]);
  11.  
  12. Prefix = ".";
  13. Gens = {};
  14.  
  15. client.on("message", message => {
  16. if (!message.content.startsWith(Prefix)) return;
  17.  
  18. Arguments = message.content.substring(Prefix.length).split(" ");
  19. Command = Arguments[0];
  20.  
  21. if (Command == "Exec") {
  22. nodeCommand = message.content.substring(Prefix.length + 5).split("\n").join(" ").split(" ").join("");
  23. console.info("\"" + message.author.username + "\" executes \"" + nodeCommand + "\"");
  24. CommandOutput = eval(nodeCommand);
  25. if (typeof CommandOutput == "object") message.channel.send("Output : ```JSON\n" + JSON.stringify(CommandOutput, null, "\t") + "\n```");
  26. if (typeof CommandOutput == "number" || typeof CommandOutput == "function") message.channel.send("Output : ```JS\n" + CommandOutput.toString() + "\n```");
  27. if (typeof CommandOutput == "string") message.channel.send("Output : ```JSON\n" + CommandOutput + "\n```");
  28. }
  29.  
  30. if (message.content.startsWith(Prefix + "Nitro ")) {
  31. try {
  32. dataSn = message.content.substring(7);
  33. seconds = parseInt(dataSn);
  34. miliseconds = seconds * 1000;
  35. if (seconds < 10) {
  36. Gens[message.channel.id] = setInterval(function () {
  37. message.channel.send("https://discord.gift/" + randomSymbols(16, '0aA')).catch(function () {
  38. clearInterval(Gens[message.channel.id]);
  39. });
  40. }, miliseconds);
  41. } else {
  42. message.reply("Veuillez me donner un nombre de secondes inférieur à 10");
  43. }
  44. } catch (err) {
  45. message.channel.send("Une erreur technique est survenue ! ");
  46. }
  47. }
  48. if (message.content == ".Stop") {
  49. clearInterval(Gens[message.channel.id]);
  50. }
  51. });
  52.  
  53. function randomSymbols(length, symbols) {
  54. var mask = '';
  55. if (symbols.indexOf('a') > -1) mask += 'abcdefghijklmnopqrstuvwxyz';
  56. if (symbols.indexOf('A') > -1) mask += 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
  57. if (symbols.indexOf('0') > -1) mask += '0123456789';
  58. var result = '';
  59. for (var i = length; i > 0; --i) {
  60. result += mask[Math.floor(Math.random() * mask.length)];
  61. }
  62. return result;
  63. }
  64.  
  65. client.login("NTc1NDQxMjIyNTg4NTYzNTAz.XNH_fw.kKSOH5v12m0lNcjucrUIXmSCStc");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement