///////////////AVIATION CLUB BOT CODE////////////////////////// require('dotenv') const { MessageAttachment } = require("discord.js") const { Client, MessageEmbed } = require("discord.js"); const Discord = require('discord.js'); const keepAlive = require("./server"); const client = new Discord.Client(); const Zeew = require("zeew"); const sfw = new Zeew.sfw("TOKEN"); var http = require('http'); http.createServer(function(req, res) { res.write("The bot is running 24/7!"); res.end(); }).listen(8080); client.on("ready", () => { console.log("The bot is ready to use, Enjoy!"); presence(); }); /////////////////////COMMAND SECTION///////////////////////////// client.on('message', message => { if (message.content === '!ping') { message.channel.send('Pong.'); } else if (message.content.startsWith("¿metar")) { message.channel.send("https://www.smn.gob.ar/metar ```we only have argentina metars```"); } else if (message.content.startsWith("¿charts")) { message.channel.send("https://bit.ly/38ShDfP"); } else if (message.content.startsWith("¿taf")) { message.channel.send("https://www.smn.gob.ar/taf ```we only have argentina taf´s```"); } else if (message.content.startsWith("¿notams")) { message.channel.send("http://ais.anac.gov.ar/notam ```we only have argentina notams ;(```"); } else if (message.content.startsWith("¿server link")) { message.channel.send("```The server link:``` https://discord.gg/gPQQDWd"); } else if (message.content === ("¿help")) { const embed = new MessageEmbed(); embed.setTitle("Contact Berni#7500 at discord please!"); message.channel.send(embed); } else if (message.content === ("¿commands")) { const embed = new MessageEmbed() .setTitle("Commands") .setDescription("¿metar\n\ ¿charts\n\ ¿taf\n\ ¿notams\n\ ¿help\n\ ¿rules\n\ ¿roles \n\ ¿botstatus") .setFooter("Aviation club bot, Created by Bernardo Paley") .setColor("0XDF013A") message.channel.send(embed); } else if (message.content === ("¿rules")) { const embed = new MessageEmbed() .setTitle("**RULES**") .setDescription(":green_circle: Be respectful with everybody\n\:green_circle: Be gentle with all members\n\ :green_circle: please notify the @moderator of any problem\n\ :green_circle: Use each channel for its respective theme\n\////////////////////////////////\n\ :red_circle: Sharing content very out of place to what the group refers to(BAN for 24 Hs.)\n\ :red_circle: There are channels to chat outside the scope of the group, it is not necessary to abuse!\n\ :red_circle:Insulting, attacking or carrying out any type of badly hurtful action towards any member of the server\n\ :red_circle: Perform any SPAM class(BAN for 24 Hs.)\n\ :red_circle: Abuse your role\n\ please send a message to @berni if you have a Doubt") .setColor("0X0404B4") .setFooter("Aviation club bot, Created by Bernardo Paley") message.channel.send(embed); } else if (message.content === ("¿verification")) { const embed = new MessageEmbed(); embed.setTitle("Verification"); embed.setDescription("Hey! Hello! How are u? \n\ for verifying please visit the Channel #verification \n\ and send ¿verify ") .setColor("0XDF013A") .setFooter("Aviation club bot, Created by Bernardo Paley") message.channel.send(embed); } else if (message.content.startsWith("¿everyone")) { message.channel.send("@everyone") } else if (message.content.startsWith("¿botstatus")) { message.channel.send("Im online! Also you can check here: https://aviation-club-bot.bernipaley2007.repl.co ") } else if (message.content.startsWith("hi")) { message.channel.send("hey"); } else if (message.content.startsWith("hello")) { message.channel.send("hey"); } else if (message.content === ("¿Announcements")) { const embed = new MessageEmbed(); embed.setTitle("Aviation Club Bot V2"); embed.setDescription("Introducing the Aviation Club Bot V2! \n\ An improved bot with better functionalities! \n\ Like personalized welcomes and a new verification system. \n\ After 1 arduous month of programming we did it! A fully functional bot with custom commands and much more ... To submit an opinion about the bot send it to Berni # 7500 on Discord!\n\ Thanks for being part of this community!") .setFooter("Aviation club bot, Created by Bernardo Paley") message.channel.send(embed); } else if (message.content === ("¿verify")) { const embed = new MessageEmbed(); embed.setTitle(""); embed.setDescription("Role Added \n\ Now, go to \n\ #Role-request \n\ and send ¿roles ") .setColor("0XDF013A") .setFooter("Aviation club bot, Created by Bernardo Paley") message.channel.send(embed); } else if (message.content === ("¿vp")) { const embed = new MessageEmbed(); embed.setTitle(""); embed.setDescription("Virtual pilot role Added") .setColor("0XDF013A") .setFooter("Aviation club bot, Created by Bernardo Paley") message.channel.send(embed); } else if (message.content === ("¿ap")) { const embed = new MessageEmbed(); embed.setTitle(""); embed.setDescription("Aspiring pilot role Added") .setColor("0XDF013A") .setFooter("Aviation club bot, Created by Bernardo Paley") message.channel.send(embed); } else if (message.content === ("¿pp")) { const embed = new MessageEmbed(); embed.setTitle(""); embed.setDescription("Private pilot role Added") .setColor("0XDF013A") .setFooter("Aviation club bot, Created by Bernardo Paley") message.channel.send(embed); } else if (message.content === ("¿vp")) { const embed = new MessageEmbed(); embed.setTitle(""); embed.setDescription("Commercial pilot role Added") .setColor("0XDF013A") .setFooter("Aviation club bot, Created by Bernardo Paley") message.channel.send(embed); } else if (message.content === ("¿changelog")) { const embed = new MessageEmbed(); embed.setTitle("Aviation club bot changelog"); embed.setDescription("V0.5 \n\ BASE BOT, COMMANDS LIKE ¿charts \n\ V1.0 \n\ COMMANDS LIKE ¿rules and verification command \n\ V1.5 \n\ Advise when the role was added! \n\ V2.0 \n\ New verification system code and new custom welcome banner! \n\ V2.5 \n\ You can put to you specific roles with commands ") .setColor("0XDF013A") .setFooter("Aviation club bot, Created by Bernardo Paley") message.channel.send(embed); } else if (message.content === ("¿roles")) { const embed = new MessageEmbed(); embed.setTitle("Roles"); embed.setDescription("This commands are for request roles, go to #roles-request and send: \n\ If you are a virtual pilot, send \n\ ¿vp \n\ If you are a Aspiring pilot, send \n\ ¿ap \n\ if you are a Private pilot, send \n\ ¿pp \n\ If you are a commercial pilot send \n\ ¿cp") .setColor("0XDF013A") .setFooter("Aviation club bot, Created by Bernardo Paley") message.channel.send(embed); } }); /////////////////////////PRESENCE SECTION/////////////////////// function presence() { client.user.setPresence({ status: "online", activity: { name: "Prepar3D | ¿help ¿commands", type: "PLAYING" } }); /////////////////////ROLES SECTION////////////////////////// //////////////////////VERIFIED/////////////////////////////// client.on('message', async message => { if(message.author.bot) return; if(message.content.toLowerCase() === '¿verify' && message.channel.id === '812398101049770054') { const role = message.guild.roles.cache.get('813034318053507094'); if(role) { try { await message.member.roles.add(role); console.log("Verified role added!"); } catch(err) { console.log(err); } } } }); //////////////////////////Virtual Pilot Role////////////////// client.on('message', async message => { if(message.author.bot) return; if(message.content.toLowerCase() === '¿vp' && message.channel.id === '813034263062511627') { const role = message.guild.roles.cache.get('801623868787785738'); if(role) { try { await message.member.roles.add(role); console.log("Virtual pilot role added!"); } catch(err) { console.log(err); } } } }); client.on('message', async message => { if(message.author.bot) return; if(message.content.toLowerCase() === '¿ap' && message.channel.id === '813034263062511627') { const role = message.guild.roles.cache.get('801586686516789248'); if(role) { try { await message.member.roles.add(role); console.log("Aspiring pilot role added! "); } catch(err) { console.log(err); } } } }); /////////////////////////Private Pilot//////////////////// client.on('message', async message => { if(message.author.bot) return; if(message.content.toLowerCase() === '¿pp' && message.channel.id === '813034263062511627') { const role = message.guild.roles.cache.get('801586636651626518'); if(role) { try { await message.member.roles.add(role); console.log("Private pilot role added!"); } catch(err) { console.log(err); } } } }); ////////////////////////Comercial Pilot/////////////////// client.on('message', async message => { if(message.author.bot) return; if(message.content.toLowerCase() === '¿cp' && message.channel.id === '813034263062511627') { const role = message.guild.roles.cache.get('801586503129104454'); if(role) { try { await message.member.roles.add(role); console.log("Commercial pilot role added!"); } catch(err) { console.log(err); } } } ////////////////////////////ZEEW//////////////// }); client.on("guildMemberAdd", async member => { let wel = new Zeew.Bienvenida() .token("60304d278e9410cb62c5eb11") .estilo("classic") .avatar(member.user.displayAvatarURL({format: 'png'})) .fondo("https://i.ibb.co/5BwMy7w/FOTO-BANNER-1024-X450.jpg") .colorTit("#B32020") .titulo("Welcome , " +member.user.tag ) .colorDesc("#B32020") .descripcion("Now we are " +member.guild.memberCount+ " pilots at the server!"); let img = await Zeew.WelcomeZeew(wel); let attachment = new MessageAttachment(img, "FOTO BIENVENIDA ZEEW.gif"); client.channels.resolve("812699579954757672").send(attachment); }); client.on("guildMemberRemove", async member => { let wel = new Zeew.Bienvenida() .token("TOKEN") .estilo("classic") .avatar(member.user.displayAvatarURL({format: 'png'})) .fondo("https://i.ibb.co/5BwMy7w/FOTO-BANNER-1024-X450.jpg") .colorTit("#B32020") .titulo("We are going to miss you, ") .colorDesc("#B32020") .descripcion(member.user.tag + "") let img = await Zeew.WelcomeZeew(wel); let attachment = new MessageAttachment(img, "FOTO DESPEDIDA ZEEW.gif"); client.channels.resolve("812699696195043378").send(attachment); }); keepAlive(); client.login(process.env.DISCORD_BOT_TOKEN);} /////////////////////ROLES SECTION////////////////////////// //////////////////////VERIFIED/////////////////////////////// client.on('message', async message => { if(message.author.bot) return; if(message.content.toLowerCase() === '¿verify' && message.channel.id === '812398101049770054') { const role = message.guild.roles.cache.get('813034318053507094'); if(role) { try { await message.member.roles.add(role); console.log("Verified role added!"); } catch(err) { console.log(err); } } } }); //////////////////////////Virtual Pilot Role////////////////// client.on('message', async message => { if(message.author.bot) return; if(message.content.toLowerCase() === '¿vp' && message.channel.id === '813034263062511627') { const role = message.guild.roles.cache.get('TOKEN'); if(role) { try { await message.member.roles.add(role); console.log("Virtual pilot role added!"); } catch(err) { console.log(err); } } } /////////////////////////////Aspiring pilot///////////////// }); client.on('message', async message => { if(message.author.bot) return; if(message.content.toLowerCase() === '¿ap' && message.channel.id === '813034263062511627') { const role = message.guild.roles.cache.get('801586686516789248'); if(role) { try { await message.member.roles.add(role); console.log("Aspiring pilot role added! "); } catch(err) { console.log(err); } } } }); /////////////////////////Private Pilot//////////////////// client.on('message', async message => { if(message.author.bot) return; if(message.content.toLowerCase() === '¿pp' && message.channel.id === '813034263062511627') { const role = message.guild.roles.cache.get('801586636651626518'); if(role) { try { await message.member.roles.add(role); console.log("Private pilot role added!"); } catch(err) { console.log(err); } } } }); ////////////////////////Comercial Pilot/////////////////// client.on('message', async message => { if(message.author.bot) return; if(message.content.toLowerCase() === '¿cp' && message.channel.id === '813034263062511627') { const role = message.guild.roles.cache.get('801586503129104454'); if(role) { try { await message.member.roles.add(role); console.log("Commercial pilot role added!"); } catch(err) { console.log(err); } } } ////////////////////////////ZEEW//////////////// }); client.on("guildMemberAdd", async member => { let wel = new Zeew.Bienvenida() .token("60304d278e9410cb62c5eb11") .estilo("classic") .avatar(member.user.displayAvatarURL({format: 'png'})) .fondo("https://i.ibb.co/5BwMy7w/FOTO-BANNER-1024-X450.jpg") .colorTit("#B32020") .titulo("Welcome , " +member.user.tag ) .colorDesc("#B32020") .descripcion("Now we are " +member.guild.memberCount+ " pilots at the server!"); let img = await Zeew.WelcomeZeew(wel); let attachment = new MessageAttachment(img, "FOTO BIENVENIDA ZEEW.gif"); client.channels.resolve("812699579954757672").send(attachment); }); client.on("guildMemberRemove", async member => { let wel = new Zeew.Bienvenida() .token("60304d278e9410cb62c5eb11") .estilo("classic") .avatar(member.user.displayAvatarURL({format: 'png'})) .fondo("https://i.ibb.co/5BwMy7w/FOTO-BANNER-1024-X450.jpg") .colorTit("#B32020") .titulo("We are going to miss you, ") .colorDesc("#B32020") .descripcion(member.user.tag + "") let img = await Zeew.WelcomeZeew(wel); let attachment = new MessageAttachment(img, "FOTO DESPEDIDA ZEEW.gif"); client.channels.resolve("812699696195043378").send(attachment); }); keepAlive(); client.login(process.env.DISCORD_BOT_TOKEN);