NYX.js (3002B)
1 const { 2 Client, 3 Collection, 4 EmbedBuilder, 5 GatewayIntentBits, 6 Partials, 7 } = require("discord.js"); 8 const config = require("../config"); 9 require("dotenv").config(); 10 11 class NYX extends Client { 12 /** 13 * @param {Client.options} options 14 */ 15 constructor( 16 options = { 17 presence: { 18 activities: [ 19 { 20 name: `/help`, 21 type: 1, 22 url: "https://www.youtube.com/watch?v=YSKDu1gKntY", 23 }, 24 ], 25 }, 26 shards: "auto", 27 partials: [ 28 Partials.Message, 29 Partials.Channel, 30 Partials.Reaction, 31 Partials.GuildMember, 32 ], 33 intents: [ 34 GatewayIntentBits.Guilds, 35 GatewayIntentBits.GuildMembers, 36 // GatewayIntentBits.MessageContent, 37 GatewayIntentBits.GuildMessages, 38 GatewayIntentBits.DirectMessageTyping, 39 GatewayIntentBits.DirectMessages, 40 ], 41 } 42 ) { 43 super(options); 44 this.slashCommands = new Collection(); 45 this.hide = new Collection(); 46 this.config = config; 47 this.data = require("../util/functions/mongoose"); 48 this.color = config.color; 49 this.author = "Team NYX"; 50 this.invite = "https://discord.gg/SbQHChmGcp"; 51 this.docs = "https://thunder75.gitbook.io/nyx/"; 52 this.web = config.URL; 53 this.owners = [ 54 "452076196419600394", // Night 55 "534027706325532694", // Cat drinking a cat 56 "381442059111759883", // Thunder 57 "556808365574193194", // chunchunmaru 58 "687622268037365774", // Tac Shadow 59 "309681798957498368", // Sideload 60 "707177879984668673", // Random rock 61 "757530324686340197", // Madhav 62 "804712098625486848", // hcs 63 "1078015817184182414", // gaba 64 "774390900411465769", // Alphaus 65 ]; 66 this.currency = "<:nyx_currency:918584872333893703>"; 67 this.xp = "<:nyx_xp:900309007472926720>"; 68 this.dev = "<:discord_bot_dev:840231906200387666>"; 69 this.path = [ 70 "614423108388126731", // Camper on Duty 71 "767173194943168542", // Dark Bonker 72 "718762019586572341", // NYX Nation 73 "840225563193114624", // Command Test 74 ]; 75 } 76 77 start() { 78 require("../util/dist/handler")(this); 79 this.login( 80 process.argv[2] == "--dev" ? process.env.DEV : process.env.TOKEN 81 ); 82 this.data 83 .connect(process.env.MONGO) 84 .then(() => console.log("Connected to MongoDB ✅")) 85 .catch(e => console.log(e)); 86 } 87 err(interaction, error) { 88 const embed = new EmbedBuilder() 89 .setTitle("An Error Occured") 90 .setColor("Red") 91 .setDescription(`❌ | ${error}`) 92 .setTimestamp() 93 .setFooter({ 94 text: `Made by ${this.author}`, 95 iconURL: this.user.displayAvatarURL({ dynamic: true }), 96 }); 97 interaction.channel.send({ embeds: [embed] }); 98 this.channels.cache.get(this.config.ErrorLog).send({ embeds: [embed] }); 99 } 100 } 101 102 module.exports = NYX;