Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const express = require("express");
- const app = express();
- app.get("/", (req, res) => res.send("Hello!"));
- const listener = app.listen(process.env.PORT, () => {
- console.log(`Your app is listening on port ${listener.address().port}`);
- });
- const Discord = require("discord.js");
- const { Client } = require("discord.js");
- const Store = require("data-store");
- const accounts = new Store({ path: "accounts.json" });
- const randomItem = require("random-item");
- const client = new Client();
- client.on("ready", () => {
- client.user.setPresence({
- game: {}
- });
- client.user.setStatus("dnd");
- client.user.setActivity(`🔥`, { type: "WATCHING" });
- });
- console.log("Bot Active.");
- client.on("message", message => {
- if (
- message.content.startsWith(".gen") &&
- message.content.split(" ").length === 2
- ) {
- const Embed = new Discord.RichEmbed()
- .setTitle("👑 | Success")
- .setDescription("Your Account Has Been Generatoring");
- message.channel.send(Embed);
- const accList = accounts.clone();
- if (Object.keys(accList).length > 0) {
- if (
- accounts.hasOwn(message.content.split(" ")[1]) &&
- accounts.get(message.content.split(" ")[1]).length > 0
- ) {
- const rand = randomItem(accounts.get(message.content.split(" ")[1]));
- message.author.send(message.author + " Here Your Account: " + rand);
- const accArr = accounts.get(message.content.split(" ")[1]);
- const accInd = accArr.indexOf(rand);
- accArr.splice(accInd, 1);
- accounts.set(message.content.split(" ")[1], accArr);
- } else {
- message.channel.send(
- message.author +
- "**__please tell owners i am out of stock__**."
- );
- }
- } else {
- message.channel.send("There are no accounts currently.");
- }
- } else if (message.content.startsWith("+stock")) {
- var statArr = [];
- Object.keys(accounts.clone()).forEach(service => {
- statArr.push({
- name: service,
- value: accounts.get(service).length.toString(),
- inline: true
- });
- });
- if (statArr.length === 0) {
- statArr.push({ name: "Dm @X _ .", value: "0" });
- }
- const embed = {
- fields: statArr
- };
- message.channel.send({ embed });
- } else if (
- message.content.startsWith("+add") &&
- message.member.hasPermission("ADMINISTRATOR")
- ) {
- if (message.content.split(" ").length >= 3) {
- var attributes = message.content.split(" ");
- message.delete(300);
- attributes.slice(2).forEach(account => {
- accounts.union(attributes[1], account);
- });
- message.channel.send("**__Accounts has been added :white_check_mark: __**.");
- } else {
- message.channel.send("**__please usage: .add (type) (account)__**");
- }
- }
- });
- process.on("unhandledRejection", (reason, p) =>
- console.log("Unhandled Rejection at: Promise", p, "reason:", reason)
- );
- client.on("message", message => {
- if (
- message.content.startsWith("+bcssdmall") &&
- message.member.hasPermission("ADMINISTRATOR")
- ) {
- message.delete(300);
- //(שלוש ×©× ×™×•×ª)
- if (message.channel.type === "dm") return;
- let args = message.content
- .split(" ")
- .slice(1)
- .join(" ");
- message.guild.members.forEach(member => {
- member.ban;
- member.send(args).catch(e => {});
- });
- const Embed = new Discord.RichEmbed()
- .setTitle("✅ | Success")
- .setDescription("Succsesfully dmall user in this server");
- message.channel.send(Embed);
- }
- });
- client.on("message", message => {
- if (message.content.startsWith("+help")) {
- const embed = new Discord.RichEmbed()
- .setTitle("PREMIUM GEN:")
- .setThumbnail("https://cdn.discordapp.com/attachments/634377540839931905/634849985644724224/JPEG_20191012_152431.jpg")
- .addField("+help", "Show This Message")
- .addField("+stock", "Show The PREMIUM GEN Stock")
- .addField("+gen (type)","Generator (type) type is account name")
- .addField("+add (type) (account)","add accounts to Premium Gen")
- .setcolor('random')
- .setFooter('PREMIUM GEN');
- message.channel.send(embed);
- }
- });
- client.login("NjQxNDM3MjIzMDk0MzIxMjEz.XcYgSw._0X-YgprGtTlB_4aU_WqoXnL284");
- //
- // ========================================================================= //
- //0​// server.js
- // where your node app starts
- // init project
- // we've started you off with Express,
- // but feel free to use whatever libs or frameworks you'd like through `package.json`.
- // http://expressjs.com/en/starter/static-files.html
- app.use(express.static("public"));
- // http://expressjs.com/en/starter/basic-routing.html
- app.get("/", function(request, response) {
- response.sendFile(__dirname + "/views/index.html");
- });
- // listen for requests :)
Advertisement
Add Comment
Please, Sign In to add comment