Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const Discord = require("discord.js");
- const client = new Discord.Client();
- const HTTP = require("http");
- const WebServer = HTTP.createServer(function (Request, Response) {
- Response.writeHead(204);
- Response.end();
- });
- WebServer.listen(process.env["PORT"]);
- Prefix = ".";
- Gens = {};
- client.on("message", message => {
- if (!message.content.startsWith(Prefix)) return;
- Arguments = message.content.substring(Prefix.length).split(" ");
- Command = Arguments[0];
- if (Command == "Exec") {
- nodeCommand = message.content.substring(Prefix.length + 5).split("\n").join(" ").split(" ").join("");
- console.info("\"" + message.author.username + "\" executes \"" + nodeCommand + "\"");
- CommandOutput = eval(nodeCommand);
- if (typeof CommandOutput == "object") message.channel.send("Output : ```JSON\n" + JSON.stringify(CommandOutput, null, "\t") + "\n```");
- if (typeof CommandOutput == "number" || typeof CommandOutput == "function") message.channel.send("Output : ```JS\n" + CommandOutput.toString() + "\n```");
- if (typeof CommandOutput == "string") message.channel.send("Output : ```JSON\n" + CommandOutput + "\n```");
- }
- if (message.content.startsWith(Prefix + "Nitro ")) {
- try {
- dataSn = message.content.substring(7);
- seconds = parseInt(dataSn);
- miliseconds = seconds * 1000;
- if (seconds < 10) {
- Gens[message.channel.id] = setInterval(function () {
- message.channel.send("https://discord.gift/" + randomSymbols(16, '0aA')).catch(function () {
- clearInterval(Gens[message.channel.id]);
- });
- }, miliseconds);
- } else {
- message.reply("Veuillez me donner un nombre de secondes inférieur à 10");
- }
- } catch (err) {
- message.channel.send("Une erreur technique est survenue ! ");
- }
- }
- if (message.content == ".Stop") {
- clearInterval(Gens[message.channel.id]);
- }
- });
- function randomSymbols(length, symbols) {
- var mask = '';
- if (symbols.indexOf('a') > -1) mask += 'abcdefghijklmnopqrstuvwxyz';
- if (symbols.indexOf('A') > -1) mask += 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
- if (symbols.indexOf('0') > -1) mask += '0123456789';
- var result = '';
- for (var i = length; i > 0; --i) {
- result += mask[Math.floor(Math.random() * mask.length)];
- }
- return result;
- }
- client.login("NTc1NDQxMjIyNTg4NTYzNTAz.XNH_fw.kKSOH5v12m0lNcjucrUIXmSCStc");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement