├── package.json ├── config.json ├── README.md └── index.js /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "author": "nekrxs.", 3 | "dependencies": { 4 | "discord.js": "^14.14.1" 5 | } 6 | } -------------------------------------------------------------------------------- /config.json: -------------------------------------------------------------------------------- 1 | { 2 | "token": "Put-Token-Here", 3 | "time": "5000", 4 | "time2": "5000", 5 | "color": "#2b2d31", 6 | "pfp": [], 7 | "banner": [] 8 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |

2 | 🦅 〢 Pfp Bot 3 |

4 | 5 | --- 6 | ## 🍃 〢 Menu 7 | 8 | - [📩・Deploy With](#deploys) 9 | - [⚙️・Setting up](#setup) 10 | - [💼・Term](#terms) 11 | - [🕵️‍♂️・Authors](#authors) 12 | - [🪄・Discord](https://discord.gg/uhq) 13 | 14 | ## 📩 〢 Deploys 15 | [![Deploy](https://raw.githubusercontent.com/Nekros-dsc/deploy-buttons/main/buttons/remade/replit.svg)](https://replit.com/github/Nekros-dsc/Pfp-Bot) 16 | 17 | [![Deploy](https://raw.githubusercontent.com/Nekros-dsc/deploy-buttons/main/buttons/remade/glitch.svg)](https://glitch.com/edit/#!/import/github/Nekros-dsc/Pfp-Bot) 18 | 19 | [![Deploy](https://raw.githubusercontent.com/Nekros-dsc/deploy-buttons/main/buttons/remade/heroku.svg)](https://heroku.com/deploy/?template=https://github.com/Nekros-dsc/Pfp-Bot) 20 | 21 | [![Deploy](https://raw.githubusercontent.com/Nekros-dsc/deploy-buttons/main/buttons/remade/railway.svg)](https://railway.app/new/template?template=https://github.com/Nekros-dsc/Pfp-Bot) 22 | 23 | ## 📁 〢 Setting up 24 | 25 | 1. Install [NodeJS](https://nodejs.org/) 26 | 2. Install [Files](https://github.com/Nekros-dsc/Pfp-Bot/archive/refs/heads/main.zip) 27 | 3. Complete the configuration 28 | 5. Enjoy the tool 29 | 30 | ### 💼 〢 Terms Of Usage 31 | 32 | - [x] Educational purpose only. 33 | - [x] You can use the source code if you keep credits (in embed + in markdown), it has to be open-source. 34 | - [x] We are NOT responsible of anything you do with our software (if its illegal). 35 | 36 | ### 🕵️‍♂️ 〢 Authors 37 | - [Nekros](https://github.com/Nekros-dsc) 38 | 39 | --- -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | const Discord = require('discord.js'); 2 | const client = new Discord.Client({ 3 | intents: [Discord.GatewayIntentBits.Guilds, Discord.GatewayIntentBits.GuildMessages, Discord.GatewayIntentBits.MessageContent, Discord.GatewayIntentBits.GuildMembers, Discord.GatewayIntentBits.GuildPresences, Discord.GatewayIntentBits.GuildVoiceStates, Discord.GatewayIntentBits.DirectMessages, Discord.GatewayIntentBits.GuildMessageReactions, Discord.GatewayIntentBits.GuildEmojisAndStickers, Discord.GatewayIntentBits.GuildInvites], 4 | partials: [Discord.Partials.Channel, Discord.Partials.Message, Discord.Partials.User, Discord.Partials.GuildMember, Discord.Partials.Reaction, Discord.Partials.ThreadMember, Discord.Partials.GuildScheduledEvent] 5 | }); 6 | const config = require('./config.json'); 7 | client.login(config.token); 8 | 9 | client.on('ready', async () => { 10 | 11 | console.log(`[!] — Logged in as ${client.user.tag} (${client.user.id})`); 12 | 13 | setInterval(async () => { 14 | config.pfp.map(async (id) => { 15 | const channel = client.channels.cache.get(id); 16 | if (!channel) return; 17 | 18 | try { 19 | const members = await channel.guild.members.fetch(); 20 | const randomMember = members.filter(m => !m.user.bot).random().user; 21 | 22 | const embed = new Discord.EmbedBuilder() 23 | .setTitle('`🦅` ▸ Random Pfp') 24 | .setAuthor({ name: randomMember.username, iconURL: randomMember.displayAvatarURL({ dynamic: true }) }) 25 | .setImage(randomMember.displayAvatarURL({ dynamic: true, size: 4096 })) 26 | .setFooter({ text: channel.guild.name, iconURL: channel.guild.iconURL() }) 27 | .setColor(config.color) 28 | .setTimestamp(); 29 | 30 | const button = new Discord.ButtonBuilder() 31 | .setStyle(Discord.ButtonStyle.Link) 32 | .setLabel(' ▸ Link') 33 | .setURL(randomMember.displayAvatarURL({ dynamic: true, size: 4096 })); 34 | 35 | const row = new Discord.ActionRowBuilder().addComponents(button); 36 | return channel.send({ embeds: [embed], components: [row] }); 37 | } catch {} 38 | }); 39 | }, parseInt(config.time)) 40 | 41 | setInterval(async () => { 42 | config.banner.map(async (id) => { 43 | const channel = client.channels.cache.get(id); 44 | if (!channel) return; 45 | 46 | try { 47 | const members = await channel.guild.members.fetch(); 48 | const randomMember = members.filter(m => !m.user.bot).random().user; 49 | await randomMember.fetch(); 50 | if (!randomMember.bannerURL()) return; 51 | 52 | const embed = new Discord.EmbedBuilder() 53 | .setTitle('`🦅` ▸ Random Banner') 54 | .setAuthor({ name: randomMember.username, iconURL: randomMember.displayAvatarURL({ dynamic: true }) }) 55 | .setImage(randomMember.bannerURL({ dynamic: true, size: 4096 })) 56 | .setFooter({ text: channel.guild.name, iconURL: channel.guild.iconURL() }) 57 | .setColor(config.color) 58 | .setTimestamp(); 59 | 60 | const button = new Discord.ButtonBuilder() 61 | .setStyle(Discord.ButtonStyle.Link) 62 | .setLabel(' ▸ Link') 63 | .setURL(randomMember.bannerURL({ dynamic: true, size: 4096 })); 64 | 65 | const row = new Discord.ActionRowBuilder().addComponents(button); 66 | return channel.send({ embeds: [embed], components: [row] }); 67 | } catch {} 68 | }); 69 | }, parseInt(config.time2)) 70 | }); --------------------------------------------------------------------------------