├── Ayarlar └── Ayarlar.json ├── Events ├── commandHandler.js └── ready.js ├── Komutlar └── Rich.js ├── LICENSE ├── README.md ├── boot.js ├── node_modules ├── @types │ ├── node │ │ ├── LICENSE │ │ ├── README.md │ │ ├── assert.d.ts │ │ ├── async_hooks.d.ts │ │ ├── base.d.ts │ │ ├── buffer.d.ts │ │ ├── child_process.d.ts │ │ ├── cluster.d.ts │ │ ├── console.d.ts │ │ ├── constants.d.ts │ │ ├── crypto.d.ts │ │ ├── dgram.d.ts │ │ ├── dns.d.ts │ │ ├── domain.d.ts │ │ ├── events.d.ts │ │ ├── fs.d.ts │ │ ├── fs │ │ │ └── promises.d.ts │ │ ├── globals.d.ts │ │ ├── globals.global.d.ts │ │ ├── http.d.ts │ │ ├── http2.d.ts │ │ ├── https.d.ts │ │ ├── index.d.ts │ │ ├── inspector.d.ts │ │ ├── module.d.ts │ │ ├── net.d.ts │ │ ├── os.d.ts │ │ ├── package.json │ │ ├── path.d.ts │ │ ├── perf_hooks.d.ts │ │ ├── process.d.ts │ │ ├── punycode.d.ts │ │ ├── querystring.d.ts │ │ ├── readline.d.ts │ │ ├── repl.d.ts │ │ ├── stream.d.ts │ │ ├── string_decoder.d.ts │ │ ├── timers.d.ts │ │ ├── tls.d.ts │ │ ├── trace_events.d.ts │ │ ├── ts3.4 │ │ │ ├── assert.d.ts │ │ │ ├── base.d.ts │ │ │ ├── globals.global.d.ts │ │ │ └── index.d.ts │ │ ├── ts3.6 │ │ │ ├── base.d.ts │ │ │ └── index.d.ts │ │ ├── tty.d.ts │ │ ├── url.d.ts │ │ ├── util.d.ts │ │ ├── v8.d.ts │ │ ├── vm.d.ts │ │ ├── wasi.d.ts │ │ ├── worker_threads.d.ts │ │ └── zlib.d.ts │ └── ws │ │ ├── LICENSE │ │ ├── README.md │ │ ├── index.d.ts │ │ └── package.json ├── discord-logs │ ├── README.md │ ├── lib │ │ ├── handlers │ │ │ ├── guildChannel.d.ts │ │ │ ├── guildChannel.js │ │ │ ├── guildMemberUpdate.d.ts │ │ │ ├── guildMemberUpdate.js │ │ │ ├── guildUpdate.d.ts │ │ │ ├── guildUpdate.js │ │ │ ├── index.d.ts │ │ │ ├── index.js │ │ │ ├── messageUpdate.d.ts │ │ │ ├── messageUpdate.js │ │ │ ├── presenceUpdate.d.ts │ │ │ ├── presenceUpdate.js │ │ │ ├── roleUpdate.d.ts │ │ │ ├── roleUpdate.js │ │ │ ├── userUpdate.d.ts │ │ │ ├── userUpdate.js │ │ │ ├── voiceStateUpdate.d.ts │ │ │ └── voiceStateUpdate.js │ │ ├── index.d.ts │ │ └── index.js │ └── package.json └── discord.js │ ├── .tern-project │ ├── LICENSE │ ├── README.md │ ├── esm │ └── discord.mjs │ ├── jsdoc.json │ ├── node_modules │ ├── @discordjs │ │ ├── collection │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── dist │ │ │ │ ├── index.d.ts │ │ │ │ └── index.js │ │ │ └── package.json │ │ └── form-data │ │ │ ├── License │ │ │ ├── Readme.md │ │ │ ├── index.d.ts │ │ │ ├── lib │ │ │ ├── browser.js │ │ │ ├── form_data.js │ │ │ └── populate.js │ │ │ └── package.json │ ├── abort-controller │ │ ├── LICENSE │ │ ├── README.md │ │ ├── browser.js │ │ ├── browser.mjs │ │ ├── dist │ │ │ ├── abort-controller.d.ts │ │ │ ├── abort-controller.js │ │ │ ├── abort-controller.js.map │ │ │ ├── abort-controller.mjs │ │ │ ├── abort-controller.mjs.map │ │ │ ├── abort-controller.umd.js │ │ │ └── abort-controller.umd.js.map │ │ ├── package.json │ │ ├── polyfill.js │ │ └── polyfill.mjs │ ├── asynckit │ │ ├── LICENSE │ │ ├── README.md │ │ ├── bench.js │ │ ├── index.js │ │ ├── lib │ │ │ ├── abort.js │ │ │ ├── async.js │ │ │ ├── defer.js │ │ │ ├── iterate.js │ │ │ ├── readable_asynckit.js │ │ │ ├── readable_parallel.js │ │ │ ├── readable_serial.js │ │ │ ├── readable_serial_ordered.js │ │ │ ├── state.js │ │ │ ├── streamify.js │ │ │ └── terminator.js │ │ ├── package.json │ │ ├── parallel.js │ │ ├── serial.js │ │ ├── serialOrdered.js │ │ └── stream.js │ ├── combined-stream │ │ ├── License │ │ ├── Readme.md │ │ ├── lib │ │ │ └── combined_stream.js │ │ ├── package.json │ │ └── yarn.lock │ ├── delayed-stream │ │ ├── .npmignore │ │ ├── License │ │ ├── Makefile │ │ ├── Readme.md │ │ ├── lib │ │ │ └── delayed_stream.js │ │ └── package.json │ ├── event-target-shim │ │ ├── LICENSE │ │ ├── README.md │ │ ├── dist │ │ │ ├── event-target-shim.js │ │ │ ├── event-target-shim.js.map │ │ │ ├── event-target-shim.mjs │ │ │ ├── event-target-shim.mjs.map │ │ │ ├── event-target-shim.umd.js │ │ │ └── event-target-shim.umd.js.map │ │ ├── index.d.ts │ │ └── package.json │ ├── mime-db │ │ ├── HISTORY.md │ │ ├── LICENSE │ │ ├── README.md │ │ ├── db.json │ │ ├── index.js │ │ └── package.json │ ├── mime-types │ │ ├── HISTORY.md │ │ ├── LICENSE │ │ ├── README.md │ │ ├── index.js │ │ └── package.json │ ├── node-fetch │ │ ├── CHANGELOG.md │ │ ├── LICENSE.md │ │ ├── README.md │ │ ├── browser.js │ │ ├── lib │ │ │ ├── index.es.js │ │ │ ├── index.js │ │ │ └── index.mjs │ │ └── package.json │ ├── prism-media │ │ ├── LICENSE │ │ ├── README.md │ │ ├── package.json │ │ ├── src │ │ │ ├── core │ │ │ │ ├── FFmpeg.js │ │ │ │ ├── VolumeTransformer.js │ │ │ │ ├── WebmBase.js │ │ │ │ └── index.js │ │ │ ├── index.js │ │ │ ├── opus │ │ │ │ ├── OggDemuxer.js │ │ │ │ ├── Opus.js │ │ │ │ ├── WebmDemuxer.js │ │ │ │ └── index.js │ │ │ ├── util │ │ │ │ └── loader.js │ │ │ └── vorbis │ │ │ │ ├── WebmDemuxer.js │ │ │ │ └── index.js │ │ └── typings │ │ │ ├── index.d.ts │ │ │ ├── opus.d.ts │ │ │ └── vorbis.d.ts │ ├── setimmediate │ │ ├── LICENSE.txt │ │ ├── package.json │ │ └── setImmediate.js │ ├── tweetnacl │ │ ├── AUTHORS.md │ │ ├── CHANGELOG.md │ │ ├── LICENSE │ │ ├── PULL_REQUEST_TEMPLATE.md │ │ ├── README.md │ │ ├── nacl-fast.js │ │ ├── nacl-fast.min.js │ │ ├── nacl.d.ts │ │ ├── nacl.js │ │ ├── nacl.min.js │ │ └── package.json │ └── ws │ │ ├── LICENSE │ │ ├── README.md │ │ ├── browser.js │ │ ├── index.js │ │ ├── lib │ │ ├── buffer-util.js │ │ ├── constants.js │ │ ├── event-target.js │ │ ├── extension.js │ │ ├── limiter.js │ │ ├── permessage-deflate.js │ │ ├── receiver.js │ │ ├── sender.js │ │ ├── stream.js │ │ ├── validation.js │ │ ├── websocket-server.js │ │ └── websocket.js │ │ └── package.json │ ├── package.json │ ├── src │ ├── WebSocket.js │ ├── client │ │ ├── BaseClient.js │ │ ├── Client.js │ │ ├── WebhookClient.js │ │ ├── actions │ │ │ ├── Action.js │ │ │ ├── ActionsManager.js │ │ │ ├── ChannelCreate.js │ │ │ ├── ChannelDelete.js │ │ │ ├── ChannelUpdate.js │ │ │ ├── GuildBanRemove.js │ │ │ ├── GuildChannelsPositionUpdate.js │ │ │ ├── GuildDelete.js │ │ │ ├── GuildEmojiCreate.js │ │ │ ├── GuildEmojiDelete.js │ │ │ ├── GuildEmojiUpdate.js │ │ │ ├── GuildEmojisUpdate.js │ │ │ ├── GuildIntegrationsUpdate.js │ │ │ ├── GuildMemberRemove.js │ │ │ ├── GuildRoleCreate.js │ │ │ ├── GuildRoleDelete.js │ │ │ ├── GuildRoleUpdate.js │ │ │ ├── GuildRolesPositionUpdate.js │ │ │ ├── GuildUpdate.js │ │ │ ├── InviteCreate.js │ │ │ ├── InviteDelete.js │ │ │ ├── MessageCreate.js │ │ │ ├── MessageDelete.js │ │ │ ├── MessageDeleteBulk.js │ │ │ ├── MessageReactionAdd.js │ │ │ ├── MessageReactionRemove.js │ │ │ ├── MessageReactionRemoveAll.js │ │ │ ├── MessageReactionRemoveEmoji.js │ │ │ ├── MessageUpdate.js │ │ │ ├── PresenceUpdate.js │ │ │ ├── UserUpdate.js │ │ │ ├── VoiceStateUpdate.js │ │ │ └── WebhooksUpdate.js │ │ ├── voice │ │ │ ├── ClientVoiceManager.js │ │ │ ├── VoiceBroadcast.js │ │ │ ├── VoiceConnection.js │ │ │ ├── dispatcher │ │ │ │ ├── BroadcastDispatcher.js │ │ │ │ └── StreamDispatcher.js │ │ │ ├── networking │ │ │ │ ├── VoiceUDPClient.js │ │ │ │ └── VoiceWebSocket.js │ │ │ ├── player │ │ │ │ ├── AudioPlayer.js │ │ │ │ ├── BasePlayer.js │ │ │ │ └── BroadcastAudioPlayer.js │ │ │ ├── receiver │ │ │ │ ├── PacketHandler.js │ │ │ │ └── Receiver.js │ │ │ └── util │ │ │ │ ├── PlayInterface.js │ │ │ │ ├── Secretbox.js │ │ │ │ ├── Silence.js │ │ │ │ └── VolumeInterface.js │ │ └── websocket │ │ │ ├── WebSocketManager.js │ │ │ ├── WebSocketShard.js │ │ │ └── handlers │ │ │ ├── CHANNEL_CREATE.js │ │ │ ├── CHANNEL_DELETE.js │ │ │ ├── CHANNEL_PINS_UPDATE.js │ │ │ ├── CHANNEL_UPDATE.js │ │ │ ├── GUILD_BAN_ADD.js │ │ │ ├── GUILD_BAN_REMOVE.js │ │ │ ├── GUILD_CREATE.js │ │ │ ├── GUILD_DELETE.js │ │ │ ├── GUILD_EMOJIS_UPDATE.js │ │ │ ├── GUILD_INTEGRATIONS_UPDATE.js │ │ │ ├── GUILD_MEMBERS_CHUNK.js │ │ │ ├── GUILD_MEMBER_ADD.js │ │ │ ├── GUILD_MEMBER_REMOVE.js │ │ │ ├── GUILD_MEMBER_UPDATE.js │ │ │ ├── GUILD_ROLE_CREATE.js │ │ │ ├── GUILD_ROLE_DELETE.js │ │ │ ├── GUILD_ROLE_UPDATE.js │ │ │ ├── GUILD_UPDATE.js │ │ │ ├── INVITE_CREATE.js │ │ │ ├── INVITE_DELETE.js │ │ │ ├── MESSAGE_CREATE.js │ │ │ ├── MESSAGE_DELETE.js │ │ │ ├── MESSAGE_DELETE_BULK.js │ │ │ ├── MESSAGE_REACTION_ADD.js │ │ │ ├── MESSAGE_REACTION_REMOVE.js │ │ │ ├── MESSAGE_REACTION_REMOVE_ALL.js │ │ │ ├── MESSAGE_REACTION_REMOVE_EMOJI.js │ │ │ ├── MESSAGE_UPDATE.js │ │ │ ├── PRESENCE_UPDATE.js │ │ │ ├── READY.js │ │ │ ├── RESUMED.js │ │ │ ├── TYPING_START.js │ │ │ ├── USER_UPDATE.js │ │ │ ├── VOICE_SERVER_UPDATE.js │ │ │ ├── VOICE_STATE_UPDATE.js │ │ │ ├── WEBHOOKS_UPDATE.js │ │ │ └── index.js │ ├── errors │ │ ├── DJSError.js │ │ ├── Messages.js │ │ └── index.js │ ├── index.js │ ├── managers │ │ ├── BaseManager.js │ │ ├── ChannelManager.js │ │ ├── GuildChannelManager.js │ │ ├── GuildEmojiManager.js │ │ ├── GuildEmojiRoleManager.js │ │ ├── GuildManager.js │ │ ├── GuildMemberManager.js │ │ ├── GuildMemberRoleManager.js │ │ ├── MessageManager.js │ │ ├── PresenceManager.js │ │ ├── ReactionManager.js │ │ ├── ReactionUserManager.js │ │ ├── RoleManager.js │ │ ├── UserManager.js │ │ └── VoiceStateManager.js │ ├── rest │ │ ├── APIRequest.js │ │ ├── APIRouter.js │ │ ├── DiscordAPIError.js │ │ ├── HTTPError.js │ │ ├── RESTManager.js │ │ └── RequestHandler.js │ ├── sharding │ │ ├── Shard.js │ │ ├── ShardClientUtil.js │ │ └── ShardingManager.js │ ├── structures │ │ ├── APIMessage.js │ │ ├── Base.js │ │ ├── BaseGuildEmoji.js │ │ ├── CategoryChannel.js │ │ ├── Channel.js │ │ ├── ClientApplication.js │ │ ├── ClientPresence.js │ │ ├── ClientUser.js │ │ ├── DMChannel.js │ │ ├── Emoji.js │ │ ├── Guild.js │ │ ├── GuildAuditLogs.js │ │ ├── GuildChannel.js │ │ ├── GuildEmoji.js │ │ ├── GuildMember.js │ │ ├── GuildPreview.js │ │ ├── GuildPreviewEmoji.js │ │ ├── Integration.js │ │ ├── Invite.js │ │ ├── Message.js │ │ ├── MessageAttachment.js │ │ ├── MessageCollector.js │ │ ├── MessageEmbed.js │ │ ├── MessageMentions.js │ │ ├── MessageReaction.js │ │ ├── NewsChannel.js │ │ ├── PartialGroupDMChannel.js │ │ ├── PermissionOverwrites.js │ │ ├── Presence.js │ │ ├── ReactionCollector.js │ │ ├── ReactionEmoji.js │ │ ├── Role.js │ │ ├── StoreChannel.js │ │ ├── Team.js │ │ ├── TeamMember.js │ │ ├── TextChannel.js │ │ ├── User.js │ │ ├── VoiceChannel.js │ │ ├── VoiceRegion.js │ │ ├── VoiceState.js │ │ ├── Webhook.js │ │ └── interfaces │ │ │ ├── Collector.js │ │ │ └── TextBasedChannel.js │ └── util │ │ ├── ActivityFlags.js │ │ ├── BitField.js │ │ ├── Collection.js │ │ ├── Constants.js │ │ ├── DataResolver.js │ │ ├── Intents.js │ │ ├── LimitedCollection.js │ │ ├── MessageFlags.js │ │ ├── Permissions.js │ │ ├── Snowflake.js │ │ ├── Speaking.js │ │ ├── Structures.js │ │ ├── SystemChannelFlags.js │ │ ├── UserFlags.js │ │ └── Util.js │ ├── typings │ ├── index.d.ts │ └── index.ts │ └── webpack │ ├── discord.js │ ├── discord.js.LICENSE.txt │ ├── discord.min.js │ └── discord.min.js.LICENSE.txt ├── package-lock.json ├── package.json ├── savage.bat ├── savage.js └── standard_11.gif /Ayarlar/Ayarlar.json: -------------------------------------------------------------------------------- 1 | { 2 | "Token": "", 3 | "Prefix": "!", 4 | "Özel_Sunucu": true, 5 | "Debug": false 6 | } 7 | -------------------------------------------------------------------------------- /Events/commandHandler.js: -------------------------------------------------------------------------------- 1 | const Discord = require("discord.js"); 2 | 3 | /** 4 | * @param {Discord.Message} message 5 | */ 6 | exports.execute = async (message) => { 7 | if(message.author.bot || !message.content.startsWith(global.Ayarlar.Prefix)) return; 8 | 9 | let args = message.content.split(" "); 10 | let commandName = args[0].substring(global.Ayarlar.Prefix.length); 11 | args = args.splice(1); 12 | let command = global.Commands.get(commandName); 13 | if(!command || !command.conf.enabled || (command.conf.guildOnly && message.channel.type != "text")) return; 14 | if(command) 15 | command.run(message.client, message, args); 16 | }; 17 | 18 | exports.conf = { 19 | event: "message" 20 | } -------------------------------------------------------------------------------- /Events/ready.js: -------------------------------------------------------------------------------- 1 | exports.execute = () => { 2 | console.log("Bot hazır!"); 3 | }; 4 | 5 | exports.conf = { 6 | event: "ready" 7 | 8 | } -------------------------------------------------------------------------------- /Komutlar/Rich.js: -------------------------------------------------------------------------------- 1 | const Discord = require("discord.js"); 2 | 3 | exports.run = async (client, message, args, ayar, emoji) => { 4 | let boosterrol = "" //boost rolü idsi 5 | let kanalid = "" //kullana bileceginiz kanal id (misal commands - bot komutlar) 6 | let renk = "ff66f0" //renk kafaniza göre ayarlayin suanki pembe 7 | let tag = "" //tag sembolü varsa yazin cünkü isminin basina ekleyek olan sey yoksa bos birakin 8 | 9 | 10 | let onay = "" //onay emojisi id tepki icin örnek <:emojiismi:id> 11 | let iptal = "" //iptal emojisi id tepki icin <:emojiismi:id> 12 | if(!message.member.roles.cache.has(boosterrol)) return message.channel.send(`**Bu komutu kullanabilmek için Sunucuya Takviye yapmalısın!** ${iptal}`) 13 | if(message.channel.id !== kanalid) return message.channel.send(new Discord.MessageEmbed() 14 | .setAuthor(message.author.tag, message.author.avatarURL({dynamic: true})) 15 | .setColor(renk) 16 | .setDescription(`**\`•\` <@${message.author.id}>, bu komutu sadece <#${kanalid}> kanalin da kullanabilirsin.**`) 17 | .setTimestamp() 18 | .setFooter(`© Savage Boost System`, "https://cdn.discordapp.com/emojis/785950806384836619.gif?v=1%22")) 19 | 20 | let boosternick = args.slice(0).join(' ') 21 | if(!boosternick) return message.reply("Yeni adını girmelisin.").then( a=> a.react(iptal)) 22 | message.member.setNickname(`${tag} ${boosternick}`) 23 | const Savage = new Discord.MessageEmbed() 24 | .setAuthor(message.author.tag, message.author.avatarURL({dynamic: true})) 25 | .setTimestamp() 26 | .setColor(renk) 27 | .setDescription(`**\`•\` Takma adın başarıyla \`${boosternick}\` olarak değiştirildi!**`) // tagi göstermesse embedde ${boosternick}'in basina ${tag} ekleyin yani; ${tag} ${boosternick} 28 | .setFooter(`© Savage Boost System`, "https://cdn.discordapp.com/emojis/785950806384836619.gif?v=1%22") 29 | message.channel.send(Savage) 30 | message.react(onay); 31 | } 32 | 33 | exports.conf = { 34 | name: "zengin", 35 | aliases: ["booster", "boosternick", "rich", "me"], 36 | enabled: true, 37 | guildOnly: true 38 | }; 39 | 40 | exports.help = { 41 | name: 'zengin', 42 | description: 'Boost basanlar isim sag tiksiz degise bilcek.', 43 | usage: 'rich ', 44 | kategori: 'kullanıcı' 45 | }; 46 | 47 | //SAVAGE SIZI COK SEVIYO :3 48 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 Savage 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Savage Takviye Sistemi Alt Yapısı 2 | 3 | Bu altyapı sadece Discord Takviye (Boost) için yapılmıştır, dilediğiniz gibi kurup kullana bilirsiniz benden habersiz paylaşımda sanal telif işlemi uygulanacaktır. 4 | 5 | ## Kurulum 6 | 7 | Eğer direk projeyi kurucaksanız tek yapmanız gereken savage.js ve komutlardaki Rich.js dosyasını doldurmak. 8 | 9 | ```js 10 | savage.js - Rich.js 11 | ``` 12 | ## Sıkça Sorulabilicek Sorular 13 | 14 | 15 | ### Kod Dosyalarını Nasıl Kurucam? 16 | 17 | Tek yapmanız gereken dosyalardaki ID kısımlarını doldurmak, savage.js'ye atılıcak bir kod yoktur, ya da hazır proje olarak kullanıp sadece savage.js'yi ve Rich.js'yi dolurabilirsiniz. 18 | 19 | ### Sana bir sorum vardı? 20 | 21 | Savage#8888 (228971558972948491) Discord hesabıma ulaşabilirsiniz, eğer ulaşamazsanız [discord.gg/serendia](https://discord.gg/serendia)'ya sorun, yol göstereceklerdir. 22 | 23 | ### Bir hata buldum? 24 | 25 | Bana ulaşın, elimden geldiğince hızlı çözerim. 26 | 27 | ## Serendia Ailesine ve ordan bu altyapıyı isteyenlere Sevgilerle <3 28 | ![Serendia](standard_11.gif) 29 | 30 | -------------------------------------------------------------------------------- /boot.js: -------------------------------------------------------------------------------- 1 | const Discord = require("discord.js"); 2 | const fs = require("fs"); 3 | const Ayarlar = global.Ayarlar = require("./Ayarlar/Ayarlar.json"); 4 | 5 | console.log("Bot başlatılıyor..."); 6 | let _client = new Discord.Client(); 7 | if (Ayarlar.Özel_Sunucu === true) { 8 | _client = new Discord.Client({ 9 | fetchAllMembers: true 10 | }); 11 | } 12 | const client = global.client = _client; 13 | 14 | const Commands = global.Commands = new Map(); 15 | console.log("--------------------------------"); 16 | console.log("Komutlar yükleniyor..."); 17 | fs.readdirSync("./Komutlar", { encoding: "utf-8" }).filter(file => file.endsWith(".js")).forEach(file => { 18 | let prop = require(`./Komutlar/${file}`); 19 | if (prop.conf.name == undefined || prop.run == undefined) return console.error(`[KOMUT] ${file} yüklenemedi.`); 20 | Commands.set(prop.conf.name, prop); 21 | if (prop.conf.aliases && prop.conf.aliases.length > 0) { 22 | prop.conf.aliases.forEach(aliase => Commands.set(aliase, prop)); 23 | } 24 | if (prop.onLoad != undefined && typeof (prop.onLoad) == "function") prop.onLoad(client); 25 | console.log(`[KOMUT] ${file} için toplam ${prop.conf.aliases.length} destekçi yüklendi ve kendisi yüklendi.`); 26 | }); 27 | console.log("--------------------------------"); 28 | console.log("Etkinlikler yükleniyor..."); 29 | fs.readdirSync("./Events", { encoding: "utf-8" }).filter(file => file.endsWith(".js")).forEach(file => { 30 | let prop = require(`./Events/${file}`); 31 | client.on(prop.conf.event, prop.execute); 32 | console.log(`[ETKINLIK] ${file} yüklendi.`); 33 | }); 34 | 35 | console.log("--------------------------------"); 36 | console.log("| BOT HAZIRLANDI VE ANA DOSYA ÇALIŞTIRILIYOR |"); 37 | 38 | require("./savage.js"); 39 | -------------------------------------------------------------------------------- /node_modules/@types/node/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) Microsoft Corporation. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE 22 | -------------------------------------------------------------------------------- /node_modules/@types/node/base.d.ts: -------------------------------------------------------------------------------- 1 | // NOTE: These definitions support NodeJS and TypeScript 3.7. 2 | 3 | // NOTE: TypeScript version-specific augmentations can be found in the following paths: 4 | // - ~/base.d.ts - Shared definitions common to all TypeScript versions 5 | // - ~/index.d.ts - Definitions specific to TypeScript 2.1 6 | // - ~/ts3.7/base.d.ts - Definitions specific to TypeScript 3.7 7 | // - ~/ts3.7/index.d.ts - Definitions specific to TypeScript 3.7 with assert pulled in 8 | 9 | // Reference required types from the default lib: 10 | /// 11 | /// 12 | /// 13 | /// 14 | 15 | // Base definitions for all NodeJS modules that are not specific to any version of TypeScript: 16 | /// 17 | 18 | // TypeScript 3.7-specific augmentations: 19 | /// 20 | -------------------------------------------------------------------------------- /node_modules/@types/node/buffer.d.ts: -------------------------------------------------------------------------------- 1 | declare module "buffer" { 2 | export const INSPECT_MAX_BYTES: number; 3 | export const kMaxLength: number; 4 | export const kStringMaxLength: number; 5 | export const constants: { 6 | MAX_LENGTH: number; 7 | MAX_STRING_LENGTH: number; 8 | }; 9 | const BuffType: typeof Buffer; 10 | 11 | export type TranscodeEncoding = "ascii" | "utf8" | "utf16le" | "ucs2" | "latin1" | "binary"; 12 | 13 | export function transcode(source: Uint8Array, fromEnc: TranscodeEncoding, toEnc: TranscodeEncoding): Buffer; 14 | 15 | export const SlowBuffer: { 16 | /** @deprecated since v6.0.0, use `Buffer.allocUnsafeSlow()` */ 17 | new(size: number): Buffer; 18 | prototype: Buffer; 19 | }; 20 | 21 | export { BuffType as Buffer }; 22 | } 23 | -------------------------------------------------------------------------------- /node_modules/@types/node/constants.d.ts: -------------------------------------------------------------------------------- 1 | /** @deprecated since v6.3.0 - use constants property exposed by the relevant module instead. */ 2 | declare module "constants" { 3 | import { constants as osConstants, SignalConstants } from 'os'; 4 | import { constants as cryptoConstants } from 'crypto'; 5 | import { constants as fsConstants } from 'fs'; 6 | const exp: typeof osConstants.errno & typeof osConstants.priority & SignalConstants & typeof cryptoConstants & typeof fsConstants; 7 | export = exp; 8 | } 9 | -------------------------------------------------------------------------------- /node_modules/@types/node/domain.d.ts: -------------------------------------------------------------------------------- 1 | declare module "domain" { 2 | import { EventEmitter } from "events"; 3 | 4 | global { 5 | namespace NodeJS { 6 | interface Domain extends EventEmitter { 7 | run(fn: (...args: any[]) => T, ...args: any[]): T; 8 | add(emitter: EventEmitter | Timer): void; 9 | remove(emitter: EventEmitter | Timer): void; 10 | bind(cb: T): T; 11 | intercept(cb: T): T; 12 | } 13 | } 14 | } 15 | 16 | interface Domain extends NodeJS.Domain {} 17 | class Domain extends EventEmitter { 18 | members: Array; 19 | enter(): void; 20 | exit(): void; 21 | } 22 | 23 | function create(): Domain; 24 | } 25 | -------------------------------------------------------------------------------- /node_modules/@types/node/globals.global.d.ts: -------------------------------------------------------------------------------- 1 | declare var global: NodeJS.Global & typeof globalThis; 2 | -------------------------------------------------------------------------------- /node_modules/@types/node/https.d.ts: -------------------------------------------------------------------------------- 1 | declare module "https" { 2 | import * as tls from "tls"; 3 | import * as events from "events"; 4 | import * as http from "http"; 5 | import { URL } from "url"; 6 | 7 | type ServerOptions = tls.SecureContextOptions & tls.TlsOptions & http.ServerOptions; 8 | 9 | type RequestOptions = http.RequestOptions & tls.SecureContextOptions & { 10 | rejectUnauthorized?: boolean; // Defaults to true 11 | servername?: string; // SNI TLS Extension 12 | }; 13 | 14 | interface AgentOptions extends http.AgentOptions, tls.ConnectionOptions { 15 | rejectUnauthorized?: boolean; 16 | maxCachedSessions?: number; 17 | } 18 | 19 | class Agent extends http.Agent { 20 | constructor(options?: AgentOptions); 21 | options: AgentOptions; 22 | } 23 | 24 | interface Server extends http.HttpBase {} 25 | class Server extends tls.Server { 26 | constructor(requestListener?: http.RequestListener); 27 | constructor(options: ServerOptions, requestListener?: http.RequestListener); 28 | } 29 | 30 | function createServer(requestListener?: http.RequestListener): Server; 31 | function createServer(options: ServerOptions, requestListener?: http.RequestListener): Server; 32 | function request(options: RequestOptions | string | URL, callback?: (res: http.IncomingMessage) => void): http.ClientRequest; 33 | function request(url: string | URL, options: RequestOptions, callback?: (res: http.IncomingMessage) => void): http.ClientRequest; 34 | function get(options: RequestOptions | string | URL, callback?: (res: http.IncomingMessage) => void): http.ClientRequest; 35 | function get(url: string | URL, options: RequestOptions, callback?: (res: http.IncomingMessage) => void): http.ClientRequest; 36 | let globalAgent: Agent; 37 | } 38 | -------------------------------------------------------------------------------- /node_modules/@types/node/module.d.ts: -------------------------------------------------------------------------------- 1 | declare module "module" { 2 | import { URL } from "url"; 3 | namespace Module { 4 | /** 5 | * Updates all the live bindings for builtin ES Modules to match the properties of the CommonJS exports. 6 | * It does not add or remove exported names from the ES Modules. 7 | */ 8 | function syncBuiltinESMExports(): void; 9 | 10 | function findSourceMap(path: string, error?: Error): SourceMap; 11 | interface SourceMapPayload { 12 | file: string; 13 | version: number; 14 | sources: string[]; 15 | sourcesContent: string[]; 16 | names: string[]; 17 | mappings: string; 18 | sourceRoot: string; 19 | } 20 | 21 | interface SourceMapping { 22 | generatedLine: number; 23 | generatedColumn: number; 24 | originalSource: string; 25 | originalLine: number; 26 | originalColumn: number; 27 | } 28 | 29 | class SourceMap { 30 | readonly payload: SourceMapPayload; 31 | constructor(payload: SourceMapPayload); 32 | findEntry(line: number, column: number): SourceMapping; 33 | } 34 | } 35 | interface Module extends NodeModule {} 36 | class Module { 37 | static runMain(): void; 38 | static wrap(code: string): string; 39 | 40 | /** 41 | * @deprecated Deprecated since: v12.2.0. Please use createRequire() instead. 42 | */ 43 | static createRequireFromPath(path: string): NodeRequire; 44 | static createRequire(path: string | URL): NodeRequire; 45 | static builtinModules: string[]; 46 | 47 | static Module: typeof Module; 48 | 49 | constructor(id: string, parent?: Module); 50 | } 51 | export = Module; 52 | } 53 | -------------------------------------------------------------------------------- /node_modules/@types/node/querystring.d.ts: -------------------------------------------------------------------------------- 1 | declare module "querystring" { 2 | interface StringifyOptions { 3 | encodeURIComponent?: (str: string) => string; 4 | } 5 | 6 | interface ParseOptions { 7 | maxKeys?: number; 8 | decodeURIComponent?: (str: string) => string; 9 | } 10 | 11 | interface ParsedUrlQuery extends NodeJS.Dict { } 12 | 13 | interface ParsedUrlQueryInput extends NodeJS.Dict | ReadonlyArray | ReadonlyArray | null> { 14 | } 15 | 16 | function stringify(obj?: ParsedUrlQueryInput, sep?: string, eq?: string, options?: StringifyOptions): string; 17 | function parse(str: string, sep?: string, eq?: string, options?: ParseOptions): ParsedUrlQuery; 18 | /** 19 | * The querystring.encode() function is an alias for querystring.stringify(). 20 | */ 21 | const encode: typeof stringify; 22 | /** 23 | * The querystring.decode() function is an alias for querystring.parse(). 24 | */ 25 | const decode: typeof parse; 26 | function escape(str: string): string; 27 | function unescape(str: string): string; 28 | } 29 | -------------------------------------------------------------------------------- /node_modules/@types/node/string_decoder.d.ts: -------------------------------------------------------------------------------- 1 | declare module "string_decoder" { 2 | class StringDecoder { 3 | constructor(encoding?: BufferEncoding); 4 | write(buffer: Buffer): string; 5 | end(buffer?: Buffer): string; 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /node_modules/@types/node/timers.d.ts: -------------------------------------------------------------------------------- 1 | declare module "timers" { 2 | function setTimeout(callback: (...args: any[]) => void, ms: number, ...args: any[]): NodeJS.Timeout; 3 | namespace setTimeout { 4 | function __promisify__(ms: number): Promise; 5 | function __promisify__(ms: number, value: T): Promise; 6 | } 7 | function clearTimeout(timeoutId: NodeJS.Timeout): void; 8 | function setInterval(callback: (...args: any[]) => void, ms: number, ...args: any[]): NodeJS.Timeout; 9 | function clearInterval(intervalId: NodeJS.Timeout): void; 10 | function setImmediate(callback: (...args: any[]) => void, ...args: any[]): NodeJS.Immediate; 11 | namespace setImmediate { 12 | function __promisify__(): Promise; 13 | function __promisify__(value: T): Promise; 14 | } 15 | function clearImmediate(immediateId: NodeJS.Immediate): void; 16 | } 17 | -------------------------------------------------------------------------------- /node_modules/@types/node/trace_events.d.ts: -------------------------------------------------------------------------------- 1 | declare module "trace_events" { 2 | /** 3 | * The `Tracing` object is used to enable or disable tracing for sets of 4 | * categories. Instances are created using the 5 | * `trace_events.createTracing()` method. 6 | * 7 | * When created, the `Tracing` object is disabled. Calling the 8 | * `tracing.enable()` method adds the categories to the set of enabled trace 9 | * event categories. Calling `tracing.disable()` will remove the categories 10 | * from the set of enabled trace event categories. 11 | */ 12 | interface Tracing { 13 | /** 14 | * A comma-separated list of the trace event categories covered by this 15 | * `Tracing` object. 16 | */ 17 | readonly categories: string; 18 | 19 | /** 20 | * Disables this `Tracing` object. 21 | * 22 | * Only trace event categories _not_ covered by other enabled `Tracing` 23 | * objects and _not_ specified by the `--trace-event-categories` flag 24 | * will be disabled. 25 | */ 26 | disable(): void; 27 | 28 | /** 29 | * Enables this `Tracing` object for the set of categories covered by 30 | * the `Tracing` object. 31 | */ 32 | enable(): void; 33 | 34 | /** 35 | * `true` only if the `Tracing` object has been enabled. 36 | */ 37 | readonly enabled: boolean; 38 | } 39 | 40 | interface CreateTracingOptions { 41 | /** 42 | * An array of trace category names. Values included in the array are 43 | * coerced to a string when possible. An error will be thrown if the 44 | * value cannot be coerced. 45 | */ 46 | categories: string[]; 47 | } 48 | 49 | /** 50 | * Creates and returns a Tracing object for the given set of categories. 51 | */ 52 | function createTracing(options: CreateTracingOptions): Tracing; 53 | 54 | /** 55 | * Returns a comma-separated list of all currently-enabled trace event 56 | * categories. The current set of enabled trace event categories is 57 | * determined by the union of all currently-enabled `Tracing` objects and 58 | * any categories enabled using the `--trace-event-categories` flag. 59 | */ 60 | function getEnabledCategories(): string | undefined; 61 | } 62 | -------------------------------------------------------------------------------- /node_modules/@types/node/ts3.4/base.d.ts: -------------------------------------------------------------------------------- 1 | // NOTE: These definitions support NodeJS and TypeScript 3.2 - 3.4. 2 | 3 | // NOTE: TypeScript version-specific augmentations can be found in the following paths: 4 | // - ~/base.d.ts - Shared definitions common to all TypeScript versions 5 | // - ~/index.d.ts - Definitions specific to TypeScript 2.1 6 | // - ~/ts3.2/base.d.ts - Definitions specific to TypeScript 3.2 7 | // - ~/ts3.2/index.d.ts - Definitions specific to TypeScript 3.2 with global and assert pulled in 8 | 9 | // Reference required types from the default lib: 10 | /// 11 | /// 12 | /// 13 | /// 14 | 15 | // Base definitions for all NodeJS modules that are not specific to any version of TypeScript: 16 | 17 | /// 18 | /// 19 | /// 20 | /// 21 | /// 22 | /// 23 | /// 24 | /// 25 | /// 26 | /// 27 | /// 28 | /// 29 | /// 30 | /// 31 | /// 32 | /// 33 | /// 34 | /// 35 | /// 36 | /// 37 | /// 38 | /// 39 | /// 40 | /// 41 | /// 42 | /// 43 | /// 44 | /// 45 | /// 46 | /// 47 | /// 48 | /// 49 | /// 50 | /// 51 | /// 52 | /// 53 | /// 54 | /// 55 | /// 56 | /// 57 | -------------------------------------------------------------------------------- /node_modules/@types/node/ts3.4/globals.global.d.ts: -------------------------------------------------------------------------------- 1 | declare var global: NodeJS.Global; 2 | -------------------------------------------------------------------------------- /node_modules/@types/node/ts3.4/index.d.ts: -------------------------------------------------------------------------------- 1 | // NOTE: These definitions support NodeJS and TypeScript 3.2 - 3.4. 2 | // This is required to enable globalThis support for global in ts3.5 without causing errors 3 | // This is required to enable typing assert in ts3.7 without causing errors 4 | // Typically type modifiations should be made in base.d.ts instead of here 5 | 6 | /// 7 | /// 8 | /// 9 | -------------------------------------------------------------------------------- /node_modules/@types/node/ts3.6/base.d.ts: -------------------------------------------------------------------------------- 1 | // NOTE: These definitions support NodeJS and TypeScript 3.5. 2 | 3 | // NOTE: TypeScript version-specific augmentations can be found in the following paths: 4 | // - ~/base.d.ts - Shared definitions common to all TypeScript versions 5 | // - ~/index.d.ts - Definitions specific to TypeScript 2.1 6 | // - ~/ts3.5/base.d.ts - Definitions specific to TypeScript 3.5 7 | // - ~/ts3.5/index.d.ts - Definitions specific to TypeScript 3.5 with assert pulled in 8 | 9 | // Reference required types from the default lib: 10 | /// 11 | /// 12 | /// 13 | /// 14 | 15 | // Base definitions for all NodeJS modules that are not specific to any version of TypeScript: 16 | /// 17 | 18 | // TypeScript 3.5-specific augmentations: 19 | /// 20 | 21 | // TypeScript 3.5-specific augmentations: 22 | /// 23 | -------------------------------------------------------------------------------- /node_modules/@types/node/ts3.6/index.d.ts: -------------------------------------------------------------------------------- 1 | // NOTE: These definitions support NodeJS and TypeScript 3.5 - 3.6. 2 | // This is required to enable typing assert in ts3.7 without causing errors 3 | // Typically type modifications should be made in base.d.ts instead of here 4 | 5 | /// 6 | 7 | /// 8 | -------------------------------------------------------------------------------- /node_modules/@types/ws/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) Microsoft Corporation. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE 22 | -------------------------------------------------------------------------------- /node_modules/@types/ws/README.md: -------------------------------------------------------------------------------- 1 | # Installation 2 | > `npm install --save @types/ws` 3 | 4 | # Summary 5 | This package contains type definitions for ws (https://github.com/websockets/ws). 6 | 7 | # Details 8 | Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/ws. 9 | 10 | ### Additional Details 11 | * Last updated: Mon, 09 Nov 2020 23:49:39 GMT 12 | * Dependencies: [@types/node](https://npmjs.com/package/@types/node) 13 | * Global values: none 14 | 15 | # Credits 16 | These definitions were written by [Paul Loyd](https://github.com/loyd), [Matt Silverlock](https://github.com/elithrar), [Margus Lamp](https://github.com/mlamp), [Philippe D'Alva](https://github.com/TitaneBoy), [reduckted](https://github.com/reduckted), [teidesu](https://github.com/teidesu), and [Bartosz Wojtkowiak](https://github.com/wojtkowiak). 17 | -------------------------------------------------------------------------------- /node_modules/@types/ws/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "_from": "@types/ws@^7.2.1", 3 | "_id": "@types/ws@7.4.0", 4 | "_inBundle": false, 5 | "_integrity": "sha512-Y29uQ3Uy+58bZrFLhX36hcI3Np37nqWE7ky5tjiDoy1GDZnIwVxS0CgF+s+1bXMzjKBFy+fqaRfb708iNzdinw==", 6 | "_location": "/@types/ws", 7 | "_phantomChildren": {}, 8 | "_requested": { 9 | "type": "range", 10 | "registry": true, 11 | "raw": "@types/ws@^7.2.1", 12 | "name": "@types/ws", 13 | "escapedName": "@types%2fws", 14 | "scope": "@types", 15 | "rawSpec": "^7.2.1", 16 | "saveSpec": null, 17 | "fetchSpec": "^7.2.1" 18 | }, 19 | "_requiredBy": [ 20 | "/discord-logs" 21 | ], 22 | "_resolved": "https://registry.npmjs.org/@types/ws/-/ws-7.4.0.tgz", 23 | "_shasum": "499690ea08736e05a8186113dac37769ab251a0e", 24 | "_spec": "@types/ws@^7.2.1", 25 | "_where": "C:\\Users\\Administrator\\Desktop\\North Gate Booster\\node_modules\\discord-logs", 26 | "bugs": { 27 | "url": "https://github.com/DefinitelyTyped/DefinitelyTyped/issues" 28 | }, 29 | "bundleDependencies": false, 30 | "contributors": [ 31 | { 32 | "name": "Paul Loyd", 33 | "url": "https://github.com/loyd" 34 | }, 35 | { 36 | "name": "Matt Silverlock", 37 | "url": "https://github.com/elithrar" 38 | }, 39 | { 40 | "name": "Margus Lamp", 41 | "url": "https://github.com/mlamp" 42 | }, 43 | { 44 | "name": "Philippe D'Alva", 45 | "url": "https://github.com/TitaneBoy" 46 | }, 47 | { 48 | "name": "reduckted", 49 | "url": "https://github.com/reduckted" 50 | }, 51 | { 52 | "name": "teidesu", 53 | "url": "https://github.com/teidesu" 54 | }, 55 | { 56 | "name": "Bartosz Wojtkowiak", 57 | "url": "https://github.com/wojtkowiak" 58 | } 59 | ], 60 | "dependencies": { 61 | "@types/node": "*" 62 | }, 63 | "deprecated": false, 64 | "description": "TypeScript definitions for ws", 65 | "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped#readme", 66 | "license": "MIT", 67 | "main": "", 68 | "name": "@types/ws", 69 | "repository": { 70 | "type": "git", 71 | "url": "git+https://github.com/DefinitelyTyped/DefinitelyTyped.git", 72 | "directory": "types/ws" 73 | }, 74 | "scripts": {}, 75 | "typeScriptVersion": "3.2", 76 | "types": "index.d.ts", 77 | "typesPublisherContentHash": "77b3e10cf373ea323f596b45785b79dd2b23f671bdbc08a581245f57a083fd1b", 78 | "version": "7.4.0" 79 | } 80 | -------------------------------------------------------------------------------- /node_modules/discord-logs/README.md: -------------------------------------------------------------------------------- 1 | # Discord Logs 2 | 3 | [![downloadsBadge](https://img.shields.io/npm/dt/discord-logs?style=for-the-badge)](https://npmjs.com/discord-logs) 4 | [![versionBadge](https://img.shields.io/npm/v/discord-logs?style=for-the-badge)](https://npmjs.com/discord-logs) 5 | 6 | Discord Logs is a powerful package which add many useful events to your Discord.js client! 7 | 8 | **Warning**: This package uses recent Discord.js features and only works on v12 or higher (`npm install discord.js`). 9 | 10 | ```js 11 | const Discord = require('discord.js'); 12 | const client = new Discord.Client(); 13 | const logs = require('discord-logs'); 14 | logs(client); 15 | 16 | // Access to new events, like guildMemberBoost! 17 | client.on('guildMemberBoost', (member) => { 18 | console.log(`${member.user.tag} just boosted ${member.guild.name}!`); 19 | }); 20 | 21 | client.login('YOUR_DISCORD_BOT_TOKEN'); 22 | ``` 23 | 24 | ## [Click here to see the list of all the handled events!](https://discord-logs.js.org) 25 | -------------------------------------------------------------------------------- /node_modules/discord-logs/lib/handlers/guildChannel.d.ts: -------------------------------------------------------------------------------- 1 | import { Channel, Client } from 'discord.js'; 2 | /** 3 | * @handler Channel Events 4 | * @related channelUpdate 5 | */ 6 | export declare function handleChannelUpdateEvent(client: Client, oldChannel: Channel, newChannel: Channel): Promise; 7 | -------------------------------------------------------------------------------- /node_modules/discord-logs/lib/handlers/guildMemberUpdate.d.ts: -------------------------------------------------------------------------------- 1 | import { Client, GuildMember, PartialGuildMember } from 'discord.js'; 2 | /** 3 | * @handler Guild Member Events 4 | * @related guildMemberUpdate 5 | */ 6 | export declare function handleGuildMemberUpdateEvent(client: Client, oldMember: GuildMember | PartialGuildMember, newMember: GuildMember): Promise; 7 | -------------------------------------------------------------------------------- /node_modules/discord-logs/lib/handlers/guildUpdate.d.ts: -------------------------------------------------------------------------------- 1 | import { Client, Guild } from 'discord.js'; 2 | /** 3 | * @handler Guild Events 4 | * @related guildUpdate 5 | */ 6 | export declare function handleGuildUpdateEvent(client: Client, oldGuild: Guild, newGuild: Guild): Promise; 7 | -------------------------------------------------------------------------------- /node_modules/discord-logs/lib/handlers/index.d.ts: -------------------------------------------------------------------------------- 1 | export * from './guildMemberUpdate'; 2 | export * from './guildUpdate'; 3 | export * from './presenceUpdate'; 4 | export * from './roleUpdate'; 5 | export * from './userUpdate'; 6 | export * from './voiceStateUpdate'; 7 | export * from './messageUpdate'; 8 | export * from './guildChannel'; 9 | -------------------------------------------------------------------------------- /node_modules/discord-logs/lib/handlers/index.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { 3 | if (k2 === undefined) k2 = k; 4 | Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); 5 | }) : (function(o, m, k, k2) { 6 | if (k2 === undefined) k2 = k; 7 | o[k2] = m[k]; 8 | })); 9 | var __exportStar = (this && this.__exportStar) || function(m, exports) { 10 | for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); 11 | }; 12 | Object.defineProperty(exports, "__esModule", { value: true }); 13 | __exportStar(require("./guildMemberUpdate"), exports); 14 | __exportStar(require("./guildUpdate"), exports); 15 | __exportStar(require("./presenceUpdate"), exports); 16 | __exportStar(require("./roleUpdate"), exports); 17 | __exportStar(require("./userUpdate"), exports); 18 | __exportStar(require("./voiceStateUpdate"), exports); 19 | __exportStar(require("./messageUpdate"), exports); 20 | __exportStar(require("./guildChannel"), exports); 21 | -------------------------------------------------------------------------------- /node_modules/discord-logs/lib/handlers/messageUpdate.d.ts: -------------------------------------------------------------------------------- 1 | import { Client, Message, PartialMessage } from 'discord.js'; 2 | /** 3 | * @handler Message Events 4 | * @related messageUpdate 5 | */ 6 | export declare function handleMessageUpdateEvent(client: Client, oldMessage: Message | PartialMessage, newMessage: Message | PartialMessage): Promise; 7 | -------------------------------------------------------------------------------- /node_modules/discord-logs/lib/handlers/presenceUpdate.d.ts: -------------------------------------------------------------------------------- 1 | import { Client, Presence } from 'discord.js'; 2 | /** 3 | * @handler Presence Events 4 | * @related presenceUpdate 5 | */ 6 | export declare function handlePresenceUpdateEvent(client: Client, oldPresence: Presence | null | undefined, newPresence: Presence): Promise; 7 | -------------------------------------------------------------------------------- /node_modules/discord-logs/lib/handlers/roleUpdate.d.ts: -------------------------------------------------------------------------------- 1 | import { Client, Role } from 'discord.js'; 2 | /** 3 | * @handler Role Events 4 | * @related roleUpdate 5 | */ 6 | export declare function handleRoleUpdateEvent(client: Client, oldRole: Role, newRole: Role): Promise; 7 | -------------------------------------------------------------------------------- /node_modules/discord-logs/lib/handlers/userUpdate.d.ts: -------------------------------------------------------------------------------- 1 | import { Client, PartialUser, User } from 'discord.js'; 2 | /** 3 | * @handler User Events 4 | * @related userUpdate 5 | */ 6 | export declare function handleUserUpdateEvent(client: Client, oldUser: User | PartialUser, newUser: User): Promise; 7 | -------------------------------------------------------------------------------- /node_modules/discord-logs/lib/handlers/voiceStateUpdate.d.ts: -------------------------------------------------------------------------------- 1 | import { Client, VoiceState } from 'discord.js'; 2 | /** 3 | * @handler Voice Events 4 | * @related voiceStateUpdate 5 | */ 6 | export declare function handleVoiceStateUpdateEvent(client: Client, oldState: VoiceState, newState: VoiceState): Promise; 7 | -------------------------------------------------------------------------------- /node_modules/discord-logs/lib/index.d.ts: -------------------------------------------------------------------------------- 1 | import { Client } from 'discord.js'; 2 | declare const _default: (client: Client) => Promise; 3 | export = _default; 4 | -------------------------------------------------------------------------------- /node_modules/discord-logs/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "_from": "discord-logs", 3 | "_id": "discord-logs@1.8.2", 4 | "_inBundle": false, 5 | "_integrity": "sha512-G6lnC3LTNJBUmUrkW4kH3AHnHSC9k0Cmuzo0ndOToJR54acMVt3k7JftTpEeUbhcNIpn6Y5RjuHQBmLejg1vVA==", 6 | "_location": "/discord-logs", 7 | "_phantomChildren": {}, 8 | "_requested": { 9 | "type": "tag", 10 | "registry": true, 11 | "raw": "discord-logs", 12 | "name": "discord-logs", 13 | "escapedName": "discord-logs", 14 | "rawSpec": "", 15 | "saveSpec": null, 16 | "fetchSpec": "latest" 17 | }, 18 | "_requiredBy": [ 19 | "#USER", 20 | "/" 21 | ], 22 | "_resolved": "https://registry.npmjs.org/discord-logs/-/discord-logs-1.8.2.tgz", 23 | "_shasum": "5860b02df6441b7aa7e926a9730558a0c161fdac", 24 | "_spec": "discord-logs", 25 | "_where": "C:\\Users\\Administrator\\Desktop\\North Gate Booster", 26 | "author": { 27 | "name": "Androz2091" 28 | }, 29 | "bugs": { 30 | "url": "https://github.com/Androz2091/discord-logs/issues" 31 | }, 32 | "bundleDependencies": false, 33 | "dependencies": { 34 | "@types/node": "^14.0.1", 35 | "@types/ws": "^7.2.1" 36 | }, 37 | "deprecated": false, 38 | "description": "Add many useful events to your Discord.js client!", 39 | "devDependencies": { 40 | "discord.js": "^12.4.0", 41 | "dotenv": "^8.2.0", 42 | "parse-comments": "^1.0.0", 43 | "prettier": "^2.0.4", 44 | "tslint": "^6.0.0", 45 | "tslint-config-prettier": "^1.18.0", 46 | "typescript": "^4.1.3" 47 | }, 48 | "files": [ 49 | "lib/**/*" 50 | ], 51 | "homepage": "https://github.com/Androz2091/discord-logs#readme", 52 | "keywords": [ 53 | "avdanced", 54 | "logs", 55 | "bot", 56 | "framework", 57 | "discord", 58 | "audit-logs" 59 | ], 60 | "license": "ISC", 61 | "main": "lib/index.js", 62 | "name": "discord-logs", 63 | "repository": { 64 | "type": "git", 65 | "url": "git+https://github.com/Androz2091/discord-logs.git" 66 | }, 67 | "scripts": { 68 | "build": "tsc", 69 | "format": "prettier --write \"handlers/**/*.ts\" index.ts scripts/**/*.js docs/**/*.html", 70 | "generate-docs": "node scripts/generate-docs.js", 71 | "generate-test": "node scripts/generate-test.js", 72 | "lint": "tslint -p tsconfig.json", 73 | "prepare": "npm run build", 74 | "test": "node tests/test.js" 75 | }, 76 | "version": "1.8.2" 77 | } 78 | -------------------------------------------------------------------------------- /node_modules/discord.js/.tern-project: -------------------------------------------------------------------------------- 1 | { 2 | "ecmaVersion": 7, 3 | "libs": [], 4 | "loadEagerly": ["./src/*.js"], 5 | "dontLoad": ["node_modules/**"], 6 | "plugins": { 7 | "es_modules": {}, 8 | "node": {}, 9 | "doc_comment": { 10 | "fullDocs": true, 11 | "strong": true 12 | }, 13 | "webpack": { 14 | "configPath": "./webpack.config.js" 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /node_modules/discord.js/esm/discord.mjs: -------------------------------------------------------------------------------- 1 | import Discord from '../src/index.js'; 2 | 3 | export default Discord; 4 | 5 | export const { 6 | BaseClient, 7 | Client, 8 | Shard, 9 | ShardClientUtil, 10 | ShardingManager, 11 | WebhookClient, 12 | ActivityFlags, 13 | BitField, 14 | Collection, 15 | Constants, 16 | DataResolver, 17 | BaseManager, 18 | DiscordAPIError, 19 | HTTPError, 20 | MessageFlags, 21 | Intents, 22 | Permissions, 23 | Speaking, 24 | Snowflake, 25 | SnowflakeUtil, 26 | Structures, 27 | SystemChannelFlags, 28 | Util, 29 | version, 30 | ChannelManager, 31 | GuildChannelManager, 32 | GuildEmojiManager, 33 | GuildEmojiRoleManager, 34 | GuildMemberManager, 35 | GuildMemberRoleManager, 36 | GuildManager, 37 | ReactionUserManager, 38 | MessageManager, 39 | PresenceManager, 40 | RoleManager, 41 | UserManager, 42 | discordSort, 43 | escapeMarkdown, 44 | fetchRecommendedShards, 45 | resolveColor, 46 | resolveString, 47 | splitMessage, 48 | Base, 49 | Activity, 50 | APIMessage, 51 | CategoryChannel, 52 | Channel, 53 | ClientApplication, 54 | ClientUser, 55 | Collector, 56 | DMChannel, 57 | Emoji, 58 | Guild, 59 | GuildAuditLogs, 60 | GuildChannel, 61 | GuildEmoji, 62 | GuildMember, 63 | Integration, 64 | Invite, 65 | Message, 66 | MessageAttachment, 67 | MessageCollector, 68 | MessageEmbed, 69 | MessageMentions, 70 | MessageReaction, 71 | NewsChannel, 72 | PermissionOverwrites, 73 | Presence, 74 | ClientPresence, 75 | ReactionCollector, 76 | ReactionEmoji, 77 | RichPresenceAssets, 78 | Role, 79 | StoreChannel, 80 | Team, 81 | TeamMember, 82 | TextChannel, 83 | User, 84 | VoiceChannel, 85 | VoiceRegion, 86 | VoiceState, 87 | Webhook, 88 | WebSocket 89 | } = Discord; 90 | -------------------------------------------------------------------------------- /node_modules/discord.js/jsdoc.json: -------------------------------------------------------------------------------- 1 | { 2 | "plugins": ["node_modules/jsdoc-strip-async-await"] 3 | } 4 | -------------------------------------------------------------------------------- /node_modules/discord.js/node_modules/@discordjs/collection/README.md: -------------------------------------------------------------------------------- 1 | # Collection 2 | 3 | Utility data structure used in Discord.js. 4 | -------------------------------------------------------------------------------- /node_modules/discord.js/node_modules/@discordjs/form-data/License: -------------------------------------------------------------------------------- 1 | Copyright (c) 2012 Felix Geisendörfer (felix@debuggable.com) and contributors 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /node_modules/discord.js/node_modules/@discordjs/form-data/index.d.ts: -------------------------------------------------------------------------------- 1 | // Definitions by: Carlos Ballesteros Velasco 2 | // Leon Yu 3 | // BendingBender 4 | // Maple Miao 5 | 6 | /// 7 | import * as stream from 'stream'; 8 | import * as http from 'http'; 9 | 10 | export = FormData; 11 | 12 | // Extracted because @types/node doesn't export interfaces. 13 | interface ReadableOptions { 14 | highWaterMark?: number; 15 | encoding?: string; 16 | objectMode?: boolean; 17 | read?(this: stream.Readable, size: number): void; 18 | destroy?(this: stream.Readable, error: Error | null, callback: (error: Error | null) => void): void; 19 | autoDestroy?: boolean; 20 | } 21 | 22 | interface Options extends ReadableOptions { 23 | writable?: boolean; 24 | readable?: boolean; 25 | dataSize?: number; 26 | maxDataSize?: number; 27 | pauseStreams?: boolean; 28 | } 29 | 30 | declare class FormData extends stream.Readable { 31 | constructor(options?: Options); 32 | append(key: string, value: any, options?: FormData.AppendOptions | string): void; 33 | getHeaders(userHeaders?: FormData.Headers): FormData.Headers; 34 | submit( 35 | params: string | FormData.SubmitOptions, 36 | callback?: (error: Error | null, response: http.IncomingMessage) => void 37 | ): http.ClientRequest; 38 | getBuffer(): Buffer; 39 | getBoundary(): string; 40 | getLength(callback: (err: Error | null, length: number) => void): void; 41 | getLengthSync(): number; 42 | hasKnownLength(): boolean; 43 | } 44 | 45 | declare namespace FormData { 46 | interface Headers { 47 | [key: string]: any; 48 | } 49 | 50 | interface AppendOptions { 51 | header?: string | Headers; 52 | knownLength?: number; 53 | filename?: string; 54 | filepath?: string; 55 | contentType?: string; 56 | } 57 | 58 | interface SubmitOptions extends http.RequestOptions { 59 | protocol?: 'https:' | 'http:'; 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /node_modules/discord.js/node_modules/@discordjs/form-data/lib/browser.js: -------------------------------------------------------------------------------- 1 | /* eslint-env browser */ 2 | module.exports = typeof self == 'object' ? self.FormData : window.FormData; 3 | -------------------------------------------------------------------------------- /node_modules/discord.js/node_modules/@discordjs/form-data/lib/populate.js: -------------------------------------------------------------------------------- 1 | // populates missing values 2 | module.exports = function(dst, src) { 3 | 4 | Object.keys(src).forEach(function(prop) 5 | { 6 | dst[prop] = dst[prop] || src[prop]; 7 | }); 8 | 9 | return dst; 10 | }; 11 | -------------------------------------------------------------------------------- /node_modules/discord.js/node_modules/abort-controller/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 Toru Nagashima 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /node_modules/discord.js/node_modules/abort-controller/browser.js: -------------------------------------------------------------------------------- 1 | /*globals self, window */ 2 | "use strict" 3 | 4 | /*eslint-disable @mysticatea/prettier */ 5 | const { AbortController, AbortSignal } = 6 | typeof self !== "undefined" ? self : 7 | typeof window !== "undefined" ? window : 8 | /* otherwise */ undefined 9 | /*eslint-enable @mysticatea/prettier */ 10 | 11 | module.exports = AbortController 12 | module.exports.AbortSignal = AbortSignal 13 | module.exports.default = AbortController 14 | -------------------------------------------------------------------------------- /node_modules/discord.js/node_modules/abort-controller/browser.mjs: -------------------------------------------------------------------------------- 1 | /*globals self, window */ 2 | 3 | /*eslint-disable @mysticatea/prettier */ 4 | const { AbortController, AbortSignal } = 5 | typeof self !== "undefined" ? self : 6 | typeof window !== "undefined" ? window : 7 | /* otherwise */ undefined 8 | /*eslint-enable @mysticatea/prettier */ 9 | 10 | export default AbortController 11 | export { AbortController, AbortSignal } 12 | -------------------------------------------------------------------------------- /node_modules/discord.js/node_modules/abort-controller/dist/abort-controller.d.ts: -------------------------------------------------------------------------------- 1 | import { EventTarget } from "event-target-shim" 2 | 3 | type Events = { 4 | abort: any 5 | } 6 | type EventAttributes = { 7 | onabort: any 8 | } 9 | /** 10 | * The signal class. 11 | * @see https://dom.spec.whatwg.org/#abortsignal 12 | */ 13 | declare class AbortSignal extends EventTarget { 14 | /** 15 | * AbortSignal cannot be constructed directly. 16 | */ 17 | constructor() 18 | /** 19 | * Returns `true` if this `AbortSignal`"s `AbortController` has signaled to abort, and `false` otherwise. 20 | */ 21 | readonly aborted: boolean 22 | } 23 | /** 24 | * The AbortController. 25 | * @see https://dom.spec.whatwg.org/#abortcontroller 26 | */ 27 | declare class AbortController { 28 | /** 29 | * Initialize this controller. 30 | */ 31 | constructor() 32 | /** 33 | * Returns the `AbortSignal` object associated with this object. 34 | */ 35 | readonly signal: AbortSignal 36 | /** 37 | * Abort and signal to any observers that the associated activity is to be aborted. 38 | */ 39 | abort(): void 40 | } 41 | 42 | export default AbortController 43 | export { AbortController, AbortSignal } 44 | -------------------------------------------------------------------------------- /node_modules/discord.js/node_modules/abort-controller/polyfill.js: -------------------------------------------------------------------------------- 1 | /*globals require, self, window */ 2 | "use strict" 3 | 4 | const ac = require("./dist/abort-controller") 5 | 6 | /*eslint-disable @mysticatea/prettier */ 7 | const g = 8 | typeof self !== "undefined" ? self : 9 | typeof window !== "undefined" ? window : 10 | typeof global !== "undefined" ? global : 11 | /* otherwise */ undefined 12 | /*eslint-enable @mysticatea/prettier */ 13 | 14 | if (g) { 15 | if (typeof g.AbortController === "undefined") { 16 | g.AbortController = ac.AbortController 17 | } 18 | if (typeof g.AbortSignal === "undefined") { 19 | g.AbortSignal = ac.AbortSignal 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /node_modules/discord.js/node_modules/abort-controller/polyfill.mjs: -------------------------------------------------------------------------------- 1 | /*globals self, window */ 2 | import * as ac from "./dist/abort-controller" 3 | 4 | /*eslint-disable @mysticatea/prettier */ 5 | const g = 6 | typeof self !== "undefined" ? self : 7 | typeof window !== "undefined" ? window : 8 | typeof global !== "undefined" ? global : 9 | /* otherwise */ undefined 10 | /*eslint-enable @mysticatea/prettier */ 11 | 12 | if (g) { 13 | if (typeof g.AbortController === "undefined") { 14 | g.AbortController = ac.AbortController 15 | } 16 | if (typeof g.AbortSignal === "undefined") { 17 | g.AbortSignal = ac.AbortSignal 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /node_modules/discord.js/node_modules/asynckit/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 Alex Indigo 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /node_modules/discord.js/node_modules/asynckit/bench.js: -------------------------------------------------------------------------------- 1 | /* eslint no-console: "off" */ 2 | 3 | var asynckit = require('./') 4 | , async = require('async') 5 | , assert = require('assert') 6 | , expected = 0 7 | ; 8 | 9 | var Benchmark = require('benchmark'); 10 | var suite = new Benchmark.Suite; 11 | 12 | var source = []; 13 | for (var z = 1; z < 100; z++) 14 | { 15 | source.push(z); 16 | expected += z; 17 | } 18 | 19 | suite 20 | // add tests 21 | 22 | .add('async.map', function(deferred) 23 | { 24 | var total = 0; 25 | 26 | async.map(source, 27 | function(i, cb) 28 | { 29 | setImmediate(function() 30 | { 31 | total += i; 32 | cb(null, total); 33 | }); 34 | }, 35 | function(err, result) 36 | { 37 | assert.ifError(err); 38 | assert.equal(result[result.length - 1], expected); 39 | deferred.resolve(); 40 | }); 41 | }, {'defer': true}) 42 | 43 | 44 | .add('asynckit.parallel', function(deferred) 45 | { 46 | var total = 0; 47 | 48 | asynckit.parallel(source, 49 | function(i, cb) 50 | { 51 | setImmediate(function() 52 | { 53 | total += i; 54 | cb(null, total); 55 | }); 56 | }, 57 | function(err, result) 58 | { 59 | assert.ifError(err); 60 | assert.equal(result[result.length - 1], expected); 61 | deferred.resolve(); 62 | }); 63 | }, {'defer': true}) 64 | 65 | 66 | // add listeners 67 | .on('cycle', function(ev) 68 | { 69 | console.log(String(ev.target)); 70 | }) 71 | .on('complete', function() 72 | { 73 | console.log('Fastest is ' + this.filter('fastest').map('name')); 74 | }) 75 | // run async 76 | .run({ 'async': true }); 77 | -------------------------------------------------------------------------------- /node_modules/discord.js/node_modules/asynckit/index.js: -------------------------------------------------------------------------------- 1 | module.exports = 2 | { 3 | parallel : require('./parallel.js'), 4 | serial : require('./serial.js'), 5 | serialOrdered : require('./serialOrdered.js') 6 | }; 7 | -------------------------------------------------------------------------------- /node_modules/discord.js/node_modules/asynckit/lib/abort.js: -------------------------------------------------------------------------------- 1 | // API 2 | module.exports = abort; 3 | 4 | /** 5 | * Aborts leftover active jobs 6 | * 7 | * @param {object} state - current state object 8 | */ 9 | function abort(state) 10 | { 11 | Object.keys(state.jobs).forEach(clean.bind(state)); 12 | 13 | // reset leftover jobs 14 | state.jobs = {}; 15 | } 16 | 17 | /** 18 | * Cleans up leftover job by invoking abort function for the provided job id 19 | * 20 | * @this state 21 | * @param {string|number} key - job id to abort 22 | */ 23 | function clean(key) 24 | { 25 | if (typeof this.jobs[key] == 'function') 26 | { 27 | this.jobs[key](); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /node_modules/discord.js/node_modules/asynckit/lib/async.js: -------------------------------------------------------------------------------- 1 | var defer = require('./defer.js'); 2 | 3 | // API 4 | module.exports = async; 5 | 6 | /** 7 | * Runs provided callback asynchronously 8 | * even if callback itself is not 9 | * 10 | * @param {function} callback - callback to invoke 11 | * @returns {function} - augmented callback 12 | */ 13 | function async(callback) 14 | { 15 | var isAsync = false; 16 | 17 | // check if async happened 18 | defer(function() { isAsync = true; }); 19 | 20 | return function async_callback(err, result) 21 | { 22 | if (isAsync) 23 | { 24 | callback(err, result); 25 | } 26 | else 27 | { 28 | defer(function nextTick_callback() 29 | { 30 | callback(err, result); 31 | }); 32 | } 33 | }; 34 | } 35 | -------------------------------------------------------------------------------- /node_modules/discord.js/node_modules/asynckit/lib/defer.js: -------------------------------------------------------------------------------- 1 | module.exports = defer; 2 | 3 | /** 4 | * Runs provided function on next iteration of the event loop 5 | * 6 | * @param {function} fn - function to run 7 | */ 8 | function defer(fn) 9 | { 10 | var nextTick = typeof setImmediate == 'function' 11 | ? setImmediate 12 | : ( 13 | typeof process == 'object' && typeof process.nextTick == 'function' 14 | ? process.nextTick 15 | : null 16 | ); 17 | 18 | if (nextTick) 19 | { 20 | nextTick(fn); 21 | } 22 | else 23 | { 24 | setTimeout(fn, 0); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /node_modules/discord.js/node_modules/asynckit/lib/iterate.js: -------------------------------------------------------------------------------- 1 | var async = require('./async.js') 2 | , abort = require('./abort.js') 3 | ; 4 | 5 | // API 6 | module.exports = iterate; 7 | 8 | /** 9 | * Iterates over each job object 10 | * 11 | * @param {array|object} list - array or object (named list) to iterate over 12 | * @param {function} iterator - iterator to run 13 | * @param {object} state - current job status 14 | * @param {function} callback - invoked when all elements processed 15 | */ 16 | function iterate(list, iterator, state, callback) 17 | { 18 | // store current index 19 | var key = state['keyedList'] ? state['keyedList'][state.index] : state.index; 20 | 21 | state.jobs[key] = runJob(iterator, key, list[key], function(error, output) 22 | { 23 | // don't repeat yourself 24 | // skip secondary callbacks 25 | if (!(key in state.jobs)) 26 | { 27 | return; 28 | } 29 | 30 | // clean up jobs 31 | delete state.jobs[key]; 32 | 33 | if (error) 34 | { 35 | // don't process rest of the results 36 | // stop still active jobs 37 | // and reset the list 38 | abort(state); 39 | } 40 | else 41 | { 42 | state.results[key] = output; 43 | } 44 | 45 | // return salvaged results 46 | callback(error, state.results); 47 | }); 48 | } 49 | 50 | /** 51 | * Runs iterator over provided job element 52 | * 53 | * @param {function} iterator - iterator to invoke 54 | * @param {string|number} key - key/index of the element in the list of jobs 55 | * @param {mixed} item - job description 56 | * @param {function} callback - invoked after iterator is done with the job 57 | * @returns {function|mixed} - job abort function or something else 58 | */ 59 | function runJob(iterator, key, item, callback) 60 | { 61 | var aborter; 62 | 63 | // allow shortcut if iterator expects only two arguments 64 | if (iterator.length == 2) 65 | { 66 | aborter = iterator(item, async(callback)); 67 | } 68 | // otherwise go with full three arguments 69 | else 70 | { 71 | aborter = iterator(item, key, async(callback)); 72 | } 73 | 74 | return aborter; 75 | } 76 | -------------------------------------------------------------------------------- /node_modules/discord.js/node_modules/asynckit/lib/readable_asynckit.js: -------------------------------------------------------------------------------- 1 | var streamify = require('./streamify.js') 2 | , defer = require('./defer.js') 3 | ; 4 | 5 | // API 6 | module.exports = ReadableAsyncKit; 7 | 8 | /** 9 | * Base constructor for all streams 10 | * used to hold properties/methods 11 | */ 12 | function ReadableAsyncKit() 13 | { 14 | ReadableAsyncKit.super_.apply(this, arguments); 15 | 16 | // list of active jobs 17 | this.jobs = {}; 18 | 19 | // add stream methods 20 | this.destroy = destroy; 21 | this._start = _start; 22 | this._read = _read; 23 | } 24 | 25 | /** 26 | * Destroys readable stream, 27 | * by aborting outstanding jobs 28 | * 29 | * @returns {void} 30 | */ 31 | function destroy() 32 | { 33 | if (this.destroyed) 34 | { 35 | return; 36 | } 37 | 38 | this.destroyed = true; 39 | 40 | if (typeof this.terminator == 'function') 41 | { 42 | this.terminator(); 43 | } 44 | } 45 | 46 | /** 47 | * Starts provided jobs in async manner 48 | * 49 | * @private 50 | */ 51 | function _start() 52 | { 53 | // first argument – runner function 54 | var runner = arguments[0] 55 | // take away first argument 56 | , args = Array.prototype.slice.call(arguments, 1) 57 | // second argument - input data 58 | , input = args[0] 59 | // last argument - result callback 60 | , endCb = streamify.callback.call(this, args[args.length - 1]) 61 | ; 62 | 63 | args[args.length - 1] = endCb; 64 | // third argument - iterator 65 | args[1] = streamify.iterator.call(this, args[1]); 66 | 67 | // allow time for proper setup 68 | defer(function() 69 | { 70 | if (!this.destroyed) 71 | { 72 | this.terminator = runner.apply(null, args); 73 | } 74 | else 75 | { 76 | endCb(null, Array.isArray(input) ? [] : {}); 77 | } 78 | }.bind(this)); 79 | } 80 | 81 | 82 | /** 83 | * Implement _read to comply with Readable streams 84 | * Doesn't really make sense for flowing object mode 85 | * 86 | * @private 87 | */ 88 | function _read() 89 | { 90 | 91 | } 92 | -------------------------------------------------------------------------------- /node_modules/discord.js/node_modules/asynckit/lib/readable_parallel.js: -------------------------------------------------------------------------------- 1 | var parallel = require('../parallel.js'); 2 | 3 | // API 4 | module.exports = ReadableParallel; 5 | 6 | /** 7 | * Streaming wrapper to `asynckit.parallel` 8 | * 9 | * @param {array|object} list - array or object (named list) to iterate over 10 | * @param {function} iterator - iterator to run 11 | * @param {function} callback - invoked when all elements processed 12 | * @returns {stream.Readable#} 13 | */ 14 | function ReadableParallel(list, iterator, callback) 15 | { 16 | if (!(this instanceof ReadableParallel)) 17 | { 18 | return new ReadableParallel(list, iterator, callback); 19 | } 20 | 21 | // turn on object mode 22 | ReadableParallel.super_.call(this, {objectMode: true}); 23 | 24 | this._start(parallel, list, iterator, callback); 25 | } 26 | -------------------------------------------------------------------------------- /node_modules/discord.js/node_modules/asynckit/lib/readable_serial.js: -------------------------------------------------------------------------------- 1 | var serial = require('../serial.js'); 2 | 3 | // API 4 | module.exports = ReadableSerial; 5 | 6 | /** 7 | * Streaming wrapper to `asynckit.serial` 8 | * 9 | * @param {array|object} list - array or object (named list) to iterate over 10 | * @param {function} iterator - iterator to run 11 | * @param {function} callback - invoked when all elements processed 12 | * @returns {stream.Readable#} 13 | */ 14 | function ReadableSerial(list, iterator, callback) 15 | { 16 | if (!(this instanceof ReadableSerial)) 17 | { 18 | return new ReadableSerial(list, iterator, callback); 19 | } 20 | 21 | // turn on object mode 22 | ReadableSerial.super_.call(this, {objectMode: true}); 23 | 24 | this._start(serial, list, iterator, callback); 25 | } 26 | -------------------------------------------------------------------------------- /node_modules/discord.js/node_modules/asynckit/lib/readable_serial_ordered.js: -------------------------------------------------------------------------------- 1 | var serialOrdered = require('../serialOrdered.js'); 2 | 3 | // API 4 | module.exports = ReadableSerialOrdered; 5 | // expose sort helpers 6 | module.exports.ascending = serialOrdered.ascending; 7 | module.exports.descending = serialOrdered.descending; 8 | 9 | /** 10 | * Streaming wrapper to `asynckit.serialOrdered` 11 | * 12 | * @param {array|object} list - array or object (named list) to iterate over 13 | * @param {function} iterator - iterator to run 14 | * @param {function} sortMethod - custom sort function 15 | * @param {function} callback - invoked when all elements processed 16 | * @returns {stream.Readable#} 17 | */ 18 | function ReadableSerialOrdered(list, iterator, sortMethod, callback) 19 | { 20 | if (!(this instanceof ReadableSerialOrdered)) 21 | { 22 | return new ReadableSerialOrdered(list, iterator, sortMethod, callback); 23 | } 24 | 25 | // turn on object mode 26 | ReadableSerialOrdered.super_.call(this, {objectMode: true}); 27 | 28 | this._start(serialOrdered, list, iterator, sortMethod, callback); 29 | } 30 | -------------------------------------------------------------------------------- /node_modules/discord.js/node_modules/asynckit/lib/state.js: -------------------------------------------------------------------------------- 1 | // API 2 | module.exports = state; 3 | 4 | /** 5 | * Creates initial state object 6 | * for iteration over list 7 | * 8 | * @param {array|object} list - list to iterate over 9 | * @param {function|null} sortMethod - function to use for keys sort, 10 | * or `null` to keep them as is 11 | * @returns {object} - initial state object 12 | */ 13 | function state(list, sortMethod) 14 | { 15 | var isNamedList = !Array.isArray(list) 16 | , initState = 17 | { 18 | index : 0, 19 | keyedList: isNamedList || sortMethod ? Object.keys(list) : null, 20 | jobs : {}, 21 | results : isNamedList ? {} : [], 22 | size : isNamedList ? Object.keys(list).length : list.length 23 | } 24 | ; 25 | 26 | if (sortMethod) 27 | { 28 | // sort array keys based on it's values 29 | // sort object's keys just on own merit 30 | initState.keyedList.sort(isNamedList ? sortMethod : function(a, b) 31 | { 32 | return sortMethod(list[a], list[b]); 33 | }); 34 | } 35 | 36 | return initState; 37 | } 38 | -------------------------------------------------------------------------------- /node_modules/discord.js/node_modules/asynckit/lib/terminator.js: -------------------------------------------------------------------------------- 1 | var abort = require('./abort.js') 2 | , async = require('./async.js') 3 | ; 4 | 5 | // API 6 | module.exports = terminator; 7 | 8 | /** 9 | * Terminates jobs in the attached state context 10 | * 11 | * @this AsyncKitState# 12 | * @param {function} callback - final callback to invoke after termination 13 | */ 14 | function terminator(callback) 15 | { 16 | if (!Object.keys(this.jobs).length) 17 | { 18 | return; 19 | } 20 | 21 | // fast forward iteration index 22 | this.index = this.size; 23 | 24 | // abort jobs 25 | abort(this); 26 | 27 | // send back results we have so far 28 | async(callback)(null, this.results); 29 | } 30 | -------------------------------------------------------------------------------- /node_modules/discord.js/node_modules/asynckit/parallel.js: -------------------------------------------------------------------------------- 1 | var iterate = require('./lib/iterate.js') 2 | , initState = require('./lib/state.js') 3 | , terminator = require('./lib/terminator.js') 4 | ; 5 | 6 | // Public API 7 | module.exports = parallel; 8 | 9 | /** 10 | * Runs iterator over provided array elements in parallel 11 | * 12 | * @param {array|object} list - array or object (named list) to iterate over 13 | * @param {function} iterator - iterator to run 14 | * @param {function} callback - invoked when all elements processed 15 | * @returns {function} - jobs terminator 16 | */ 17 | function parallel(list, iterator, callback) 18 | { 19 | var state = initState(list); 20 | 21 | while (state.index < (state['keyedList'] || list).length) 22 | { 23 | iterate(list, iterator, state, function(error, result) 24 | { 25 | if (error) 26 | { 27 | callback(error, result); 28 | return; 29 | } 30 | 31 | // looks like it's the last one 32 | if (Object.keys(state.jobs).length === 0) 33 | { 34 | callback(null, state.results); 35 | return; 36 | } 37 | }); 38 | 39 | state.index++; 40 | } 41 | 42 | return terminator.bind(state, callback); 43 | } 44 | -------------------------------------------------------------------------------- /node_modules/discord.js/node_modules/asynckit/serial.js: -------------------------------------------------------------------------------- 1 | var serialOrdered = require('./serialOrdered.js'); 2 | 3 | // Public API 4 | module.exports = serial; 5 | 6 | /** 7 | * Runs iterator over provided array elements in series 8 | * 9 | * @param {array|object} list - array or object (named list) to iterate over 10 | * @param {function} iterator - iterator to run 11 | * @param {function} callback - invoked when all elements processed 12 | * @returns {function} - jobs terminator 13 | */ 14 | function serial(list, iterator, callback) 15 | { 16 | return serialOrdered(list, iterator, null, callback); 17 | } 18 | -------------------------------------------------------------------------------- /node_modules/discord.js/node_modules/asynckit/serialOrdered.js: -------------------------------------------------------------------------------- 1 | var iterate = require('./lib/iterate.js') 2 | , initState = require('./lib/state.js') 3 | , terminator = require('./lib/terminator.js') 4 | ; 5 | 6 | // Public API 7 | module.exports = serialOrdered; 8 | // sorting helpers 9 | module.exports.ascending = ascending; 10 | module.exports.descending = descending; 11 | 12 | /** 13 | * Runs iterator over provided sorted array elements in series 14 | * 15 | * @param {array|object} list - array or object (named list) to iterate over 16 | * @param {function} iterator - iterator to run 17 | * @param {function} sortMethod - custom sort function 18 | * @param {function} callback - invoked when all elements processed 19 | * @returns {function} - jobs terminator 20 | */ 21 | function serialOrdered(list, iterator, sortMethod, callback) 22 | { 23 | var state = initState(list, sortMethod); 24 | 25 | iterate(list, iterator, state, function iteratorHandler(error, result) 26 | { 27 | if (error) 28 | { 29 | callback(error, result); 30 | return; 31 | } 32 | 33 | state.index++; 34 | 35 | // are we there yet? 36 | if (state.index < (state['keyedList'] || list).length) 37 | { 38 | iterate(list, iterator, state, iteratorHandler); 39 | return; 40 | } 41 | 42 | // done here 43 | callback(null, state.results); 44 | }); 45 | 46 | return terminator.bind(state, callback); 47 | } 48 | 49 | /* 50 | * -- Sort methods 51 | */ 52 | 53 | /** 54 | * sort helper to sort array elements in ascending order 55 | * 56 | * @param {mixed} a - an item to compare 57 | * @param {mixed} b - an item to compare 58 | * @returns {number} - comparison result 59 | */ 60 | function ascending(a, b) 61 | { 62 | return a < b ? -1 : a > b ? 1 : 0; 63 | } 64 | 65 | /** 66 | * sort helper to sort array elements in descending order 67 | * 68 | * @param {mixed} a - an item to compare 69 | * @param {mixed} b - an item to compare 70 | * @returns {number} - comparison result 71 | */ 72 | function descending(a, b) 73 | { 74 | return -1 * ascending(a, b); 75 | } 76 | -------------------------------------------------------------------------------- /node_modules/discord.js/node_modules/asynckit/stream.js: -------------------------------------------------------------------------------- 1 | var inherits = require('util').inherits 2 | , Readable = require('stream').Readable 3 | , ReadableAsyncKit = require('./lib/readable_asynckit.js') 4 | , ReadableParallel = require('./lib/readable_parallel.js') 5 | , ReadableSerial = require('./lib/readable_serial.js') 6 | , ReadableSerialOrdered = require('./lib/readable_serial_ordered.js') 7 | ; 8 | 9 | // API 10 | module.exports = 11 | { 12 | parallel : ReadableParallel, 13 | serial : ReadableSerial, 14 | serialOrdered : ReadableSerialOrdered, 15 | }; 16 | 17 | inherits(ReadableAsyncKit, Readable); 18 | 19 | inherits(ReadableParallel, ReadableAsyncKit); 20 | inherits(ReadableSerial, ReadableAsyncKit); 21 | inherits(ReadableSerialOrdered, ReadableAsyncKit); 22 | -------------------------------------------------------------------------------- /node_modules/discord.js/node_modules/combined-stream/License: -------------------------------------------------------------------------------- 1 | Copyright (c) 2011 Debuggable Limited 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /node_modules/discord.js/node_modules/combined-stream/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "_args": [ 3 | [ 4 | "combined-stream@1.0.8", 5 | "C:\\Users\\Administrator\\Desktop\\North Gate Booster" 6 | ] 7 | ], 8 | "_from": "combined-stream@1.0.8", 9 | "_id": "combined-stream@1.0.8", 10 | "_inBundle": false, 11 | "_integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", 12 | "_location": "/discord.js/combined-stream", 13 | "_phantomChildren": {}, 14 | "_requested": { 15 | "type": "version", 16 | "registry": true, 17 | "raw": "combined-stream@1.0.8", 18 | "name": "combined-stream", 19 | "escapedName": "combined-stream", 20 | "rawSpec": "1.0.8", 21 | "saveSpec": null, 22 | "fetchSpec": "1.0.8" 23 | }, 24 | "_requiredBy": [ 25 | "/discord.js/@discordjs/form-data" 26 | ], 27 | "_resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", 28 | "_spec": "1.0.8", 29 | "_where": "C:\\Users\\Administrator\\Desktop\\North Gate Booster", 30 | "author": { 31 | "name": "Felix Geisendörfer", 32 | "email": "felix@debuggable.com", 33 | "url": "http://debuggable.com/" 34 | }, 35 | "bugs": { 36 | "url": "https://github.com/felixge/node-combined-stream/issues" 37 | }, 38 | "dependencies": { 39 | "delayed-stream": "~1.0.0" 40 | }, 41 | "description": "A stream that emits multiple other streams one after another.", 42 | "devDependencies": { 43 | "far": "~0.0.7" 44 | }, 45 | "engines": { 46 | "node": ">= 0.8" 47 | }, 48 | "homepage": "https://github.com/felixge/node-combined-stream", 49 | "license": "MIT", 50 | "main": "./lib/combined_stream", 51 | "name": "combined-stream", 52 | "repository": { 53 | "type": "git", 54 | "url": "git://github.com/felixge/node-combined-stream.git" 55 | }, 56 | "scripts": { 57 | "test": "node test/run.js" 58 | }, 59 | "version": "1.0.8" 60 | } 61 | -------------------------------------------------------------------------------- /node_modules/discord.js/node_modules/combined-stream/yarn.lock: -------------------------------------------------------------------------------- 1 | # THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. 2 | # yarn lockfile v1 3 | 4 | 5 | delayed-stream@~1.0.0: 6 | version "1.0.0" 7 | resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" 8 | 9 | far@~0.0.7: 10 | version "0.0.7" 11 | resolved "https://registry.yarnpkg.com/far/-/far-0.0.7.tgz#01c1fd362bcd26ce9cf161af3938aa34619f79a7" 12 | dependencies: 13 | oop "0.0.3" 14 | 15 | oop@0.0.3: 16 | version "0.0.3" 17 | resolved "https://registry.yarnpkg.com/oop/-/oop-0.0.3.tgz#70fa405a5650891a194fdc82ca68dad6dabf4401" 18 | -------------------------------------------------------------------------------- /node_modules/discord.js/node_modules/delayed-stream/.npmignore: -------------------------------------------------------------------------------- 1 | test 2 | -------------------------------------------------------------------------------- /node_modules/discord.js/node_modules/delayed-stream/License: -------------------------------------------------------------------------------- 1 | Copyright (c) 2011 Debuggable Limited 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /node_modules/discord.js/node_modules/delayed-stream/Makefile: -------------------------------------------------------------------------------- 1 | SHELL := /bin/bash 2 | 3 | test: 4 | @./test/run.js 5 | 6 | .PHONY: test 7 | 8 | -------------------------------------------------------------------------------- /node_modules/discord.js/node_modules/delayed-stream/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "_args": [ 3 | [ 4 | "delayed-stream@1.0.0", 5 | "C:\\Users\\Administrator\\Desktop\\North Gate Booster" 6 | ] 7 | ], 8 | "_from": "delayed-stream@1.0.0", 9 | "_id": "delayed-stream@1.0.0", 10 | "_inBundle": false, 11 | "_integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", 12 | "_location": "/discord.js/delayed-stream", 13 | "_phantomChildren": {}, 14 | "_requested": { 15 | "type": "version", 16 | "registry": true, 17 | "raw": "delayed-stream@1.0.0", 18 | "name": "delayed-stream", 19 | "escapedName": "delayed-stream", 20 | "rawSpec": "1.0.0", 21 | "saveSpec": null, 22 | "fetchSpec": "1.0.0" 23 | }, 24 | "_requiredBy": [ 25 | "/discord.js/combined-stream" 26 | ], 27 | "_resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", 28 | "_spec": "1.0.0", 29 | "_where": "C:\\Users\\Administrator\\Desktop\\North Gate Booster", 30 | "author": { 31 | "name": "Felix Geisendörfer", 32 | "email": "felix@debuggable.com", 33 | "url": "http://debuggable.com/" 34 | }, 35 | "bugs": { 36 | "url": "https://github.com/felixge/node-delayed-stream/issues" 37 | }, 38 | "contributors": [ 39 | { 40 | "name": "Mike Atkins", 41 | "email": "apeherder@gmail.com" 42 | } 43 | ], 44 | "dependencies": {}, 45 | "description": "Buffers events from a stream until you are ready to handle them.", 46 | "devDependencies": { 47 | "fake": "0.2.0", 48 | "far": "0.0.1" 49 | }, 50 | "engines": { 51 | "node": ">=0.4.0" 52 | }, 53 | "homepage": "https://github.com/felixge/node-delayed-stream", 54 | "license": "MIT", 55 | "main": "./lib/delayed_stream", 56 | "name": "delayed-stream", 57 | "repository": { 58 | "type": "git", 59 | "url": "git://github.com/felixge/node-delayed-stream.git" 60 | }, 61 | "scripts": { 62 | "test": "make test" 63 | }, 64 | "version": "1.0.0" 65 | } 66 | -------------------------------------------------------------------------------- /node_modules/discord.js/node_modules/event-target-shim/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Toru Nagashima 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /node_modules/discord.js/node_modules/mime-db/LICENSE: -------------------------------------------------------------------------------- 1 | 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2014 Jonathan Ong me@jongleberry.com 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in 14 | all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /node_modules/discord.js/node_modules/mime-db/index.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * mime-db 3 | * Copyright(c) 2014 Jonathan Ong 4 | * MIT Licensed 5 | */ 6 | 7 | /** 8 | * Module exports. 9 | */ 10 | 11 | module.exports = require('./db.json') 12 | -------------------------------------------------------------------------------- /node_modules/discord.js/node_modules/mime-types/LICENSE: -------------------------------------------------------------------------------- 1 | (The MIT License) 2 | 3 | Copyright (c) 2014 Jonathan Ong 4 | Copyright (c) 2015 Douglas Christopher Wilson 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining 7 | a copy of this software and associated documentation files (the 8 | 'Software'), to deal in the Software without restriction, including 9 | without limitation the rights to use, copy, modify, merge, publish, 10 | distribute, sublicense, and/or sell copies of the Software, and to 11 | permit persons to whom the Software is furnished to do so, subject to 12 | the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be 15 | included in all copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, 18 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 19 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 20 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 21 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 22 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 23 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 24 | -------------------------------------------------------------------------------- /node_modules/discord.js/node_modules/node-fetch/LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 David Frank 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /node_modules/discord.js/node_modules/node-fetch/browser.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | // ref: https://github.com/tc39/proposal-global 4 | var getGlobal = function () { 5 | // the only reliable means to get the global object is 6 | // `Function('return this')()` 7 | // However, this causes CSP violations in Chrome apps. 8 | if (typeof self !== 'undefined') { return self; } 9 | if (typeof window !== 'undefined') { return window; } 10 | if (typeof global !== 'undefined') { return global; } 11 | throw new Error('unable to locate global object'); 12 | } 13 | 14 | var global = getGlobal(); 15 | 16 | module.exports = exports = global.fetch; 17 | 18 | // Needed for TypeScript and Webpack. 19 | if (global.fetch) { 20 | exports.default = global.fetch.bind(global); 21 | } 22 | 23 | exports.Headers = global.Headers; 24 | exports.Request = global.Request; 25 | exports.Response = global.Response; -------------------------------------------------------------------------------- /node_modules/discord.js/node_modules/prism-media/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "_args": [ 3 | [ 4 | "prism-media@1.2.3", 5 | "C:\\Users\\Administrator\\Desktop\\North Gate Booster" 6 | ] 7 | ], 8 | "_from": "prism-media@1.2.3", 9 | "_id": "prism-media@1.2.3", 10 | "_inBundle": false, 11 | "_integrity": "sha512-fSrR66n0l6roW9Rx4rSLMyTPTjRTiXy5RVqDOurACQ6si1rKHHKDU5gwBJoCsIV0R3o9gi+K50akl/qyw1C74A==", 12 | "_location": "/discord.js/prism-media", 13 | "_phantomChildren": {}, 14 | "_requested": { 15 | "type": "version", 16 | "registry": true, 17 | "raw": "prism-media@1.2.3", 18 | "name": "prism-media", 19 | "escapedName": "prism-media", 20 | "rawSpec": "1.2.3", 21 | "saveSpec": null, 22 | "fetchSpec": "1.2.3" 23 | }, 24 | "_requiredBy": [ 25 | "/discord.js" 26 | ], 27 | "_resolved": "https://registry.npmjs.org/prism-media/-/prism-media-1.2.3.tgz", 28 | "_spec": "1.2.3", 29 | "_where": "C:\\Users\\Administrator\\Desktop\\North Gate Booster", 30 | "author": { 31 | "name": "Amish Shah", 32 | "email": "amishshah.2k@gmail.com" 33 | }, 34 | "bugs": { 35 | "url": "https://github.com/hydrabolt/prism-media/issues" 36 | }, 37 | "description": "Easy-to-use stream-based media transcoding", 38 | "devDependencies": { 39 | "docma": "^3.2.2", 40 | "eslint": "^7.14.0", 41 | "jest": "^26.6.3" 42 | }, 43 | "files": [ 44 | "src/", 45 | "typings/" 46 | ], 47 | "homepage": "https://github.com/hydrabolt/prism-media#readme", 48 | "jest": { 49 | "testURL": "http://localhost/" 50 | }, 51 | "keywords": [ 52 | "audio", 53 | "media", 54 | "ffmpeg", 55 | "opus", 56 | "pcm", 57 | "webm", 58 | "ogg" 59 | ], 60 | "license": "Apache-2.0", 61 | "main": "src/index.js", 62 | "name": "prism-media", 63 | "peerDependencies": { 64 | "ffmpeg-static": "^4.2.7 || ^3.0.0 || ^2.4.0", 65 | "@discordjs/opus": "^0.3.3", 66 | "node-opus": "^0.3.3", 67 | "opusscript": "^0.0.7" 68 | }, 69 | "peerDependenciesMeta": { 70 | "@discordjs/opus": { 71 | "optional": true 72 | }, 73 | "node-opus": { 74 | "optional": true 75 | }, 76 | "opusscript": { 77 | "optional": true 78 | }, 79 | "ffmpeg-static": { 80 | "optional": true 81 | } 82 | }, 83 | "repository": { 84 | "type": "git", 85 | "url": "git+https://github.com/hydrabolt/prism-media.git" 86 | }, 87 | "scripts": { 88 | "docs": "docma", 89 | "lint": "eslint src", 90 | "test": "npm run lint && jest && npm run docs" 91 | }, 92 | "types": "typings/index.d.ts", 93 | "version": "1.2.3" 94 | } 95 | -------------------------------------------------------------------------------- /node_modules/discord.js/node_modules/prism-media/src/core/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Core features. 3 | * **You shouldn't prefix imports from this namespace with `core`.** 4 | * @namespace core 5 | */ 6 | module.exports = { 7 | FFmpeg: require('./FFmpeg'), 8 | VolumeTransformer: require('./VolumeTransformer'), 9 | }; 10 | -------------------------------------------------------------------------------- /node_modules/discord.js/node_modules/prism-media/src/index.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | opus: require('./opus'), 3 | vorbis: require('./vorbis'), 4 | ...require('./core'), 5 | }; 6 | -------------------------------------------------------------------------------- /node_modules/discord.js/node_modules/prism-media/src/opus/WebmDemuxer.js: -------------------------------------------------------------------------------- 1 | const WebmBaseDemuxer = require('../core/WebmBase'); 2 | 3 | const OPUS_HEAD = Buffer.from([...'OpusHead'].map(x => x.charCodeAt(0))); 4 | 5 | /** 6 | * Demuxes a Webm stream (containing Opus audio) to output an Opus stream. 7 | * @extends core.WebmBaseDemuxer 8 | * @memberof opus 9 | * @example 10 | * const fs = require('fs'); 11 | * const file = fs.createReadStream('./audio.webm'); 12 | * const demuxer = new prism.opus.WebmDemuxer(); 13 | * const opus = file.pipe(demuxer); 14 | * // opus is now a ReadableStream in object mode outputting Opus packets 15 | */ 16 | class WebmDemuxer extends WebmBaseDemuxer { 17 | _checkHead(data) { 18 | if (!data.slice(0, 8).equals(OPUS_HEAD)) { 19 | throw Error('Audio codec is not Opus!'); 20 | } 21 | } 22 | } 23 | 24 | module.exports = WebmDemuxer; 25 | -------------------------------------------------------------------------------- /node_modules/discord.js/node_modules/prism-media/src/opus/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Opus features 3 | * @namespace opus 4 | */ 5 | module.exports = { 6 | // Encoder and Decoder 7 | ...require('./Opus'), 8 | OggDemuxer: require('./OggDemuxer'), 9 | WebmDemuxer: require('./WebmDemuxer'), 10 | }; 11 | -------------------------------------------------------------------------------- /node_modules/discord.js/node_modules/prism-media/src/util/loader.js: -------------------------------------------------------------------------------- 1 | exports.require = function loader(list) { 2 | const errorLog = []; 3 | for (const [name, fn] of list) { 4 | try { 5 | const data = fn(require(name)); 6 | data.name = name; 7 | return data; 8 | } catch (e) { 9 | errorLog.push(e); 10 | } 11 | } 12 | throw new Error(errorLog.join('\n')); 13 | }; 14 | -------------------------------------------------------------------------------- /node_modules/discord.js/node_modules/prism-media/src/vorbis/WebmDemuxer.js: -------------------------------------------------------------------------------- 1 | const WebmBaseDemuxer = require('../core/WebmBase'); 2 | 3 | const VORBIS_HEAD = Buffer.from([...'vorbis'].map(x => x.charCodeAt(0))); 4 | 5 | /** 6 | * Demuxes a Webm stream (containing Vorbis audio) to output a Vorbis stream. 7 | * @memberof vorbis 8 | * @extends core.WebmBaseDemuxer 9 | */ 10 | class WebmDemuxer extends WebmBaseDemuxer { 11 | _checkHead(data) { 12 | if (data.readUInt8(0) !== 2 || !data.slice(4, 10).equals(VORBIS_HEAD)) { 13 | throw Error('Audio codec is not Vorbis!'); 14 | } 15 | 16 | this.push(data.slice(3, 3 + data.readUInt8(1))); 17 | this.push(data.slice(3 + data.readUInt8(1), 3 + data.readUInt8(1) + data.readUInt8(2))); 18 | this.push(data.slice(3 + data.readUInt8(1) + data.readUInt8(2))); 19 | } 20 | } 21 | 22 | module.exports = WebmDemuxer; 23 | -------------------------------------------------------------------------------- /node_modules/discord.js/node_modules/prism-media/src/vorbis/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Vorbis features 3 | * @namespace vorbis 4 | */ 5 | 6 | module.exports = { 7 | WebmDemuxer: require('./WebmDemuxer'), 8 | }; 9 | -------------------------------------------------------------------------------- /node_modules/discord.js/node_modules/prism-media/typings/index.d.ts: -------------------------------------------------------------------------------- 1 | import { Transform } from 'stream'; 2 | 3 | import { ChildProcess } from 'child_process'; 4 | import { Duplex } from 'stream'; 5 | 6 | import { opus } from './opus'; 7 | import { vorbis } from './vorbis'; 8 | 9 | export interface FFmpegOptions { 10 | args?: string[]; 11 | } 12 | 13 | export interface FFmpegInfo { 14 | command: string; 15 | info: string; 16 | version: string; 17 | } 18 | 19 | export class FFmpeg extends Duplex { 20 | public process: ChildProcess; 21 | constructor(options?: FFmpegOptions); 22 | static getInfo(force?: boolean): FFmpegInfo; 23 | } 24 | 25 | export interface VolumeOptions { 26 | type: 's16le' | 's16be' | 's32le' | 's32be', 27 | volume?: number 28 | } 29 | 30 | export class VolumeTransformer extends Transform { 31 | public volume: number; 32 | 33 | constructor(options: VolumeOptions); 34 | public setVolume(volume: number): void; 35 | public setVolumeDecibels(db: number): void; 36 | public setVolumeLogarithmic(value: number): void; 37 | public readonly volumeDecibels: number; 38 | public readonly volumeLogarithmic: number; 39 | } 40 | 41 | export { opus, vorbis }; 42 | -------------------------------------------------------------------------------- /node_modules/discord.js/node_modules/prism-media/typings/opus.d.ts: -------------------------------------------------------------------------------- 1 | import { Transform } from 'stream'; 2 | 3 | interface OpusOptions { 4 | frameSize: number, 5 | channels: number, 6 | rate: number 7 | } 8 | 9 | export class OpusStream extends Transform { 10 | public encoder: any; // TODO: type opusscript/node-opus 11 | 12 | constructor(options?: OpusOptions); 13 | public static readonly type: 'opusscript' | 'node-opus' | '@discordjs/opus'; 14 | public setBitrate(bitrate: number): void; 15 | public setFEC(enabled: boolean): void; 16 | public setPLP(percentage: number): void; 17 | } 18 | 19 | export namespace opus { 20 | interface OpusOptions { 21 | frameSize: number, 22 | channels: number, 23 | rate: number 24 | } 25 | 26 | export class Encoder extends OpusStream {} 27 | export class Decoder extends OpusStream {} 28 | export class OggDemuxer extends Transform {} 29 | export class WebmDemuxer extends Transform {} 30 | } -------------------------------------------------------------------------------- /node_modules/discord.js/node_modules/prism-media/typings/vorbis.d.ts: -------------------------------------------------------------------------------- 1 | import { Transform } from 'stream'; 2 | 3 | export namespace vorbis { 4 | export class WebmDemuxer extends Transform {} 5 | } -------------------------------------------------------------------------------- /node_modules/discord.js/node_modules/setimmediate/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2012 Barnesandnoble.com, llc, Donavon West, and Domenic Denicola 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining 4 | a copy of this software and associated documentation files (the 5 | "Software"), to deal in the Software without restriction, including 6 | without limitation the rights to use, copy, modify, merge, publish, 7 | distribute, sublicense, and/or sell copies of the Software, and to 8 | permit persons to whom the Software is furnished to do so, subject to 9 | the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be 12 | included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 18 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 19 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /node_modules/discord.js/node_modules/setimmediate/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "_args": [ 3 | [ 4 | "setimmediate@1.0.5", 5 | "C:\\Users\\Administrator\\Desktop\\North Gate Booster" 6 | ] 7 | ], 8 | "_from": "setimmediate@1.0.5", 9 | "_id": "setimmediate@1.0.5", 10 | "_inBundle": false, 11 | "_integrity": "sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU=", 12 | "_location": "/discord.js/setimmediate", 13 | "_phantomChildren": {}, 14 | "_requested": { 15 | "type": "version", 16 | "registry": true, 17 | "raw": "setimmediate@1.0.5", 18 | "name": "setimmediate", 19 | "escapedName": "setimmediate", 20 | "rawSpec": "1.0.5", 21 | "saveSpec": null, 22 | "fetchSpec": "1.0.5" 23 | }, 24 | "_requiredBy": [ 25 | "/discord.js" 26 | ], 27 | "_resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", 28 | "_spec": "1.0.5", 29 | "_where": "C:\\Users\\Administrator\\Desktop\\North Gate Booster", 30 | "author": { 31 | "name": "YuzuJS" 32 | }, 33 | "bugs": { 34 | "url": "https://github.com/YuzuJS/setImmediate/issues" 35 | }, 36 | "contributors": [ 37 | { 38 | "name": "Domenic Denicola", 39 | "email": "d@domenic.me", 40 | "url": "https://domenic.me" 41 | }, 42 | { 43 | "name": "Donavon West", 44 | "email": "github@donavon.com", 45 | "url": "http://donavon.com" 46 | }, 47 | { 48 | "name": "Yaffle" 49 | } 50 | ], 51 | "description": "A shim for the setImmediate efficient script yielding API", 52 | "devDependencies": { 53 | "http-server": "~0.6.1", 54 | "jshint": "^2.5.0", 55 | "mocha": "~1.18.2", 56 | "opener": "^1.3", 57 | "zuul": "^1.6.4" 58 | }, 59 | "files": [ 60 | "setImmediate.js" 61 | ], 62 | "homepage": "https://github.com/YuzuJS/setImmediate#readme", 63 | "license": "MIT", 64 | "main": "setImmediate.js", 65 | "name": "setimmediate", 66 | "repository": { 67 | "type": "git", 68 | "url": "git+https://github.com/YuzuJS/setImmediate.git" 69 | }, 70 | "scripts": { 71 | "lint": "jshint setImmediate.js", 72 | "test": "mocha test/tests.js", 73 | "test-browser": "opener http://localhost:9008/__zuul && zuul test/tests.js --ui mocha-bdd --local 9008", 74 | "test-browser-only": "opener http://localhost:9007/test/browserOnly/index.html && http-server . -p 9007" 75 | }, 76 | "version": "1.0.5" 77 | } 78 | -------------------------------------------------------------------------------- /node_modules/discord.js/node_modules/tweetnacl/AUTHORS.md: -------------------------------------------------------------------------------- 1 | List of TweetNaCl.js authors 2 | ============================ 3 | 4 | Format: Name (GitHub username or URL) 5 | 6 | * Dmitry Chestnykh (@dchest) 7 | * Devi Mandiri (@devi) 8 | * AndSDev (@AndSDev) 9 | 10 | List of authors of third-party public domain code from which TweetNaCl.js code was derived 11 | ========================================================================================== 12 | 13 | [TweetNaCl](http://tweetnacl.cr.yp.to/) 14 | -------------------------------------- 15 | 16 | * Bernard van Gastel 17 | * Daniel J. Bernstein 18 | * Peter Schwabe 19 | * Sjaak Smetsers 20 | * Tanja Lange 21 | * Wesley Janssen 22 | 23 | 24 | [Poly1305-donna](https://github.com/floodyberry/poly1305-donna) 25 | -------------------------------------------------------------- 26 | 27 | * Andrew Moon (@floodyberry) 28 | -------------------------------------------------------------------------------- /node_modules/discord.js/node_modules/tweetnacl/LICENSE: -------------------------------------------------------------------------------- 1 | This is free and unencumbered software released into the public domain. 2 | 3 | Anyone is free to copy, modify, publish, use, compile, sell, or 4 | distribute this software, either in source code form or as a compiled 5 | binary, for any purpose, commercial or non-commercial, and by any 6 | means. 7 | 8 | In jurisdictions that recognize copyright laws, the author or authors 9 | of this software dedicate any and all copyright interest in the 10 | software to the public domain. We make this dedication for the benefit 11 | of the public at large and to the detriment of our heirs and 12 | successors. We intend this dedication to be an overt act of 13 | relinquishment in perpetuity of all present and future rights to this 14 | software under copyright law. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR 20 | OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 21 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 22 | OTHER DEALINGS IN THE SOFTWARE. 23 | 24 | For more information, please refer to 25 | -------------------------------------------------------------------------------- /node_modules/discord.js/node_modules/tweetnacl/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | # Important! 2 | 3 | If your contribution is not trivial (not a typo fix, etc.), we can only accept 4 | it if you dedicate your copyright for the contribution to the public domain. 5 | Make sure you understand what it means (see http://unlicense.org/)! If you 6 | agree, please add yourself to AUTHORS.md file, and include the following text 7 | to your pull request description or a comment in it: 8 | 9 | ------------------------------------------------------------------------------ 10 | 11 | I dedicate any and all copyright interest in this software to the 12 | public domain. I make this dedication for the benefit of the public at 13 | large and to the detriment of my heirs and successors. I intend this 14 | dedication to be an overt act of relinquishment in perpetuity of all 15 | present and future rights to this software under copyright law. 16 | 17 | Anyone is free to copy, modify, publish, use, compile, sell, or 18 | distribute this software, either in source code form or as a compiled 19 | binary, for any purpose, commercial or non-commercial, and by any 20 | means. 21 | -------------------------------------------------------------------------------- /node_modules/discord.js/node_modules/ws/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2011 Einar Otto Stangvik 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /node_modules/discord.js/node_modules/ws/browser.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = function () { 4 | throw new Error( 5 | 'ws does not work in the browser. Browser clients must use the native ' + 6 | 'WebSocket object' 7 | ); 8 | }; 9 | -------------------------------------------------------------------------------- /node_modules/discord.js/node_modules/ws/index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const WebSocket = require('./lib/websocket'); 4 | 5 | WebSocket.createWebSocketStream = require('./lib/stream'); 6 | WebSocket.Server = require('./lib/websocket-server'); 7 | WebSocket.Receiver = require('./lib/receiver'); 8 | WebSocket.Sender = require('./lib/sender'); 9 | 10 | module.exports = WebSocket; 11 | -------------------------------------------------------------------------------- /node_modules/discord.js/node_modules/ws/lib/constants.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = { 4 | BINARY_TYPES: ['nodebuffer', 'arraybuffer', 'fragments'], 5 | GUID: '258EAFA5-E914-47DA-95CA-C5AB0DC85B11', 6 | kStatusCode: Symbol('status-code'), 7 | kWebSocket: Symbol('websocket'), 8 | EMPTY_BUFFER: Buffer.alloc(0), 9 | NOOP: () => {} 10 | }; 11 | -------------------------------------------------------------------------------- /node_modules/discord.js/node_modules/ws/lib/limiter.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const kDone = Symbol('kDone'); 4 | const kRun = Symbol('kRun'); 5 | 6 | /** 7 | * A very simple job queue with adjustable concurrency. Adapted from 8 | * https://github.com/STRML/async-limiter 9 | */ 10 | class Limiter { 11 | /** 12 | * Creates a new `Limiter`. 13 | * 14 | * @param {Number} [concurrency=Infinity] The maximum number of jobs allowed 15 | * to run concurrently 16 | */ 17 | constructor(concurrency) { 18 | this[kDone] = () => { 19 | this.pending--; 20 | this[kRun](); 21 | }; 22 | this.concurrency = concurrency || Infinity; 23 | this.jobs = []; 24 | this.pending = 0; 25 | } 26 | 27 | /** 28 | * Adds a job to the queue. 29 | * 30 | * @param {Function} job The job to run 31 | * @public 32 | */ 33 | add(job) { 34 | this.jobs.push(job); 35 | this[kRun](); 36 | } 37 | 38 | /** 39 | * Removes a job from the queue and runs it if possible. 40 | * 41 | * @private 42 | */ 43 | [kRun]() { 44 | if (this.pending === this.concurrency) return; 45 | 46 | if (this.jobs.length) { 47 | const job = this.jobs.shift(); 48 | 49 | this.pending++; 50 | job(this[kDone]); 51 | } 52 | } 53 | } 54 | 55 | module.exports = Limiter; 56 | -------------------------------------------------------------------------------- /node_modules/discord.js/node_modules/ws/lib/validation.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | try { 4 | const isValidUTF8 = require('utf-8-validate'); 5 | 6 | exports.isValidUTF8 = 7 | typeof isValidUTF8 === 'object' 8 | ? isValidUTF8.Validation.isValidUTF8 // utf-8-validate@<3.0.0 9 | : isValidUTF8; 10 | } catch (e) /* istanbul ignore next */ { 11 | exports.isValidUTF8 = () => true; 12 | } 13 | 14 | /** 15 | * Checks if a status code is allowed in a close frame. 16 | * 17 | * @param {Number} code The status code 18 | * @return {Boolean} `true` if the status code is valid, else `false` 19 | * @public 20 | */ 21 | exports.isValidStatusCode = (code) => { 22 | return ( 23 | (code >= 1000 && 24 | code <= 1014 && 25 | code !== 1004 && 26 | code !== 1005 && 27 | code !== 1006) || 28 | (code >= 3000 && code <= 4999) 29 | ); 30 | }; 31 | -------------------------------------------------------------------------------- /node_modules/discord.js/src/WebSocket.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const { browser } = require('./util/Constants'); 4 | 5 | let erlpack; 6 | 7 | try { 8 | erlpack = require('erlpack'); 9 | if (!erlpack.pack) erlpack = null; 10 | } catch {} // eslint-disable-line no-empty 11 | 12 | let TextDecoder; 13 | 14 | if (browser) { 15 | TextDecoder = window.TextDecoder; // eslint-disable-line no-undef 16 | exports.WebSocket = window.WebSocket; // eslint-disable-line no-undef 17 | } else { 18 | TextDecoder = require('util').TextDecoder; 19 | exports.WebSocket = require('ws'); 20 | } 21 | 22 | const ab = new TextDecoder(); 23 | 24 | exports.encoding = erlpack ? 'etf' : 'json'; 25 | 26 | exports.pack = erlpack ? erlpack.pack : JSON.stringify; 27 | 28 | exports.unpack = (data, type) => { 29 | if (exports.encoding === 'json' || type === 'json') { 30 | if (typeof data !== 'string') { 31 | data = ab.decode(data); 32 | } 33 | return JSON.parse(data); 34 | } 35 | if (!Buffer.isBuffer(data)) data = Buffer.from(new Uint8Array(data)); 36 | return erlpack.unpack(data); 37 | }; 38 | 39 | exports.create = (gateway, query = {}, ...args) => { 40 | const [g, q] = gateway.split('?'); 41 | query.encoding = exports.encoding; 42 | query = new URLSearchParams(query); 43 | if (q) new URLSearchParams(q).forEach((v, k) => query.set(k, v)); 44 | const ws = new exports.WebSocket(`${g}?${query}`, ...args); 45 | if (browser) ws.binaryType = 'arraybuffer'; 46 | return ws; 47 | }; 48 | 49 | for (const state of ['CONNECTING', 'OPEN', 'CLOSING', 'CLOSED']) exports[state] = exports.WebSocket[state]; 50 | -------------------------------------------------------------------------------- /node_modules/discord.js/src/client/WebhookClient.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const BaseClient = require('./BaseClient'); 4 | const Webhook = require('../structures/Webhook'); 5 | 6 | /** 7 | * The webhook client. 8 | * @implements {Webhook} 9 | * @extends {BaseClient} 10 | */ 11 | class WebhookClient extends BaseClient { 12 | /** 13 | * @param {Snowflake} id ID of the webhook 14 | * @param {string} token Token of the webhook 15 | * @param {ClientOptions} [options] Options for the client 16 | * @example 17 | * // Create a new webhook and send a message 18 | * const hook = new Discord.WebhookClient('1234', 'abcdef'); 19 | * hook.send('This will send a message').catch(console.error); 20 | */ 21 | constructor(id, token, options) { 22 | super(options); 23 | Object.defineProperty(this, 'client', { value: this }); 24 | this.id = id; 25 | Object.defineProperty(this, 'token', { value: token, writable: true, configurable: true }); 26 | } 27 | } 28 | 29 | Webhook.applyToClass(WebhookClient); 30 | 31 | module.exports = WebhookClient; 32 | -------------------------------------------------------------------------------- /node_modules/discord.js/src/client/actions/ActionsManager.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | class ActionsManager { 4 | constructor(client) { 5 | this.client = client; 6 | 7 | this.register(require('./MessageCreate')); 8 | this.register(require('./MessageDelete')); 9 | this.register(require('./MessageDeleteBulk')); 10 | this.register(require('./MessageUpdate')); 11 | this.register(require('./MessageReactionAdd')); 12 | this.register(require('./MessageReactionRemove')); 13 | this.register(require('./MessageReactionRemoveAll')); 14 | this.register(require('./MessageReactionRemoveEmoji')); 15 | this.register(require('./ChannelCreate')); 16 | this.register(require('./ChannelDelete')); 17 | this.register(require('./ChannelUpdate')); 18 | this.register(require('./GuildDelete')); 19 | this.register(require('./GuildUpdate')); 20 | this.register(require('./InviteCreate')); 21 | this.register(require('./InviteDelete')); 22 | this.register(require('./GuildMemberRemove')); 23 | this.register(require('./GuildBanRemove')); 24 | this.register(require('./GuildRoleCreate')); 25 | this.register(require('./GuildRoleDelete')); 26 | this.register(require('./GuildRoleUpdate')); 27 | this.register(require('./PresenceUpdate')); 28 | this.register(require('./UserUpdate')); 29 | this.register(require('./VoiceStateUpdate')); 30 | this.register(require('./GuildEmojiCreate')); 31 | this.register(require('./GuildEmojiDelete')); 32 | this.register(require('./GuildEmojiUpdate')); 33 | this.register(require('./GuildEmojisUpdate')); 34 | this.register(require('./GuildRolesPositionUpdate')); 35 | this.register(require('./GuildChannelsPositionUpdate')); 36 | this.register(require('./GuildIntegrationsUpdate')); 37 | this.register(require('./WebhooksUpdate')); 38 | } 39 | 40 | register(Action) { 41 | this[Action.name.replace(/Action$/, '')] = new Action(this.client); 42 | } 43 | } 44 | 45 | module.exports = ActionsManager; 46 | -------------------------------------------------------------------------------- /node_modules/discord.js/src/client/actions/ChannelCreate.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const Action = require('./Action'); 4 | const { Events } = require('../../util/Constants'); 5 | 6 | class ChannelCreateAction extends Action { 7 | handle(data) { 8 | const client = this.client; 9 | const existing = client.channels.cache.has(data.id); 10 | const channel = client.channels.add(data); 11 | if (!existing && channel) { 12 | /** 13 | * Emitted whenever a channel is created. 14 | * @event Client#channelCreate 15 | * @param {DMChannel|GuildChannel} channel The channel that was created 16 | */ 17 | client.emit(Events.CHANNEL_CREATE, channel); 18 | } 19 | return { channel }; 20 | } 21 | } 22 | 23 | module.exports = ChannelCreateAction; 24 | -------------------------------------------------------------------------------- /node_modules/discord.js/src/client/actions/ChannelDelete.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const Action = require('./Action'); 4 | const DMChannel = require('../../structures/DMChannel'); 5 | const { Events } = require('../../util/Constants'); 6 | 7 | class ChannelDeleteAction extends Action { 8 | constructor(client) { 9 | super(client); 10 | this.deleted = new Map(); 11 | } 12 | 13 | handle(data) { 14 | const client = this.client; 15 | let channel = client.channels.cache.get(data.id); 16 | 17 | if (channel) { 18 | client.channels.remove(channel.id); 19 | channel.deleted = true; 20 | if (channel.messages && !(channel instanceof DMChannel)) { 21 | for (const message of channel.messages.cache.values()) { 22 | message.deleted = true; 23 | } 24 | } 25 | /** 26 | * Emitted whenever a channel is deleted. 27 | * @event Client#channelDelete 28 | * @param {DMChannel|GuildChannel} channel The channel that was deleted 29 | */ 30 | client.emit(Events.CHANNEL_DELETE, channel); 31 | } 32 | 33 | return { channel }; 34 | } 35 | } 36 | 37 | module.exports = ChannelDeleteAction; 38 | -------------------------------------------------------------------------------- /node_modules/discord.js/src/client/actions/ChannelUpdate.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const Action = require('./Action'); 4 | const Channel = require('../../structures/Channel'); 5 | const { ChannelTypes } = require('../../util/Constants'); 6 | 7 | class ChannelUpdateAction extends Action { 8 | handle(data) { 9 | const client = this.client; 10 | 11 | let channel = client.channels.cache.get(data.id); 12 | if (channel) { 13 | const old = channel._update(data); 14 | 15 | if (ChannelTypes[channel.type.toUpperCase()] !== data.type) { 16 | const newChannel = Channel.create(this.client, data, channel.guild); 17 | for (const [id, message] of channel.messages.cache) newChannel.messages.cache.set(id, message); 18 | newChannel._typing = new Map(channel._typing); 19 | channel = newChannel; 20 | this.client.channels.cache.set(channel.id, channel); 21 | } 22 | 23 | return { 24 | old, 25 | updated: channel, 26 | }; 27 | } 28 | 29 | return {}; 30 | } 31 | } 32 | 33 | module.exports = ChannelUpdateAction; 34 | -------------------------------------------------------------------------------- /node_modules/discord.js/src/client/actions/GuildBanRemove.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const Action = require('./Action'); 4 | const { Events } = require('../../util/Constants'); 5 | 6 | class GuildBanRemove extends Action { 7 | handle(data) { 8 | const client = this.client; 9 | const guild = client.guilds.cache.get(data.guild_id); 10 | const user = client.users.add(data.user); 11 | /** 12 | * Emitted whenever a member is unbanned from a guild. 13 | * @event Client#guildBanRemove 14 | * @param {Guild} guild The guild that the unban occurred in 15 | * @param {User} user The user that was unbanned 16 | */ 17 | if (guild && user) client.emit(Events.GUILD_BAN_REMOVE, guild, user); 18 | } 19 | } 20 | 21 | module.exports = GuildBanRemove; 22 | -------------------------------------------------------------------------------- /node_modules/discord.js/src/client/actions/GuildChannelsPositionUpdate.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const Action = require('./Action'); 4 | 5 | class GuildChannelsPositionUpdate extends Action { 6 | handle(data) { 7 | const client = this.client; 8 | 9 | const guild = client.guilds.cache.get(data.guild_id); 10 | if (guild) { 11 | for (const partialChannel of data.channels) { 12 | const channel = guild.channels.cache.get(partialChannel.id); 13 | if (channel) channel.rawPosition = partialChannel.position; 14 | } 15 | } 16 | 17 | return { guild }; 18 | } 19 | } 20 | 21 | module.exports = GuildChannelsPositionUpdate; 22 | -------------------------------------------------------------------------------- /node_modules/discord.js/src/client/actions/GuildDelete.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const Action = require('./Action'); 4 | const { Events } = require('../../util/Constants'); 5 | 6 | class GuildDeleteAction extends Action { 7 | constructor(client) { 8 | super(client); 9 | this.deleted = new Map(); 10 | } 11 | 12 | handle(data) { 13 | const client = this.client; 14 | 15 | let guild = client.guilds.cache.get(data.id); 16 | if (guild) { 17 | for (const channel of guild.channels.cache.values()) { 18 | if (channel.type === 'text') channel.stopTyping(true); 19 | } 20 | 21 | if (data.unavailable) { 22 | // Guild is unavailable 23 | guild.available = false; 24 | 25 | /** 26 | * Emitted whenever a guild becomes unavailable, likely due to a server outage. 27 | * @event Client#guildUnavailable 28 | * @param {Guild} guild The guild that has become unavailable 29 | */ 30 | client.emit(Events.GUILD_UNAVAILABLE, guild); 31 | 32 | // Stops the GuildDelete packet thinking a guild was actually deleted, 33 | // handles emitting of event itself 34 | return { 35 | guild: null, 36 | }; 37 | } 38 | 39 | for (const channel of guild.channels.cache.values()) this.client.channels.remove(channel.id); 40 | if (guild.voice && guild.voice.connection) guild.voice.connection.disconnect(); 41 | 42 | // Delete guild 43 | client.guilds.cache.delete(guild.id); 44 | guild.deleted = true; 45 | 46 | /** 47 | * Emitted whenever a guild kicks the client or the guild is deleted/left. 48 | * @event Client#guildDelete 49 | * @param {Guild} guild The guild that was deleted 50 | */ 51 | client.emit(Events.GUILD_DELETE, guild); 52 | 53 | this.deleted.set(guild.id, guild); 54 | this.scheduleForDeletion(guild.id); 55 | } else { 56 | guild = this.deleted.get(data.id) || null; 57 | } 58 | 59 | return { guild }; 60 | } 61 | 62 | scheduleForDeletion(id) { 63 | this.client.setTimeout(() => this.deleted.delete(id), this.client.options.restWsBridgeTimeout); 64 | } 65 | } 66 | 67 | module.exports = GuildDeleteAction; 68 | -------------------------------------------------------------------------------- /node_modules/discord.js/src/client/actions/GuildEmojiCreate.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const Action = require('./Action'); 4 | const { Events } = require('../../util/Constants'); 5 | 6 | class GuildEmojiCreateAction extends Action { 7 | handle(guild, createdEmoji) { 8 | const emoji = guild.emojis.add(createdEmoji); 9 | /** 10 | * Emitted whenever a custom emoji is created in a guild. 11 | * @event Client#emojiCreate 12 | * @param {GuildEmoji} emoji The emoji that was created 13 | */ 14 | this.client.emit(Events.GUILD_EMOJI_CREATE, emoji); 15 | return { emoji }; 16 | } 17 | } 18 | 19 | module.exports = GuildEmojiCreateAction; 20 | -------------------------------------------------------------------------------- /node_modules/discord.js/src/client/actions/GuildEmojiDelete.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const Action = require('./Action'); 4 | const { Events } = require('../../util/Constants'); 5 | 6 | class GuildEmojiDeleteAction extends Action { 7 | handle(emoji) { 8 | emoji.guild.emojis.cache.delete(emoji.id); 9 | emoji.deleted = true; 10 | /** 11 | * Emitted whenever a custom emoji is deleted in a guild. 12 | * @event Client#emojiDelete 13 | * @param {GuildEmoji} emoji The emoji that was deleted 14 | */ 15 | this.client.emit(Events.GUILD_EMOJI_DELETE, emoji); 16 | return { emoji }; 17 | } 18 | } 19 | 20 | module.exports = GuildEmojiDeleteAction; 21 | -------------------------------------------------------------------------------- /node_modules/discord.js/src/client/actions/GuildEmojiUpdate.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const Action = require('./Action'); 4 | const { Events } = require('../../util/Constants'); 5 | 6 | class GuildEmojiUpdateAction extends Action { 7 | handle(current, data) { 8 | const old = current._update(data); 9 | /** 10 | * Emitted whenever a custom emoji is updated in a guild. 11 | * @event Client#emojiUpdate 12 | * @param {GuildEmoji} oldEmoji The old emoji 13 | * @param {GuildEmoji} newEmoji The new emoji 14 | */ 15 | this.client.emit(Events.GUILD_EMOJI_UPDATE, old, current); 16 | return { emoji: current }; 17 | } 18 | } 19 | 20 | module.exports = GuildEmojiUpdateAction; 21 | -------------------------------------------------------------------------------- /node_modules/discord.js/src/client/actions/GuildEmojisUpdate.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const Action = require('./Action'); 4 | 5 | class GuildEmojisUpdateAction extends Action { 6 | handle(data) { 7 | const guild = this.client.guilds.cache.get(data.guild_id); 8 | if (!guild || !guild.emojis) return; 9 | 10 | const deletions = new Map(guild.emojis.cache); 11 | 12 | for (const emoji of data.emojis) { 13 | // Determine type of emoji event 14 | const cachedEmoji = guild.emojis.cache.get(emoji.id); 15 | if (cachedEmoji) { 16 | deletions.delete(emoji.id); 17 | if (!cachedEmoji.equals(emoji)) { 18 | // Emoji updated 19 | this.client.actions.GuildEmojiUpdate.handle(cachedEmoji, emoji); 20 | } 21 | } else { 22 | // Emoji added 23 | this.client.actions.GuildEmojiCreate.handle(guild, emoji); 24 | } 25 | } 26 | 27 | for (const emoji of deletions.values()) { 28 | // Emoji deleted 29 | this.client.actions.GuildEmojiDelete.handle(emoji); 30 | } 31 | } 32 | } 33 | 34 | module.exports = GuildEmojisUpdateAction; 35 | -------------------------------------------------------------------------------- /node_modules/discord.js/src/client/actions/GuildIntegrationsUpdate.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const Action = require('./Action'); 4 | const { Events } = require('../../util/Constants'); 5 | 6 | class GuildIntegrationsUpdate extends Action { 7 | handle(data) { 8 | const client = this.client; 9 | const guild = client.guilds.cache.get(data.guild_id); 10 | /** 11 | * Emitted whenever a guild integration is updated 12 | * @event Client#guildIntegrationsUpdate 13 | * @param {Guild} guild The guild whose integrations were updated 14 | */ 15 | if (guild) client.emit(Events.GUILD_INTEGRATIONS_UPDATE, guild); 16 | } 17 | } 18 | 19 | module.exports = GuildIntegrationsUpdate; 20 | -------------------------------------------------------------------------------- /node_modules/discord.js/src/client/actions/GuildMemberRemove.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const Action = require('./Action'); 4 | const { Events, Status } = require('../../util/Constants'); 5 | 6 | class GuildMemberRemoveAction extends Action { 7 | handle(data, shard) { 8 | const client = this.client; 9 | const guild = client.guilds.cache.get(data.guild_id); 10 | let member = null; 11 | if (guild) { 12 | member = this.getMember(data, guild); 13 | guild.memberCount--; 14 | if (member) { 15 | member.deleted = true; 16 | guild.members.cache.delete(member.id); 17 | /** 18 | * Emitted whenever a member leaves a guild, or is kicked. 19 | * @event Client#guildMemberRemove 20 | * @param {GuildMember} member The member that has left/been kicked from the guild 21 | */ 22 | if (shard.status === Status.READY) client.emit(Events.GUILD_MEMBER_REMOVE, member); 23 | } 24 | guild.voiceStates.cache.delete(data.user.id); 25 | } 26 | return { guild, member }; 27 | } 28 | } 29 | 30 | module.exports = GuildMemberRemoveAction; 31 | -------------------------------------------------------------------------------- /node_modules/discord.js/src/client/actions/GuildRoleCreate.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const Action = require('./Action'); 4 | const { Events } = require('../../util/Constants'); 5 | 6 | class GuildRoleCreate extends Action { 7 | handle(data) { 8 | const client = this.client; 9 | const guild = client.guilds.cache.get(data.guild_id); 10 | let role; 11 | if (guild) { 12 | const already = guild.roles.cache.has(data.role.id); 13 | role = guild.roles.add(data.role); 14 | /** 15 | * Emitted whenever a role is created. 16 | * @event Client#roleCreate 17 | * @param {Role} role The role that was created 18 | */ 19 | if (!already) client.emit(Events.GUILD_ROLE_CREATE, role); 20 | } 21 | return { role }; 22 | } 23 | } 24 | 25 | module.exports = GuildRoleCreate; 26 | -------------------------------------------------------------------------------- /node_modules/discord.js/src/client/actions/GuildRoleDelete.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const Action = require('./Action'); 4 | const { Events } = require('../../util/Constants'); 5 | 6 | class GuildRoleDeleteAction extends Action { 7 | handle(data) { 8 | const client = this.client; 9 | const guild = client.guilds.cache.get(data.guild_id); 10 | let role; 11 | 12 | if (guild) { 13 | role = guild.roles.cache.get(data.role_id); 14 | if (role) { 15 | guild.roles.cache.delete(data.role_id); 16 | role.deleted = true; 17 | /** 18 | * Emitted whenever a guild role is deleted. 19 | * @event Client#roleDelete 20 | * @param {Role} role The role that was deleted 21 | */ 22 | client.emit(Events.GUILD_ROLE_DELETE, role); 23 | } 24 | } 25 | 26 | return { role }; 27 | } 28 | } 29 | 30 | module.exports = GuildRoleDeleteAction; 31 | -------------------------------------------------------------------------------- /node_modules/discord.js/src/client/actions/GuildRoleUpdate.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const Action = require('./Action'); 4 | const { Events } = require('../../util/Constants'); 5 | 6 | class GuildRoleUpdateAction extends Action { 7 | handle(data) { 8 | const client = this.client; 9 | const guild = client.guilds.cache.get(data.guild_id); 10 | 11 | if (guild) { 12 | let old = null; 13 | 14 | const role = guild.roles.cache.get(data.role.id); 15 | if (role) { 16 | old = role._update(data.role); 17 | /** 18 | * Emitted whenever a guild role is updated. 19 | * @event Client#roleUpdate 20 | * @param {Role} oldRole The role before the update 21 | * @param {Role} newRole The role after the update 22 | */ 23 | client.emit(Events.GUILD_ROLE_UPDATE, old, role); 24 | } 25 | 26 | return { 27 | old, 28 | updated: role, 29 | }; 30 | } 31 | 32 | return { 33 | old: null, 34 | updated: null, 35 | }; 36 | } 37 | } 38 | 39 | module.exports = GuildRoleUpdateAction; 40 | -------------------------------------------------------------------------------- /node_modules/discord.js/src/client/actions/GuildRolesPositionUpdate.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const Action = require('./Action'); 4 | 5 | class GuildRolesPositionUpdate extends Action { 6 | handle(data) { 7 | const client = this.client; 8 | 9 | const guild = client.guilds.cache.get(data.guild_id); 10 | if (guild) { 11 | for (const partialRole of data.roles) { 12 | const role = guild.roles.cache.get(partialRole.id); 13 | if (role) role.rawPosition = partialRole.position; 14 | } 15 | } 16 | 17 | return { guild }; 18 | } 19 | } 20 | 21 | module.exports = GuildRolesPositionUpdate; 22 | -------------------------------------------------------------------------------- /node_modules/discord.js/src/client/actions/GuildUpdate.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const Action = require('./Action'); 4 | const { Events } = require('../../util/Constants'); 5 | 6 | class GuildUpdateAction extends Action { 7 | handle(data) { 8 | const client = this.client; 9 | 10 | const guild = client.guilds.cache.get(data.id); 11 | if (guild) { 12 | const old = guild._update(data); 13 | /** 14 | * Emitted whenever a guild is updated - e.g. name change. 15 | * @event Client#guildUpdate 16 | * @param {Guild} oldGuild The guild before the update 17 | * @param {Guild} newGuild The guild after the update 18 | */ 19 | client.emit(Events.GUILD_UPDATE, old, guild); 20 | return { 21 | old, 22 | updated: guild, 23 | }; 24 | } 25 | 26 | return { 27 | old: null, 28 | updated: null, 29 | }; 30 | } 31 | } 32 | 33 | module.exports = GuildUpdateAction; 34 | -------------------------------------------------------------------------------- /node_modules/discord.js/src/client/actions/InviteCreate.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const Action = require('./Action'); 4 | const Invite = require('../../structures/Invite'); 5 | const { Events } = require('../../util/Constants'); 6 | 7 | class InviteCreateAction extends Action { 8 | handle(data) { 9 | const client = this.client; 10 | const channel = client.channels.cache.get(data.channel_id); 11 | const guild = client.guilds.cache.get(data.guild_id); 12 | if (!channel && !guild) return false; 13 | 14 | const inviteData = Object.assign(data, { channel, guild }); 15 | const invite = new Invite(client, inviteData); 16 | /** 17 | * Emitted when an invite is created. 18 | * This event only triggers if the client has `MANAGE_GUILD` permissions for the guild, 19 | * or `MANAGE_CHANNEL` permissions for the channel. 20 | * @event Client#inviteCreate 21 | * @param {Invite} invite The invite that was created 22 | */ 23 | client.emit(Events.INVITE_CREATE, invite); 24 | return { invite }; 25 | } 26 | } 27 | 28 | module.exports = InviteCreateAction; 29 | -------------------------------------------------------------------------------- /node_modules/discord.js/src/client/actions/InviteDelete.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const Action = require('./Action'); 4 | const Invite = require('../../structures/Invite'); 5 | const { Events } = require('../../util/Constants'); 6 | 7 | class InviteDeleteAction extends Action { 8 | handle(data) { 9 | const client = this.client; 10 | const channel = client.channels.cache.get(data.channel_id); 11 | const guild = client.guilds.cache.get(data.guild_id); 12 | if (!channel && !guild) return false; 13 | 14 | const inviteData = Object.assign(data, { channel, guild }); 15 | const invite = new Invite(client, inviteData); 16 | 17 | /** 18 | * Emitted when an invite is deleted. 19 | * This event only triggers if the client has `MANAGE_GUILD` permissions for the guild, 20 | * or `MANAGE_CHANNEL` permissions for the channel. 21 | * @event Client#inviteDelete 22 | * @param {Invite} invite The invite that was deleted 23 | */ 24 | client.emit(Events.INVITE_DELETE, invite); 25 | return { invite }; 26 | } 27 | } 28 | 29 | module.exports = InviteDeleteAction; 30 | -------------------------------------------------------------------------------- /node_modules/discord.js/src/client/actions/MessageCreate.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const Action = require('./Action'); 4 | const { Events } = require('../../util/Constants'); 5 | 6 | class MessageCreateAction extends Action { 7 | handle(data) { 8 | const client = this.client; 9 | const channel = client.channels.cache.get(data.channel_id); 10 | if (channel) { 11 | const existing = channel.messages.cache.get(data.id); 12 | if (existing) return { message: existing }; 13 | const message = channel.messages.add(data); 14 | const user = message.author; 15 | let member = message.member; 16 | channel.lastMessageID = data.id; 17 | if (user) { 18 | user.lastMessageID = data.id; 19 | user.lastMessageChannelID = channel.id; 20 | } 21 | if (member) { 22 | member.lastMessageID = data.id; 23 | member.lastMessageChannelID = channel.id; 24 | } 25 | 26 | /** 27 | * Emitted whenever a message is created. 28 | * @event Client#message 29 | * @param {Message} message The created message 30 | */ 31 | client.emit(Events.MESSAGE_CREATE, message); 32 | return { message }; 33 | } 34 | 35 | return {}; 36 | } 37 | } 38 | 39 | module.exports = MessageCreateAction; 40 | -------------------------------------------------------------------------------- /node_modules/discord.js/src/client/actions/MessageDelete.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const Action = require('./Action'); 4 | const { Events } = require('../../util/Constants'); 5 | 6 | class MessageDeleteAction extends Action { 7 | handle(data) { 8 | const client = this.client; 9 | const channel = this.getChannel(data); 10 | let message; 11 | if (channel) { 12 | message = this.getMessage(data, channel); 13 | if (message) { 14 | channel.messages.cache.delete(message.id); 15 | message.deleted = true; 16 | /** 17 | * Emitted whenever a message is deleted. 18 | * @event Client#messageDelete 19 | * @param {Message} message The deleted message 20 | */ 21 | client.emit(Events.MESSAGE_DELETE, message); 22 | } 23 | } 24 | 25 | return { message }; 26 | } 27 | } 28 | 29 | module.exports = MessageDeleteAction; 30 | -------------------------------------------------------------------------------- /node_modules/discord.js/src/client/actions/MessageDeleteBulk.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const Action = require('./Action'); 4 | const Collection = require('../../util/Collection'); 5 | const { Events } = require('../../util/Constants'); 6 | 7 | class MessageDeleteBulkAction extends Action { 8 | handle(data) { 9 | const client = this.client; 10 | const channel = client.channels.cache.get(data.channel_id); 11 | 12 | if (channel) { 13 | const ids = data.ids; 14 | const messages = new Collection(); 15 | for (const id of ids) { 16 | const message = this.getMessage( 17 | { 18 | id, 19 | guild_id: data.guild_id, 20 | }, 21 | channel, 22 | false, 23 | ); 24 | if (message) { 25 | message.deleted = true; 26 | messages.set(message.id, message); 27 | channel.messages.cache.delete(id); 28 | } 29 | } 30 | 31 | /** 32 | * Emitted whenever messages are deleted in bulk. 33 | * @event Client#messageDeleteBulk 34 | * @param {Collection} messages The deleted messages, mapped by their ID 35 | */ 36 | if (messages.size > 0) client.emit(Events.MESSAGE_BULK_DELETE, messages); 37 | return { messages }; 38 | } 39 | return {}; 40 | } 41 | } 42 | 43 | module.exports = MessageDeleteBulkAction; 44 | -------------------------------------------------------------------------------- /node_modules/discord.js/src/client/actions/MessageReactionAdd.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const Action = require('./Action'); 4 | const { Events } = require('../../util/Constants'); 5 | const { PartialTypes } = require('../../util/Constants'); 6 | 7 | /* 8 | { user_id: 'id', 9 | message_id: 'id', 10 | emoji: { name: '�', id: null }, 11 | channel_id: 'id' } } 12 | */ 13 | 14 | class MessageReactionAdd extends Action { 15 | handle(data) { 16 | if (!data.emoji) return false; 17 | 18 | const user = this.getUser(data); 19 | if (!user) return false; 20 | 21 | // Verify channel 22 | const channel = this.getChannel(data); 23 | if (!channel || channel.type === 'voice') return false; 24 | 25 | // Verify message 26 | const message = this.getMessage(data, channel); 27 | if (!message) return false; 28 | 29 | // Verify reaction 30 | if (message.partial && !this.client.options.partials.includes(PartialTypes.REACTION)) return false; 31 | const existing = message.reactions.cache.get(data.emoji.id || data.emoji.name); 32 | if (existing && existing.users.cache.has(user.id)) return { message, reaction: existing, user }; 33 | const reaction = message.reactions.add({ 34 | emoji: data.emoji, 35 | count: message.partial ? null : 0, 36 | me: user.id === this.client.user.id, 37 | }); 38 | if (!reaction) return false; 39 | reaction._add(user); 40 | /** 41 | * Emitted whenever a reaction is added to a cached message. 42 | * @event Client#messageReactionAdd 43 | * @param {MessageReaction} messageReaction The reaction object 44 | * @param {User} user The user that applied the guild or reaction emoji 45 | */ 46 | this.client.emit(Events.MESSAGE_REACTION_ADD, reaction, user); 47 | 48 | return { message, reaction, user }; 49 | } 50 | } 51 | 52 | module.exports = MessageReactionAdd; 53 | -------------------------------------------------------------------------------- /node_modules/discord.js/src/client/actions/MessageReactionRemove.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const Action = require('./Action'); 4 | const { Events } = require('../../util/Constants'); 5 | 6 | /* 7 | { user_id: 'id', 8 | message_id: 'id', 9 | emoji: { name: '�', id: null }, 10 | channel_id: 'id' } } 11 | */ 12 | 13 | class MessageReactionRemove extends Action { 14 | handle(data) { 15 | if (!data.emoji) return false; 16 | 17 | const user = this.getUser(data); 18 | if (!user) return false; 19 | 20 | // Verify channel 21 | const channel = this.getChannel(data); 22 | if (!channel || channel.type === 'voice') return false; 23 | 24 | // Verify message 25 | const message = this.getMessage(data, channel); 26 | if (!message) return false; 27 | 28 | // Verify reaction 29 | const reaction = this.getReaction(data, message, user); 30 | if (!reaction) return false; 31 | reaction._remove(user); 32 | /** 33 | * Emitted whenever a reaction is removed from a cached message. 34 | * @event Client#messageReactionRemove 35 | * @param {MessageReaction} messageReaction The reaction object 36 | * @param {User} user The user whose emoji or reaction emoji was removed 37 | */ 38 | this.client.emit(Events.MESSAGE_REACTION_REMOVE, reaction, user); 39 | 40 | return { message, reaction, user }; 41 | } 42 | } 43 | 44 | module.exports = MessageReactionRemove; 45 | -------------------------------------------------------------------------------- /node_modules/discord.js/src/client/actions/MessageReactionRemoveAll.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const Action = require('./Action'); 4 | const { Events } = require('../../util/Constants'); 5 | 6 | class MessageReactionRemoveAll extends Action { 7 | handle(data) { 8 | // Verify channel 9 | const channel = this.getChannel(data); 10 | if (!channel || channel.type === 'voice') return false; 11 | 12 | // Verify message 13 | const message = this.getMessage(data, channel); 14 | if (!message) return false; 15 | 16 | message.reactions.cache.clear(); 17 | this.client.emit(Events.MESSAGE_REACTION_REMOVE_ALL, message); 18 | 19 | return { message }; 20 | } 21 | } 22 | 23 | /** 24 | * Emitted whenever all reactions are removed from a cached message. 25 | * @event Client#messageReactionRemoveAll 26 | * @param {Message} message The message the reactions were removed from 27 | */ 28 | 29 | module.exports = MessageReactionRemoveAll; 30 | -------------------------------------------------------------------------------- /node_modules/discord.js/src/client/actions/MessageReactionRemoveEmoji.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const Action = require('./Action'); 4 | const { Events } = require('../../util/Constants'); 5 | 6 | class MessageReactionRemoveEmoji extends Action { 7 | handle(data) { 8 | const channel = this.getChannel(data); 9 | if (!channel || channel.type === 'voice') return false; 10 | 11 | const message = this.getMessage(data, channel); 12 | if (!message) return false; 13 | 14 | const reaction = this.getReaction(data, message); 15 | if (!reaction) return false; 16 | if (!message.partial) message.reactions.cache.delete(reaction.emoji.id || reaction.emoji.name); 17 | 18 | /** 19 | * Emitted when a bot removes an emoji reaction from a cached message. 20 | * @event Client#messageReactionRemoveEmoji 21 | * @param {MessageReaction} reaction The reaction that was removed 22 | */ 23 | this.client.emit(Events.MESSAGE_REACTION_REMOVE_EMOJI, reaction); 24 | return { reaction }; 25 | } 26 | } 27 | 28 | module.exports = MessageReactionRemoveEmoji; 29 | -------------------------------------------------------------------------------- /node_modules/discord.js/src/client/actions/MessageUpdate.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const Action = require('./Action'); 4 | 5 | class MessageUpdateAction extends Action { 6 | handle(data) { 7 | const channel = this.getChannel(data); 8 | if (channel) { 9 | const { id, channel_id, guild_id, author, timestamp, type } = data; 10 | const message = this.getMessage({ id, channel_id, guild_id, author, timestamp, type }, channel); 11 | if (message) { 12 | message.patch(data); 13 | return { 14 | old: message._edits[0], 15 | updated: message, 16 | }; 17 | } 18 | } 19 | 20 | return {}; 21 | } 22 | } 23 | 24 | module.exports = MessageUpdateAction; 25 | -------------------------------------------------------------------------------- /node_modules/discord.js/src/client/actions/PresenceUpdate.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const Action = require('./Action'); 4 | const { Events } = require('../../util/Constants'); 5 | 6 | class PresenceUpdateAction extends Action { 7 | handle(data) { 8 | let user = this.client.users.cache.get(data.user.id); 9 | if (!user && data.user.username) user = this.client.users.add(data.user); 10 | if (!user) return; 11 | 12 | if (data.user && data.user.username) { 13 | if (!user.equals(data.user)) this.client.actions.UserUpdate.handle(data.user); 14 | } 15 | 16 | const guild = this.client.guilds.cache.get(data.guild_id); 17 | if (!guild) return; 18 | 19 | let oldPresence = guild.presences.cache.get(user.id); 20 | if (oldPresence) oldPresence = oldPresence._clone(); 21 | let member = guild.members.cache.get(user.id); 22 | if (!member && data.status !== 'offline') { 23 | member = guild.members.add({ 24 | user, 25 | roles: data.roles, 26 | deaf: false, 27 | mute: false, 28 | }); 29 | this.client.emit(Events.GUILD_MEMBER_AVAILABLE, member); 30 | } 31 | guild.presences.add(Object.assign(data, { guild })); 32 | if (member && this.client.listenerCount(Events.PRESENCE_UPDATE)) { 33 | /** 34 | * Emitted whenever a guild member's presence (e.g. status, activity) is changed. 35 | * @event Client#presenceUpdate 36 | * @param {?Presence} oldPresence The presence before the update, if one at all 37 | * @param {Presence} newPresence The presence after the update 38 | */ 39 | this.client.emit(Events.PRESENCE_UPDATE, oldPresence, member.presence); 40 | } 41 | } 42 | } 43 | 44 | module.exports = PresenceUpdateAction; 45 | -------------------------------------------------------------------------------- /node_modules/discord.js/src/client/actions/UserUpdate.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const Action = require('./Action'); 4 | const { Events } = require('../../util/Constants'); 5 | 6 | class UserUpdateAction extends Action { 7 | handle(data) { 8 | const client = this.client; 9 | 10 | const newUser = client.users.cache.get(data.id); 11 | const oldUser = newUser._update(data); 12 | 13 | if (!oldUser.equals(newUser)) { 14 | /** 15 | * Emitted whenever a user's details (e.g. username) are changed. 16 | * Triggered by the Discord gateway events USER_UPDATE, GUILD_MEMBER_UPDATE, and PRESENCE_UPDATE. 17 | * @event Client#userUpdate 18 | * @param {User} oldUser The user before the update 19 | * @param {User} newUser The user after the update 20 | */ 21 | client.emit(Events.USER_UPDATE, oldUser, newUser); 22 | return { 23 | old: oldUser, 24 | updated: newUser, 25 | }; 26 | } 27 | 28 | return { 29 | old: null, 30 | updated: null, 31 | }; 32 | } 33 | } 34 | 35 | module.exports = UserUpdateAction; 36 | -------------------------------------------------------------------------------- /node_modules/discord.js/src/client/actions/VoiceStateUpdate.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const Action = require('./Action'); 4 | const { Events } = require('../../util/Constants'); 5 | const Structures = require('../../util/Structures'); 6 | 7 | class VoiceStateUpdate extends Action { 8 | handle(data) { 9 | const client = this.client; 10 | const guild = client.guilds.cache.get(data.guild_id); 11 | if (guild) { 12 | const VoiceState = Structures.get('VoiceState'); 13 | // Update the state 14 | const oldState = guild.voiceStates.cache.has(data.user_id) 15 | ? guild.voiceStates.cache.get(data.user_id)._clone() 16 | : new VoiceState(guild, { user_id: data.user_id }); 17 | 18 | const newState = guild.voiceStates.add(data); 19 | 20 | // Get the member 21 | let member = guild.members.cache.get(data.user_id); 22 | if (member && data.member) { 23 | member._patch(data.member); 24 | } else if (data.member && data.member.user && data.member.joined_at) { 25 | member = guild.members.add(data.member); 26 | } 27 | 28 | // Emit event 29 | if (member && member.user.id === client.user.id) { 30 | client.emit('debug', `[VOICE] received voice state update: ${JSON.stringify(data)}`); 31 | client.voice.onVoiceStateUpdate(data); 32 | } 33 | 34 | /** 35 | * Emitted whenever a member changes voice state - e.g. joins/leaves a channel, mutes/unmutes. 36 | * @event Client#voiceStateUpdate 37 | * @param {VoiceState} oldState The voice state before the update 38 | * @param {VoiceState} newState The voice state after the update 39 | */ 40 | client.emit(Events.VOICE_STATE_UPDATE, oldState, newState); 41 | } 42 | } 43 | } 44 | 45 | module.exports = VoiceStateUpdate; 46 | -------------------------------------------------------------------------------- /node_modules/discord.js/src/client/actions/WebhooksUpdate.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const Action = require('./Action'); 4 | const { Events } = require('../../util/Constants'); 5 | 6 | class WebhooksUpdate extends Action { 7 | handle(data) { 8 | const client = this.client; 9 | const channel = client.channels.cache.get(data.channel_id); 10 | /** 11 | * Emitted whenever a guild text channel has its webhooks changed. 12 | * @event Client#webhookUpdate 13 | * @param {TextChannel} channel The channel that had a webhook update 14 | */ 15 | if (channel) client.emit(Events.WEBHOOKS_UPDATE, channel); 16 | } 17 | } 18 | 19 | module.exports = WebhooksUpdate; 20 | -------------------------------------------------------------------------------- /node_modules/discord.js/src/client/voice/dispatcher/BroadcastDispatcher.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const StreamDispatcher = require('./StreamDispatcher'); 4 | 5 | /** 6 | * The class that sends voice packet data to the voice connection. 7 | * @implements {VolumeInterface} 8 | * @extends {StreamDispatcher} 9 | */ 10 | class BroadcastDispatcher extends StreamDispatcher { 11 | constructor(player, options, streams) { 12 | super(player, options, streams); 13 | this.broadcast = player.broadcast; 14 | } 15 | 16 | _write(chunk, enc, done) { 17 | if (!this.startTime) this.startTime = Date.now(); 18 | for (const dispatcher of this.broadcast.subscribers) { 19 | dispatcher._write(chunk, enc); 20 | } 21 | this._step(done); 22 | } 23 | 24 | _destroy(err, cb) { 25 | if (this.player.dispatcher === this) this.player.dispatcher = null; 26 | const { streams } = this; 27 | if (streams.opus) streams.opus.unpipe(this); 28 | if (streams.ffmpeg) streams.ffmpeg.destroy(); 29 | super._destroy(err, cb); 30 | } 31 | 32 | /** 33 | * Set the bitrate of the current Opus encoder if using a compatible Opus stream. 34 | * @param {number} value New bitrate, in kbps 35 | * If set to 'auto', 48kbps will be used 36 | * @returns {boolean} true if the bitrate has been successfully changed. 37 | */ 38 | setBitrate(value) { 39 | if (!value || !this.streams.opus || !this.streams.opus.setBitrate) return false; 40 | const bitrate = value === 'auto' ? 48 : value; 41 | this.streams.opus.setBitrate(bitrate * 1000); 42 | return true; 43 | } 44 | } 45 | 46 | module.exports = BroadcastDispatcher; 47 | -------------------------------------------------------------------------------- /node_modules/discord.js/src/client/voice/player/AudioPlayer.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const BasePlayer = require('./BasePlayer'); 4 | 5 | /** 6 | * An Audio Player for a Voice Connection. 7 | * @private 8 | * @extends {BasePlayer} 9 | */ 10 | class AudioPlayer extends BasePlayer { 11 | constructor(voiceConnection) { 12 | super(); 13 | /** 14 | * The voice connection that the player serves 15 | * @type {VoiceConnection} 16 | */ 17 | this.voiceConnection = voiceConnection; 18 | } 19 | 20 | playBroadcast(broadcast, options) { 21 | const dispatcher = this.createDispatcher(options, { broadcast }); 22 | broadcast.add(dispatcher); 23 | return dispatcher; 24 | } 25 | } 26 | 27 | module.exports = AudioPlayer; 28 | -------------------------------------------------------------------------------- /node_modules/discord.js/src/client/voice/player/BroadcastAudioPlayer.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const BasePlayer = require('./BasePlayer'); 4 | const BroadcastDispatcher = require('../dispatcher/BroadcastDispatcher'); 5 | 6 | /** 7 | * An Audio Player for a Voice Connection. 8 | * @private 9 | * @extends {BasePlayer} 10 | */ 11 | class AudioPlayer extends BasePlayer { 12 | constructor(broadcast) { 13 | super(); 14 | /** 15 | * The broadcast that the player serves 16 | * @type {VoiceBroadcast} 17 | */ 18 | this.broadcast = broadcast; 19 | } 20 | 21 | createDispatcher(options, streams) { 22 | this.destroyDispatcher(); 23 | const dispatcher = (this.dispatcher = new BroadcastDispatcher(this, options, streams)); 24 | return dispatcher; 25 | } 26 | } 27 | 28 | module.exports = AudioPlayer; 29 | -------------------------------------------------------------------------------- /node_modules/discord.js/src/client/voice/receiver/Receiver.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const EventEmitter = require('events'); 4 | const prism = require('prism-media'); 5 | const PacketHandler = require('./PacketHandler'); 6 | const { Error } = require('../../../errors'); 7 | 8 | /** 9 | * Receives audio packets from a voice connection. 10 | * @example 11 | * const receiver = connection.createReceiver(); 12 | * // opusStream is a ReadableStream - that means you could play it back to a voice channel if you wanted to! 13 | * const opusStream = receiver.createStream(user); 14 | */ 15 | class VoiceReceiver extends EventEmitter { 16 | constructor(connection) { 17 | super(); 18 | this.connection = connection; 19 | this.packets = new PacketHandler(this); 20 | /** 21 | * Emitted whenever there is a warning 22 | * @event VoiceReceiver#debug 23 | * @param {Error|string} error The error or message to debug 24 | */ 25 | this.packets.on('error', err => this.emit('debug', err)); 26 | } 27 | 28 | /** 29 | * Options passed to `VoiceReceiver#createStream`. 30 | * @typedef {Object} ReceiveStreamOptions 31 | * @property {string} [mode='opus'] The mode for audio output. This defaults to opus, meaning discord.js won't decode 32 | * the packets for you. You can set this to 'pcm' so that the stream's output will be 16-bit little-endian stereo 33 | * audio 34 | * @property {string} [end='silence'] When the stream should be destroyed. If `silence`, this will be when the user 35 | * stops talking. Otherwise, if `manual`, this should be handled by you. 36 | */ 37 | 38 | /** 39 | * Creates a new audio receiving stream. If a stream already exists for a user, then that stream will be returned 40 | * rather than generating a new one. 41 | * @param {UserResolvable} user The user to start listening to. 42 | * @param {ReceiveStreamOptions} options Options. 43 | * @returns {ReadableStream} 44 | */ 45 | createStream(user, { mode = 'opus', end = 'silence' } = {}) { 46 | user = this.connection.client.users.resolve(user); 47 | if (!user) throw new Error('VOICE_USER_MISSING'); 48 | const stream = this.packets.makeStream(user.id, end); 49 | if (mode === 'pcm') { 50 | const decoder = new prism.opus.Decoder({ channels: 2, rate: 48000, frameSize: 960 }); 51 | stream.pipe(decoder); 52 | return decoder; 53 | } 54 | return stream; 55 | } 56 | } 57 | 58 | module.exports = VoiceReceiver; 59 | -------------------------------------------------------------------------------- /node_modules/discord.js/src/client/voice/util/Secretbox.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const libs = { 4 | sodium: sodium => ({ 5 | open: sodium.api.crypto_secretbox_open_easy, 6 | close: sodium.api.crypto_secretbox_easy, 7 | random: n => sodium.randombytes_buf(n), 8 | }), 9 | 'libsodium-wrappers': sodium => ({ 10 | open: sodium.crypto_secretbox_open_easy, 11 | close: sodium.crypto_secretbox_easy, 12 | random: n => sodium.randombytes_buf(n), 13 | }), 14 | tweetnacl: tweetnacl => ({ 15 | open: tweetnacl.secretbox.open, 16 | close: tweetnacl.secretbox, 17 | random: n => tweetnacl.randomBytes(n), 18 | }), 19 | }; 20 | 21 | exports.methods = {}; 22 | 23 | (async () => { 24 | for (const libName of Object.keys(libs)) { 25 | try { 26 | const lib = require(libName); 27 | if (libName === 'libsodium-wrappers' && lib.ready) await lib.ready; // eslint-disable-line no-await-in-loop 28 | exports.methods = libs[libName](lib); 29 | break; 30 | } catch {} // eslint-disable-line no-empty 31 | } 32 | })(); 33 | -------------------------------------------------------------------------------- /node_modules/discord.js/src/client/voice/util/Silence.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const { Readable } = require('stream'); 4 | 5 | const SILENCE_FRAME = Buffer.from([0xf8, 0xff, 0xfe]); 6 | 7 | class Silence extends Readable { 8 | _read() { 9 | this.push(SILENCE_FRAME); 10 | } 11 | } 12 | 13 | module.exports = Silence; 14 | -------------------------------------------------------------------------------- /node_modules/discord.js/src/client/websocket/handlers/CHANNEL_CREATE.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = (client, packet) => { 4 | client.actions.ChannelCreate.handle(packet.d); 5 | }; 6 | -------------------------------------------------------------------------------- /node_modules/discord.js/src/client/websocket/handlers/CHANNEL_DELETE.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = (client, packet) => { 4 | client.actions.ChannelDelete.handle(packet.d); 5 | }; 6 | -------------------------------------------------------------------------------- /node_modules/discord.js/src/client/websocket/handlers/CHANNEL_PINS_UPDATE.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const { Events } = require('../../../util/Constants'); 4 | 5 | module.exports = (client, { d: data }) => { 6 | const channel = client.channels.cache.get(data.channel_id); 7 | const time = new Date(data.last_pin_timestamp); 8 | 9 | if (channel && !Number.isNaN(time.getTime())) { 10 | // Discord sends null for last_pin_timestamp if the last pinned message was removed 11 | channel.lastPinTimestamp = time.getTime() || null; 12 | 13 | /** 14 | * Emitted whenever the pins of a channel are updated. Due to the nature of the WebSocket event, 15 | * not much information can be provided easily here - you need to manually check the pins yourself. 16 | * @event Client#channelPinsUpdate 17 | * @param {DMChannel|TextChannel} channel The channel that the pins update occurred in 18 | * @param {Date} time The time of the pins update 19 | */ 20 | client.emit(Events.CHANNEL_PINS_UPDATE, channel, time); 21 | } 22 | }; 23 | -------------------------------------------------------------------------------- /node_modules/discord.js/src/client/websocket/handlers/CHANNEL_UPDATE.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const { Events } = require('../../../util/Constants'); 4 | 5 | module.exports = (client, packet) => { 6 | const { old, updated } = client.actions.ChannelUpdate.handle(packet.d); 7 | if (old && updated) { 8 | /** 9 | * Emitted whenever a channel is updated - e.g. name change, topic change, channel type change. 10 | * @event Client#channelUpdate 11 | * @param {DMChannel|GuildChannel} oldChannel The channel before the update 12 | * @param {DMChannel|GuildChannel} newChannel The channel after the update 13 | */ 14 | client.emit(Events.CHANNEL_UPDATE, old, updated); 15 | } 16 | }; 17 | -------------------------------------------------------------------------------- /node_modules/discord.js/src/client/websocket/handlers/GUILD_BAN_ADD.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const { Events } = require('../../../util/Constants'); 4 | 5 | module.exports = (client, { d: data }) => { 6 | const guild = client.guilds.cache.get(data.guild_id); 7 | const user = client.users.add(data.user); 8 | 9 | /** 10 | * Emitted whenever a member is banned from a guild. 11 | * @event Client#guildBanAdd 12 | * @param {Guild} guild The guild that the ban occurred in 13 | * @param {User} user The user that was banned 14 | */ 15 | if (guild && user) client.emit(Events.GUILD_BAN_ADD, guild, user); 16 | }; 17 | -------------------------------------------------------------------------------- /node_modules/discord.js/src/client/websocket/handlers/GUILD_BAN_REMOVE.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = (client, packet) => { 4 | client.actions.GuildBanRemove.handle(packet.d); 5 | }; 6 | -------------------------------------------------------------------------------- /node_modules/discord.js/src/client/websocket/handlers/GUILD_CREATE.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const { Events, Status } = require('../../../util/Constants'); 4 | 5 | module.exports = async (client, { d: data }, shard) => { 6 | let guild = client.guilds.cache.get(data.id); 7 | if (guild) { 8 | if (!guild.available && !data.unavailable) { 9 | // A newly available guild 10 | guild._patch(data); 11 | // If the client was ready before and we had unavailable guilds, fetch them 12 | if (client.ws.status === Status.READY && client.options.fetchAllMembers) { 13 | await guild.members 14 | .fetch() 15 | .catch(err => client.emit(Events.DEBUG, `Failed to fetch all members: ${err}\n${err.stack}`)); 16 | } 17 | } 18 | } else { 19 | // A new guild 20 | data.shardID = shard.id; 21 | guild = client.guilds.add(data); 22 | if (client.ws.status === Status.READY) { 23 | /** 24 | * Emitted whenever the client joins a guild. 25 | * @event Client#guildCreate 26 | * @param {Guild} guild The created guild 27 | */ 28 | if (client.options.fetchAllMembers) { 29 | await guild.members 30 | .fetch() 31 | .catch(err => client.emit(Events.DEBUG, `Failed to fetch all members: ${err}\n${err.stack}`)); 32 | } 33 | client.emit(Events.GUILD_CREATE, guild); 34 | } 35 | } 36 | }; 37 | -------------------------------------------------------------------------------- /node_modules/discord.js/src/client/websocket/handlers/GUILD_DELETE.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = (client, packet) => { 4 | client.actions.GuildDelete.handle(packet.d); 5 | }; 6 | -------------------------------------------------------------------------------- /node_modules/discord.js/src/client/websocket/handlers/GUILD_EMOJIS_UPDATE.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = (client, packet) => { 4 | client.actions.GuildEmojisUpdate.handle(packet.d); 5 | }; 6 | -------------------------------------------------------------------------------- /node_modules/discord.js/src/client/websocket/handlers/GUILD_INTEGRATIONS_UPDATE.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = (client, packet) => { 4 | client.actions.GuildIntegrationsUpdate.handle(packet.d); 5 | }; 6 | -------------------------------------------------------------------------------- /node_modules/discord.js/src/client/websocket/handlers/GUILD_MEMBERS_CHUNK.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const Collection = require('../../../util/Collection'); 4 | const { Events } = require('../../../util/Constants'); 5 | 6 | module.exports = (client, { d: data }) => { 7 | const guild = client.guilds.cache.get(data.guild_id); 8 | if (!guild) return; 9 | const members = new Collection(); 10 | 11 | for (const member of data.members) members.set(member.user.id, guild.members.add(member)); 12 | if (data.presences) { 13 | for (const presence of data.presences) guild.presences.add(Object.assign(presence, { guild })); 14 | } 15 | /** 16 | * Emitted whenever a chunk of guild members is received (all members come from the same guild). 17 | * @event Client#guildMembersChunk 18 | * @param {Collection} members The members in the chunk 19 | * @param {Guild} guild The guild related to the member chunk 20 | * @param {Object} chunk Properties of the received chunk 21 | * @param {number} chunk.index Index of the received chunk 22 | * @param {number} chunk.count Number of chunks the client should receive 23 | * @param {?string} chunk.nonce Nonce for this chunk 24 | */ 25 | client.emit(Events.GUILD_MEMBERS_CHUNK, members, guild, { 26 | count: data.chunk_count, 27 | index: data.chunk_index, 28 | nonce: data.nonce, 29 | }); 30 | }; 31 | -------------------------------------------------------------------------------- /node_modules/discord.js/src/client/websocket/handlers/GUILD_MEMBER_ADD.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const { Events, Status } = require('../../../util/Constants'); 4 | 5 | module.exports = (client, { d: data }, shard) => { 6 | const guild = client.guilds.cache.get(data.guild_id); 7 | if (guild) { 8 | guild.memberCount++; 9 | const member = guild.members.add(data); 10 | if (shard.status === Status.READY) { 11 | /** 12 | * Emitted whenever a user joins a guild. 13 | * @event Client#guildMemberAdd 14 | * @param {GuildMember} member The member that has joined a guild 15 | */ 16 | client.emit(Events.GUILD_MEMBER_ADD, member); 17 | } 18 | } 19 | }; 20 | -------------------------------------------------------------------------------- /node_modules/discord.js/src/client/websocket/handlers/GUILD_MEMBER_REMOVE.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = (client, packet, shard) => { 4 | client.actions.GuildMemberRemove.handle(packet.d, shard); 5 | }; 6 | -------------------------------------------------------------------------------- /node_modules/discord.js/src/client/websocket/handlers/GUILD_MEMBER_UPDATE.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const { Status, Events } = require('../../../util/Constants'); 4 | 5 | module.exports = (client, { d: data }, shard) => { 6 | let user = client.users.cache.get(data.user.id); 7 | if (!user && data.user.username) user = client.users.add(data.user); 8 | if (user && data.user && data.user.username) { 9 | if (!user.equals(data.user)) client.actions.UserUpdate.handle(data.user); 10 | } 11 | 12 | const guild = client.guilds.cache.get(data.guild_id); 13 | if (guild) { 14 | const member = guild.members.cache.get(data.user.id); 15 | if (member) { 16 | const old = member._update(data); 17 | if (shard.status === Status.READY) { 18 | /** 19 | * Emitted whenever a guild member changes - i.e. new role, removed role, nickname. 20 | * Also emitted when the user's details (e.g. username) change. 21 | * @event Client#guildMemberUpdate 22 | * @param {GuildMember} oldMember The member before the update 23 | * @param {GuildMember} newMember The member after the update 24 | */ 25 | client.emit(Events.GUILD_MEMBER_UPDATE, old, member); 26 | } 27 | } 28 | } 29 | }; 30 | -------------------------------------------------------------------------------- /node_modules/discord.js/src/client/websocket/handlers/GUILD_ROLE_CREATE.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = (client, packet) => { 4 | client.actions.GuildRoleCreate.handle(packet.d); 5 | }; 6 | -------------------------------------------------------------------------------- /node_modules/discord.js/src/client/websocket/handlers/GUILD_ROLE_DELETE.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = (client, packet) => { 4 | client.actions.GuildRoleDelete.handle(packet.d); 5 | }; 6 | -------------------------------------------------------------------------------- /node_modules/discord.js/src/client/websocket/handlers/GUILD_ROLE_UPDATE.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = (client, packet) => { 4 | client.actions.GuildRoleUpdate.handle(packet.d); 5 | }; 6 | -------------------------------------------------------------------------------- /node_modules/discord.js/src/client/websocket/handlers/GUILD_UPDATE.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = (client, packet) => { 4 | client.actions.GuildUpdate.handle(packet.d); 5 | }; 6 | -------------------------------------------------------------------------------- /node_modules/discord.js/src/client/websocket/handlers/INVITE_CREATE.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = (client, packet) => { 4 | client.actions.InviteCreate.handle(packet.d); 5 | }; 6 | -------------------------------------------------------------------------------- /node_modules/discord.js/src/client/websocket/handlers/INVITE_DELETE.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = (client, packet) => { 4 | client.actions.InviteDelete.handle(packet.d); 5 | }; 6 | -------------------------------------------------------------------------------- /node_modules/discord.js/src/client/websocket/handlers/MESSAGE_CREATE.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = (client, packet) => { 4 | client.actions.MessageCreate.handle(packet.d); 5 | }; 6 | -------------------------------------------------------------------------------- /node_modules/discord.js/src/client/websocket/handlers/MESSAGE_DELETE.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = (client, packet) => { 4 | client.actions.MessageDelete.handle(packet.d); 5 | }; 6 | -------------------------------------------------------------------------------- /node_modules/discord.js/src/client/websocket/handlers/MESSAGE_DELETE_BULK.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = (client, packet) => { 4 | client.actions.MessageDeleteBulk.handle(packet.d); 5 | }; 6 | -------------------------------------------------------------------------------- /node_modules/discord.js/src/client/websocket/handlers/MESSAGE_REACTION_ADD.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = (client, packet) => { 4 | client.actions.MessageReactionAdd.handle(packet.d); 5 | }; 6 | -------------------------------------------------------------------------------- /node_modules/discord.js/src/client/websocket/handlers/MESSAGE_REACTION_REMOVE.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = (client, packet) => { 4 | client.actions.MessageReactionRemove.handle(packet.d); 5 | }; 6 | -------------------------------------------------------------------------------- /node_modules/discord.js/src/client/websocket/handlers/MESSAGE_REACTION_REMOVE_ALL.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = (client, packet) => { 4 | client.actions.MessageReactionRemoveAll.handle(packet.d); 5 | }; 6 | -------------------------------------------------------------------------------- /node_modules/discord.js/src/client/websocket/handlers/MESSAGE_REACTION_REMOVE_EMOJI.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = (client, packet) => { 4 | client.actions.MessageReactionRemoveEmoji.handle(packet.d); 5 | }; 6 | -------------------------------------------------------------------------------- /node_modules/discord.js/src/client/websocket/handlers/MESSAGE_UPDATE.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const { Events } = require('../../../util/Constants'); 4 | 5 | module.exports = (client, packet) => { 6 | const { old, updated } = client.actions.MessageUpdate.handle(packet.d); 7 | if (old && updated) { 8 | /** 9 | * Emitted whenever a message is updated - e.g. embed or content change. 10 | * @event Client#messageUpdate 11 | * @param {Message} oldMessage The message before the update 12 | * @param {Message} newMessage The message after the update 13 | */ 14 | client.emit(Events.MESSAGE_UPDATE, old, updated); 15 | } 16 | }; 17 | -------------------------------------------------------------------------------- /node_modules/discord.js/src/client/websocket/handlers/PRESENCE_UPDATE.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = (client, packet) => { 4 | client.actions.PresenceUpdate.handle(packet.d); 5 | }; 6 | -------------------------------------------------------------------------------- /node_modules/discord.js/src/client/websocket/handlers/READY.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | let ClientUser; 4 | 5 | module.exports = (client, { d: data }, shard) => { 6 | if (client.user) { 7 | client.user._patch(data.user); 8 | } else { 9 | if (!ClientUser) ClientUser = require('../../../structures/ClientUser'); 10 | const clientUser = new ClientUser(client, data.user); 11 | client.user = clientUser; 12 | client.users.cache.set(clientUser.id, clientUser); 13 | } 14 | 15 | for (const guild of data.guilds) { 16 | guild.shardID = shard.id; 17 | client.guilds.add(guild); 18 | } 19 | 20 | shard.checkReady(); 21 | }; 22 | -------------------------------------------------------------------------------- /node_modules/discord.js/src/client/websocket/handlers/RESUMED.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const { Events } = require('../../../util/Constants'); 4 | 5 | module.exports = (client, packet, shard) => { 6 | const replayed = shard.sequence - shard.closeSequence; 7 | /** 8 | * Emitted when a shard resumes successfully. 9 | * @event Client#shardResume 10 | * @param {number} id The shard ID that resumed 11 | * @param {number} replayedEvents The amount of replayed events 12 | */ 13 | client.emit(Events.SHARD_RESUME, shard.id, replayed); 14 | }; 15 | -------------------------------------------------------------------------------- /node_modules/discord.js/src/client/websocket/handlers/TYPING_START.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const { Events } = require('../../../util/Constants'); 4 | const textBasedChannelTypes = ['dm', 'text', 'news']; 5 | 6 | module.exports = (client, { d: data }) => { 7 | const channel = client.channels.cache.get(data.channel_id); 8 | const user = client.users.cache.get(data.user_id); 9 | const timestamp = new Date(data.timestamp * 1000); 10 | 11 | if (channel && user) { 12 | if (!textBasedChannelTypes.includes(channel.type)) { 13 | client.emit(Events.WARN, `Discord sent a typing packet to a ${channel.type} channel ${channel.id}`); 14 | return; 15 | } 16 | 17 | if (channel._typing.has(user.id)) { 18 | const typing = channel._typing.get(user.id); 19 | 20 | typing.lastTimestamp = timestamp; 21 | typing.elapsedTime = Date.now() - typing.since; 22 | client.clearTimeout(typing.timeout); 23 | typing.timeout = tooLate(channel, user); 24 | } else { 25 | const since = new Date(); 26 | const lastTimestamp = new Date(); 27 | channel._typing.set(user.id, { 28 | user, 29 | since, 30 | lastTimestamp, 31 | elapsedTime: Date.now() - since, 32 | timeout: tooLate(channel, user), 33 | }); 34 | 35 | /** 36 | * Emitted whenever a user starts typing in a channel. 37 | * @event Client#typingStart 38 | * @param {Channel} channel The channel the user started typing in 39 | * @param {User} user The user that started typing 40 | */ 41 | client.emit(Events.TYPING_START, channel, user); 42 | } 43 | } 44 | }; 45 | 46 | function tooLate(channel, user) { 47 | return channel.client.setTimeout(() => { 48 | channel._typing.delete(user.id); 49 | }, 10000); 50 | } 51 | -------------------------------------------------------------------------------- /node_modules/discord.js/src/client/websocket/handlers/USER_UPDATE.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = (client, packet) => { 4 | client.actions.UserUpdate.handle(packet.d); 5 | }; 6 | -------------------------------------------------------------------------------- /node_modules/discord.js/src/client/websocket/handlers/VOICE_SERVER_UPDATE.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = (client, packet) => { 4 | client.emit('debug', `[VOICE] received voice server: ${JSON.stringify(packet)}`); 5 | client.voice.onVoiceServer(packet.d); 6 | }; 7 | -------------------------------------------------------------------------------- /node_modules/discord.js/src/client/websocket/handlers/VOICE_STATE_UPDATE.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = (client, packet) => { 4 | client.actions.VoiceStateUpdate.handle(packet.d); 5 | }; 6 | -------------------------------------------------------------------------------- /node_modules/discord.js/src/client/websocket/handlers/WEBHOOKS_UPDATE.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = (client, packet) => { 4 | client.actions.WebhooksUpdate.handle(packet.d); 5 | }; 6 | -------------------------------------------------------------------------------- /node_modules/discord.js/src/client/websocket/handlers/index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const { WSEvents } = require('../../../util/Constants'); 4 | 5 | const handlers = {}; 6 | 7 | for (const name of Object.keys(WSEvents)) { 8 | try { 9 | handlers[name] = require(`./${name}.js`); 10 | } catch {} // eslint-disable-line no-empty 11 | } 12 | 13 | module.exports = handlers; 14 | -------------------------------------------------------------------------------- /node_modules/discord.js/src/errors/DJSError.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | // Heavily inspired by node's `internal/errors` module 4 | 5 | const kCode = Symbol('code'); 6 | const messages = new Map(); 7 | 8 | /** 9 | * Extend an error of some sort into a DiscordjsError. 10 | * @param {Error} Base Base error to extend 11 | * @returns {DiscordjsError} 12 | */ 13 | function makeDiscordjsError(Base) { 14 | return class DiscordjsError extends Base { 15 | constructor(key, ...args) { 16 | super(message(key, args)); 17 | this[kCode] = key; 18 | if (Error.captureStackTrace) Error.captureStackTrace(this, DiscordjsError); 19 | } 20 | 21 | get name() { 22 | return `${super.name} [${this[kCode]}]`; 23 | } 24 | 25 | get code() { 26 | return this[kCode]; 27 | } 28 | }; 29 | } 30 | 31 | /** 32 | * Format the message for an error. 33 | * @param {string} key Error key 34 | * @param {Array<*>} args Arguments to pass for util format or as function args 35 | * @returns {string} Formatted string 36 | */ 37 | function message(key, args) { 38 | if (typeof key !== 'string') throw new Error('Error message key must be a string'); 39 | const msg = messages.get(key); 40 | if (!msg) throw new Error(`An invalid error message key was used: ${key}.`); 41 | if (typeof msg === 'function') return msg(...args); 42 | if (args === undefined || args.length === 0) return msg; 43 | args.unshift(msg); 44 | return String(...args); 45 | } 46 | 47 | /** 48 | * Register an error code and message. 49 | * @param {string} sym Unique name for the error 50 | * @param {*} val Value of the error 51 | */ 52 | function register(sym, val) { 53 | messages.set(sym, typeof val === 'function' ? val : String(val)); 54 | } 55 | 56 | module.exports = { 57 | register, 58 | Error: makeDiscordjsError(Error), 59 | TypeError: makeDiscordjsError(TypeError), 60 | RangeError: makeDiscordjsError(RangeError), 61 | }; 62 | -------------------------------------------------------------------------------- /node_modules/discord.js/src/errors/index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = require('./DJSError'); 4 | module.exports.Messages = require('./Messages'); 5 | -------------------------------------------------------------------------------- /node_modules/discord.js/src/managers/PresenceManager.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const BaseManager = require('./BaseManager'); 4 | const { Presence } = require('../structures/Presence'); 5 | 6 | /** 7 | * Manages API methods for Presences and holds their cache. 8 | * @extends {BaseManager} 9 | */ 10 | class PresenceManager extends BaseManager { 11 | constructor(client, iterable) { 12 | super(client, iterable, Presence); 13 | } 14 | 15 | /** 16 | * The cache of Presences 17 | * @type {Collection} 18 | * @name PresenceManager#cache 19 | */ 20 | 21 | add(data, cache) { 22 | const existing = this.cache.get(data.user.id); 23 | return existing ? existing.patch(data) : super.add(data, cache, { id: data.user.id }); 24 | } 25 | 26 | /** 27 | * Data that can be resolved to a Presence object. This can be: 28 | * * A Presence 29 | * * A UserResolvable 30 | * * A Snowflake 31 | * @typedef {Presence|UserResolvable|Snowflake} PresenceResolvable 32 | */ 33 | 34 | /** 35 | * Resolves a PresenceResolvable to a Presence object. 36 | * @param {PresenceResolvable} presence The presence resolvable to resolve 37 | * @returns {?Presence} 38 | */ 39 | resolve(presence) { 40 | const presenceResolvable = super.resolve(presence); 41 | if (presenceResolvable) return presenceResolvable; 42 | const UserResolvable = this.client.users.resolveID(presence); 43 | return super.resolve(UserResolvable) || null; 44 | } 45 | 46 | /** 47 | * Resolves a PresenceResolvable to a Presence ID string. 48 | * @param {PresenceResolvable} presence The presence resolvable to resolve 49 | * @returns {?Snowflake} 50 | */ 51 | resolveID(presence) { 52 | const presenceResolvable = super.resolveID(presence); 53 | if (presenceResolvable) return presenceResolvable; 54 | const userResolvable = this.client.users.resolveID(presence); 55 | return this.cache.has(userResolvable) ? userResolvable : null; 56 | } 57 | } 58 | 59 | module.exports = PresenceManager; 60 | -------------------------------------------------------------------------------- /node_modules/discord.js/src/managers/ReactionManager.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const BaseManager = require('./BaseManager'); 4 | const MessageReaction = require('../structures/MessageReaction'); 5 | 6 | /** 7 | * Manages API methods for reactions and holds their cache. 8 | * @extends {BaseManager} 9 | */ 10 | class ReactionManager extends BaseManager { 11 | constructor(message, iterable) { 12 | super(message.client, iterable, MessageReaction); 13 | 14 | /** 15 | * The message that this manager belongs to 16 | * @type {Message} 17 | */ 18 | this.message = message; 19 | } 20 | 21 | add(data, cache) { 22 | return super.add(data, cache, { id: data.emoji.id || data.emoji.name, extras: [this.message] }); 23 | } 24 | 25 | /** 26 | * The reaction cache of this manager 27 | * @type {Collection} 28 | * @name ReactionManager#cache 29 | */ 30 | 31 | /** 32 | * Data that can be resolved to a MessageReaction object. This can be: 33 | * * A MessageReaction 34 | * * A Snowflake 35 | * @typedef {MessageReaction|Snowflake} MessageReactionResolvable 36 | */ 37 | 38 | /** 39 | * Resolves a MessageReactionResolvable to a MessageReaction object. 40 | * @method resolve 41 | * @memberof ReactionManager 42 | * @instance 43 | * @param {MessageReactionResolvable} reaction The MessageReaction to resolve 44 | * @returns {?MessageReaction} 45 | */ 46 | 47 | /** 48 | * Resolves a MessageReactionResolvable to a MessageReaction ID string. 49 | * @method resolveID 50 | * @memberof ReactionManager 51 | * @instance 52 | * @param {MessageReactionResolvable} reaction The MessageReaction to resolve 53 | * @returns {?Snowflake} 54 | */ 55 | 56 | /** 57 | * Removes all reactions from a message. 58 | * @returns {Promise} 59 | */ 60 | removeAll() { 61 | return this.client.api 62 | .channels(this.message.channel.id) 63 | .messages(this.message.id) 64 | .reactions.delete() 65 | .then(() => this.message); 66 | } 67 | } 68 | 69 | module.exports = ReactionManager; 70 | -------------------------------------------------------------------------------- /node_modules/discord.js/src/managers/UserManager.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const BaseManager = require('./BaseManager'); 4 | const GuildMember = require('../structures/GuildMember'); 5 | const Message = require('../structures/Message'); 6 | const User = require('../structures/User'); 7 | 8 | /** 9 | * Manages API methods for users and stores their cache. 10 | * @extends {BaseManager} 11 | */ 12 | class UserManager extends BaseManager { 13 | constructor(client, iterable) { 14 | super(client, iterable, User); 15 | } 16 | 17 | /** 18 | * The cache of this manager 19 | * @type {Collection} 20 | * @name UserManager#cache 21 | */ 22 | 23 | /** 24 | * Data that resolves to give a User object. This can be: 25 | * * A User object 26 | * * A Snowflake 27 | * * A Message object (resolves to the message author) 28 | * * A GuildMember object 29 | * @typedef {User|Snowflake|Message|GuildMember} UserResolvable 30 | */ 31 | 32 | /** 33 | * Resolves a UserResolvable to a User object. 34 | * @param {UserResolvable} user The UserResolvable to identify 35 | * @returns {?User} 36 | */ 37 | resolve(user) { 38 | if (user instanceof GuildMember) return user.user; 39 | if (user instanceof Message) return user.author; 40 | return super.resolve(user); 41 | } 42 | 43 | /** 44 | * Resolves a UserResolvable to a user ID string. 45 | * @param {UserResolvable} user The UserResolvable to identify 46 | * @returns {?Snowflake} 47 | */ 48 | resolveID(user) { 49 | if (user instanceof GuildMember) return user.user.id; 50 | if (user instanceof Message) return user.author.id; 51 | return super.resolveID(user); 52 | } 53 | 54 | /** 55 | * Obtains a user from Discord, or the user cache if it's already available. 56 | * @param {Snowflake} id ID of the user 57 | * @param {boolean} [cache=true] Whether to cache the new user object if it isn't already 58 | * @param {boolean} [force=false] Whether to skip the cache check and request the API 59 | * @returns {Promise} 60 | */ 61 | async fetch(id, cache = true, force = false) { 62 | if (!force) { 63 | const existing = this.cache.get(id); 64 | if (existing && !existing.partial) return existing; 65 | } 66 | 67 | const data = await this.client.api.users(id).get(); 68 | return this.add(data, cache); 69 | } 70 | } 71 | 72 | module.exports = UserManager; 73 | -------------------------------------------------------------------------------- /node_modules/discord.js/src/managers/VoiceStateManager.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const BaseManager = require('./BaseManager'); 4 | 5 | /** 6 | * Manages API methods for VoiceStates and stores their cache. 7 | * @extends {BaseManager} 8 | */ 9 | class VoiceStateManager extends BaseManager { 10 | constructor(guild, iterable) { 11 | super(guild.client, iterable, { name: 'VoiceState' }); 12 | /** 13 | * The guild this manager belongs to 14 | * @type {Guild} 15 | */ 16 | this.guild = guild; 17 | } 18 | 19 | /** 20 | * The cache of this manager 21 | * @type {Collection} 22 | * @name VoiceStateManager#cache 23 | */ 24 | 25 | add(data, cache = true) { 26 | const existing = this.cache.get(data.user_id); 27 | if (existing) return existing._patch(data); 28 | 29 | const entry = new this.holds(this.guild, data); 30 | if (cache) this.cache.set(data.user_id, entry); 31 | return entry; 32 | } 33 | } 34 | 35 | module.exports = VoiceStateManager; 36 | -------------------------------------------------------------------------------- /node_modules/discord.js/src/rest/APIRouter.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const noop = () => {}; // eslint-disable-line no-empty-function 4 | const methods = ['get', 'post', 'delete', 'patch', 'put']; 5 | const reflectors = [ 6 | 'toString', 7 | 'valueOf', 8 | 'inspect', 9 | 'constructor', 10 | Symbol.toPrimitive, 11 | Symbol.for('nodejs.util.inspect.custom'), 12 | ]; 13 | 14 | function buildRoute(manager) { 15 | const route = ['']; 16 | const handler = { 17 | get(target, name) { 18 | if (reflectors.includes(name)) return () => route.join('/'); 19 | if (methods.includes(name)) { 20 | const routeBucket = []; 21 | for (let i = 0; i < route.length; i++) { 22 | // Reactions routes and sub-routes all share the same bucket 23 | if (route[i - 1] === 'reactions') break; 24 | // Literal IDs should only be taken account if they are the Major ID (the Channel/Guild ID) 25 | if (/\d{16,19}/g.test(route[i]) && !/channels|guilds/.test(route[i - 1])) routeBucket.push(':id'); 26 | // All other parts of the route should be considered as part of the bucket identifier 27 | else routeBucket.push(route[i]); 28 | } 29 | return options => 30 | manager.request( 31 | name, 32 | route.join('/'), 33 | Object.assign( 34 | { 35 | versioned: manager.versioned, 36 | route: routeBucket.join('/'), 37 | }, 38 | options, 39 | ), 40 | ); 41 | } 42 | route.push(name); 43 | return new Proxy(noop, handler); 44 | }, 45 | apply(target, _, args) { 46 | route.push(...args.filter(x => x != null)); // eslint-disable-line eqeqeq 47 | return new Proxy(noop, handler); 48 | }, 49 | }; 50 | return new Proxy(noop, handler); 51 | } 52 | 53 | module.exports = buildRoute; 54 | -------------------------------------------------------------------------------- /node_modules/discord.js/src/rest/DiscordAPIError.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | /** 4 | * Represents an error from the Discord API. 5 | * @extends Error 6 | */ 7 | class DiscordAPIError extends Error { 8 | constructor(path, error, method, status) { 9 | super(); 10 | const flattened = this.constructor.flattenErrors(error.errors || error).join('\n'); 11 | this.name = 'DiscordAPIError'; 12 | this.message = error.message && flattened ? `${error.message}\n${flattened}` : error.message || flattened; 13 | 14 | /** 15 | * The HTTP method used for the request 16 | * @type {string} 17 | */ 18 | this.method = method; 19 | 20 | /** 21 | * The path of the request relative to the HTTP endpoint 22 | * @type {string} 23 | */ 24 | this.path = path; 25 | 26 | /** 27 | * HTTP error code returned by Discord 28 | * @type {number} 29 | */ 30 | this.code = error.code; 31 | 32 | /** 33 | * The HTTP status code 34 | * @type {number} 35 | */ 36 | this.httpStatus = status; 37 | } 38 | 39 | /** 40 | * Flattens an errors object returned from the API into an array. 41 | * @param {Object} obj Discord errors object 42 | * @param {string} [key] Used internally to determine key names of nested fields 43 | * @returns {string[]} 44 | * @private 45 | */ 46 | static flattenErrors(obj, key = '') { 47 | let messages = []; 48 | 49 | for (const [k, v] of Object.entries(obj)) { 50 | if (k === 'message') continue; 51 | const newKey = key ? (isNaN(k) ? `${key}.${k}` : `${key}[${k}]`) : k; 52 | 53 | if (v._errors) { 54 | messages.push(`${newKey}: ${v._errors.map(e => e.message).join(' ')}`); 55 | } else if (v.code || v.message) { 56 | messages.push(`${v.code ? `${v.code}: ` : ''}${v.message}`.trim()); 57 | } else if (typeof v === 'string') { 58 | messages.push(v); 59 | } else { 60 | messages = messages.concat(this.flattenErrors(v, newKey)); 61 | } 62 | } 63 | 64 | return messages; 65 | } 66 | } 67 | 68 | module.exports = DiscordAPIError; 69 | -------------------------------------------------------------------------------- /node_modules/discord.js/src/rest/HTTPError.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | /** 4 | * Represents a HTTP error from a request. 5 | * @extends Error 6 | */ 7 | class HTTPError extends Error { 8 | constructor(message, name, code, method, path) { 9 | super(message); 10 | 11 | /** 12 | * The name of the error 13 | * @type {string} 14 | */ 15 | this.name = name; 16 | 17 | /** 18 | * HTTP error code returned from the request 19 | * @type {number} 20 | */ 21 | this.code = code || 500; 22 | 23 | /** 24 | * The HTTP method used for the request 25 | * @type {string} 26 | */ 27 | this.method = method; 28 | 29 | /** 30 | * The path of the request relative to the HTTP endpoint 31 | * @type {string} 32 | */ 33 | this.path = path; 34 | } 35 | } 36 | 37 | module.exports = HTTPError; 38 | -------------------------------------------------------------------------------- /node_modules/discord.js/src/rest/RESTManager.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const APIRequest = require('./APIRequest'); 4 | const routeBuilder = require('./APIRouter'); 5 | const RequestHandler = require('./RequestHandler'); 6 | const { Error } = require('../errors'); 7 | const Collection = require('../util/Collection'); 8 | const { Endpoints } = require('../util/Constants'); 9 | 10 | class RESTManager { 11 | constructor(client, tokenPrefix = 'Bot') { 12 | this.client = client; 13 | this.handlers = new Collection(); 14 | this.tokenPrefix = tokenPrefix; 15 | this.versioned = true; 16 | this.globalTimeout = null; 17 | if (client.options.restSweepInterval > 0) { 18 | client.setInterval(() => { 19 | this.handlers.sweep(handler => handler._inactive); 20 | }, client.options.restSweepInterval * 1000); 21 | } 22 | } 23 | 24 | get api() { 25 | return routeBuilder(this); 26 | } 27 | 28 | getAuth() { 29 | const token = this.client.token || this.client.accessToken; 30 | if (token) return `${this.tokenPrefix} ${token}`; 31 | throw new Error('TOKEN_MISSING'); 32 | } 33 | 34 | get cdn() { 35 | return Endpoints.CDN(this.client.options.http.cdn); 36 | } 37 | 38 | push(handler, apiRequest) { 39 | return new Promise((resolve, reject) => { 40 | handler 41 | .push({ 42 | request: apiRequest, 43 | resolve, 44 | reject, 45 | retries: 0, 46 | }) 47 | .catch(reject); 48 | }); 49 | } 50 | 51 | request(method, url, options = {}) { 52 | const apiRequest = new APIRequest(this, method, url, options); 53 | let handler = this.handlers.get(apiRequest.route); 54 | 55 | if (!handler) { 56 | handler = new RequestHandler(this); 57 | this.handlers.set(apiRequest.route, handler); 58 | } 59 | 60 | return this.push(handler, apiRequest); 61 | } 62 | 63 | set endpoint(endpoint) { 64 | this.client.options.http.api = endpoint; 65 | } 66 | } 67 | 68 | module.exports = RESTManager; 69 | -------------------------------------------------------------------------------- /node_modules/discord.js/src/structures/Base.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const Util = require('../util/Util'); 4 | 5 | /** 6 | * Represents a data model that is identifiable by a Snowflake (i.e. Discord API data models). 7 | */ 8 | class Base { 9 | constructor(client) { 10 | /** 11 | * The client that instantiated this 12 | * @name Base#client 13 | * @type {Client} 14 | * @readonly 15 | */ 16 | Object.defineProperty(this, 'client', { value: client }); 17 | } 18 | 19 | _clone() { 20 | return Object.assign(Object.create(this), this); 21 | } 22 | 23 | _patch(data) { 24 | return data; 25 | } 26 | 27 | _update(data) { 28 | const clone = this._clone(); 29 | this._patch(data); 30 | return clone; 31 | } 32 | 33 | toJSON(...props) { 34 | return Util.flatten(this, ...props); 35 | } 36 | 37 | valueOf() { 38 | return this.id; 39 | } 40 | } 41 | 42 | module.exports = Base; 43 | -------------------------------------------------------------------------------- /node_modules/discord.js/src/structures/BaseGuildEmoji.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const Emoji = require('./Emoji'); 4 | 5 | /** 6 | * Parent class for {@link GuildEmoji} and {@link GuildPreviewEmoji}. 7 | * @extends {Emoji} 8 | */ 9 | class BaseGuildEmoji extends Emoji { 10 | constructor(client, data, guild) { 11 | super(client, data); 12 | 13 | /** 14 | * The guild this emoji is a part of 15 | * @type {Guild|GuildPreview} 16 | */ 17 | this.guild = guild; 18 | 19 | /** 20 | * Array of role ids this emoji is active for 21 | * @name BaseGuildEmoji#_roles 22 | * @type {Snowflake[]} 23 | * @private 24 | */ 25 | Object.defineProperty(this, '_roles', { value: [], writable: true }); 26 | 27 | this._patch(data); 28 | } 29 | 30 | _patch(data) { 31 | if (data.name) this.name = data.name; 32 | 33 | /** 34 | * Whether or not this emoji requires colons surrounding it 35 | * @type {boolean} 36 | * @name GuildEmoji#requiresColons 37 | */ 38 | if (typeof data.require_colons !== 'undefined') this.requiresColons = data.require_colons; 39 | 40 | /** 41 | * Whether this emoji is managed by an external service 42 | * @type {boolean} 43 | * @name GuildEmoji#managed 44 | */ 45 | if (typeof data.managed !== 'undefined') this.managed = data.managed; 46 | 47 | /** 48 | * Whether this emoji is available 49 | * @type {boolean} 50 | * @name GuildEmoji#available 51 | */ 52 | if (typeof data.available !== 'undefined') this.available = data.available; 53 | 54 | if (data.roles) this._roles = data.roles; 55 | } 56 | } 57 | 58 | module.exports = BaseGuildEmoji; 59 | -------------------------------------------------------------------------------- /node_modules/discord.js/src/structures/CategoryChannel.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const GuildChannel = require('./GuildChannel'); 4 | 5 | /** 6 | * Represents a guild category channel on Discord. 7 | * @extends {GuildChannel} 8 | */ 9 | class CategoryChannel extends GuildChannel { 10 | /** 11 | * Channels that are a part of this category 12 | * @type {Collection} 13 | * @readonly 14 | */ 15 | get children() { 16 | return this.guild.channels.cache.filter(c => c.parentID === this.id); 17 | } 18 | 19 | /** 20 | * Sets the category parent of this channel. 21 | * It is not currently possible to set the parent of a CategoryChannel. 22 | * @method setParent 23 | * @memberof CategoryChannel 24 | * @instance 25 | * @param {?GuildChannel|Snowflake} channel Parent channel 26 | * @param {Object} [options={}] Options to pass 27 | * @param {boolean} [options.lockPermissions=true] Lock the permissions to what the parent's permissions are 28 | * @param {string} [options.reason] Reason for modifying the parent of this channel 29 | * @returns {Promise} 30 | */ 31 | } 32 | 33 | module.exports = CategoryChannel; 34 | -------------------------------------------------------------------------------- /node_modules/discord.js/src/structures/GuildPreviewEmoji.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const BaseGuildEmoji = require('./BaseGuildEmoji'); 4 | 5 | /** 6 | * Represents an instance of an emoji belonging to a public guild obtained through Discord's preview endpoint. 7 | * @extends {BaseGuildEmoji} 8 | */ 9 | class GuildPreviewEmoji extends BaseGuildEmoji { 10 | /** 11 | * The public guild this emoji is part of 12 | * @type {GuildPreview} 13 | * @name GuildPreviewEmoji#guild 14 | */ 15 | 16 | /** 17 | * Set of roles this emoji is active for 18 | * @type {Set} 19 | * @readonly 20 | */ 21 | get roles() { 22 | return new Set(this._roles); 23 | } 24 | } 25 | 26 | module.exports = GuildPreviewEmoji; 27 | -------------------------------------------------------------------------------- /node_modules/discord.js/src/structures/MessageAttachment.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const Util = require('../util/Util'); 4 | 5 | /** 6 | * Represents an attachment in a message. 7 | */ 8 | class MessageAttachment { 9 | /** 10 | * @param {BufferResolvable|Stream} attachment The file 11 | * @param {string} [name=null] The name of the file, if any 12 | * @param {Object} [data] Extra data 13 | */ 14 | constructor(attachment, name = null, data) { 15 | this.attachment = attachment; 16 | /** 17 | * The name of this attachment 18 | * @type {?string} 19 | */ 20 | this.name = name; 21 | if (data) this._patch(data); 22 | } 23 | 24 | /** 25 | * Sets the file of this attachment. 26 | * @param {BufferResolvable|Stream} attachment The file 27 | * @param {string} [name=null] The name of the file, if any 28 | * @returns {MessageAttachment} This attachment 29 | */ 30 | setFile(attachment, name = null) { 31 | this.attachment = attachment; 32 | this.name = name; 33 | return this; 34 | } 35 | 36 | /** 37 | * Sets the name of this attachment. 38 | * @param {string} name The name of the file 39 | * @returns {MessageAttachment} This attachment 40 | */ 41 | setName(name) { 42 | this.name = name; 43 | return this; 44 | } 45 | 46 | _patch(data) { 47 | /** 48 | * The ID of this attachment 49 | * @type {Snowflake} 50 | */ 51 | this.id = data.id; 52 | 53 | /** 54 | * The size of this attachment in bytes 55 | * @type {number} 56 | */ 57 | this.size = data.size; 58 | 59 | /** 60 | * The URL to this attachment 61 | * @type {string} 62 | */ 63 | this.url = data.url; 64 | 65 | /** 66 | * The Proxy URL to this attachment 67 | * @type {string} 68 | */ 69 | this.proxyURL = data.proxy_url; 70 | 71 | /** 72 | * The height of this attachment (if an image or video) 73 | * @type {?number} 74 | */ 75 | this.height = typeof data.height !== 'undefined' ? data.height : null; 76 | 77 | /** 78 | * The width of this attachment (if an image or video) 79 | * @type {?number} 80 | */ 81 | this.width = typeof data.width !== 'undefined' ? data.width : null; 82 | } 83 | 84 | /** 85 | * Whether or not this attachment has been marked as a spoiler 86 | * @type {boolean} 87 | * @readonly 88 | */ 89 | get spoiler() { 90 | return Util.basename(this.url).startsWith('SPOILER_'); 91 | } 92 | 93 | toJSON() { 94 | return Util.flatten(this); 95 | } 96 | } 97 | 98 | module.exports = MessageAttachment; 99 | -------------------------------------------------------------------------------- /node_modules/discord.js/src/structures/NewsChannel.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const TextChannel = require('./TextChannel'); 4 | 5 | /** 6 | * Represents a guild news channel on Discord. 7 | * @extends {TextChannel} 8 | */ 9 | class NewsChannel extends TextChannel { 10 | _patch(data) { 11 | super._patch(data); 12 | 13 | // News channels don't have a rate limit per user, remove it 14 | this.rateLimitPerUser = undefined; 15 | } 16 | } 17 | 18 | module.exports = NewsChannel; 19 | -------------------------------------------------------------------------------- /node_modules/discord.js/src/structures/PartialGroupDMChannel.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const Channel = require('./Channel'); 4 | const { Error } = require('../errors'); 5 | 6 | /** 7 | * Represents a Partial Group DM Channel on Discord. 8 | * @extends {Channel} 9 | */ 10 | class PartialGroupDMChannel extends Channel { 11 | constructor(client, data) { 12 | super(client, data); 13 | 14 | /** 15 | * The name of this Group DM Channel 16 | * @type {string} 17 | */ 18 | this.name = data.name; 19 | 20 | /** 21 | * The hash of the channel icon 22 | * @type {?string} 23 | */ 24 | this.icon = data.icon; 25 | } 26 | 27 | /** 28 | * The URL to this channel's icon. 29 | * @param {ImageURLOptions} [options={}] Options for the Image URL 30 | * @returns {?string} 31 | */ 32 | iconURL({ format, size } = {}) { 33 | if (!this.icon) return null; 34 | return this.client.rest.cdn.GDMIcon(this.id, this.icon, format, size); 35 | } 36 | 37 | delete() { 38 | return Promise.reject(new Error('DELETE_GROUP_DM_CHANNEL')); 39 | } 40 | 41 | fetch() { 42 | return Promise.reject(new Error('FETCH_GROUP_DM_CHANNEL')); 43 | } 44 | } 45 | 46 | module.exports = PartialGroupDMChannel; 47 | -------------------------------------------------------------------------------- /node_modules/discord.js/src/structures/ReactionEmoji.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const Emoji = require('./Emoji'); 4 | const Util = require('../util/Util'); 5 | 6 | /** 7 | * Represents a limited emoji set used for both custom and unicode emojis. Custom emojis 8 | * will use this class opposed to the Emoji class when the client doesn't know enough 9 | * information about them. 10 | * @extends {Emoji} 11 | */ 12 | class ReactionEmoji extends Emoji { 13 | constructor(reaction, emoji) { 14 | super(reaction.message.client, emoji); 15 | /** 16 | * The message reaction this emoji refers to 17 | * @type {MessageReaction} 18 | */ 19 | this.reaction = reaction; 20 | } 21 | 22 | toJSON() { 23 | return Util.flatten(this, { identifier: true }); 24 | } 25 | 26 | valueOf() { 27 | return this.id; 28 | } 29 | } 30 | 31 | module.exports = ReactionEmoji; 32 | -------------------------------------------------------------------------------- /node_modules/discord.js/src/structures/StoreChannel.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const GuildChannel = require('./GuildChannel'); 4 | 5 | /** 6 | * Represents a guild store channel on Discord. 7 | * @extends {GuildChannel} 8 | */ 9 | class StoreChannel extends GuildChannel { 10 | /** 11 | * @param {*} guild The guild the store channel is part of 12 | * @param {*} data The data for the store channel 13 | */ 14 | constructor(guild, data) { 15 | super(guild, data); 16 | 17 | /** 18 | * If the guild considers this channel NSFW 19 | * @type {boolean} 20 | * @readonly 21 | */ 22 | this.nsfw = Boolean(data.nsfw); 23 | } 24 | 25 | _patch(data) { 26 | super._patch(data); 27 | 28 | if (typeof data.nsfw !== 'undefined') this.nsfw = Boolean(data.nsfw); 29 | } 30 | } 31 | 32 | module.exports = StoreChannel; 33 | -------------------------------------------------------------------------------- /node_modules/discord.js/src/structures/TeamMember.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const Base = require('./Base'); 4 | const { MembershipStates } = require('../util/Constants'); 5 | 6 | /** 7 | * Represents a Client OAuth2 Application Team Member. 8 | * @extends {Base} 9 | */ 10 | class TeamMember extends Base { 11 | constructor(team, data) { 12 | super(team.client); 13 | 14 | /** 15 | * The Team this member is part of 16 | * @type {Team} 17 | */ 18 | this.team = team; 19 | 20 | this._patch(data); 21 | } 22 | 23 | _patch(data) { 24 | /** 25 | * The permissions this Team Member has with regard to the team 26 | * @type {string[]} 27 | */ 28 | this.permissions = data.permissions; 29 | 30 | /** 31 | * The permissions this Team Member has with regard to the team 32 | * @type {MembershipStates} 33 | */ 34 | this.membershipState = MembershipStates[data.membership_state]; 35 | 36 | /** 37 | * The user for this Team Member 38 | * @type {User} 39 | */ 40 | this.user = this.client.users.add(data.user); 41 | } 42 | 43 | /** 44 | * The ID of the Team Member 45 | * @type {Snowflake} 46 | * @readonly 47 | */ 48 | get id() { 49 | return this.user.id; 50 | } 51 | 52 | /** 53 | * When concatenated with a string, this automatically returns the team members's mention instead of the 54 | * TeamMember object. 55 | * @returns {string} 56 | * @example 57 | * // Logs: Team Member's mention: <@123456789012345678> 58 | * console.log(`Team Member's mention: ${teamMember}`); 59 | */ 60 | toString() { 61 | return this.user.toString(); 62 | } 63 | } 64 | 65 | module.exports = TeamMember; 66 | -------------------------------------------------------------------------------- /node_modules/discord.js/src/structures/VoiceRegion.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const Util = require('../util/Util'); 4 | 5 | /** 6 | * Represents a Discord voice region for guilds. 7 | */ 8 | class VoiceRegion { 9 | constructor(data) { 10 | /** 11 | * The ID of the region 12 | * @type {string} 13 | */ 14 | this.id = data.id; 15 | 16 | /** 17 | * Name of the region 18 | * @type {string} 19 | */ 20 | this.name = data.name; 21 | 22 | /** 23 | * Whether the region is VIP-only 24 | * @type {boolean} 25 | */ 26 | this.vip = data.vip; 27 | 28 | /** 29 | * Whether the region is deprecated 30 | * @type {boolean} 31 | */ 32 | this.deprecated = data.deprecated; 33 | 34 | /** 35 | * Whether the region is optimal 36 | * @type {boolean} 37 | */ 38 | this.optimal = data.optimal; 39 | 40 | /** 41 | * Whether the region is custom 42 | * @type {boolean} 43 | */ 44 | this.custom = data.custom; 45 | } 46 | 47 | toJSON() { 48 | return Util.flatten(this); 49 | } 50 | } 51 | 52 | module.exports = VoiceRegion; 53 | -------------------------------------------------------------------------------- /node_modules/discord.js/src/util/ActivityFlags.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const BitField = require('./BitField'); 4 | 5 | /** 6 | * Data structure that makes it easy to interact with an {@link Activity#flags} bitfield. 7 | * @extends {BitField} 8 | */ 9 | class ActivityFlags extends BitField {} 10 | 11 | /** 12 | * @name ActivityFlags 13 | * @kind constructor 14 | * @memberof ActivityFlags 15 | * @param {BitFieldResolvable} [bits=0] Bit(s) to read from 16 | */ 17 | 18 | /** 19 | * Numeric activity flags. All available properties: 20 | * * `INSTANCE` 21 | * * `JOIN` 22 | * * `SPECTATE` 23 | * * `JOIN_REQUEST` 24 | * * `SYNC` 25 | * * `PLAY` 26 | * @type {Object} 27 | * @see {@link https://discord.com/developers/docs/topics/gateway#activity-object-activity-flags} 28 | */ 29 | ActivityFlags.FLAGS = { 30 | INSTANCE: 1 << 0, 31 | JOIN: 1 << 1, 32 | SPECTATE: 1 << 2, 33 | JOIN_REQUEST: 1 << 3, 34 | SYNC: 1 << 4, 35 | PLAY: 1 << 5, 36 | }; 37 | 38 | module.exports = ActivityFlags; 39 | -------------------------------------------------------------------------------- /node_modules/discord.js/src/util/Collection.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const BaseCollection = require('@discordjs/collection'); 4 | const Util = require('./Util'); 5 | 6 | class Collection extends BaseCollection { 7 | toJSON() { 8 | return this.map(e => (typeof e.toJSON === 'function' ? e.toJSON() : Util.flatten(e))); 9 | } 10 | } 11 | 12 | module.exports = Collection; 13 | 14 | /** 15 | * @external Collection 16 | * @see {@link https://discord.js.org/#/docs/collection/master/class/Collection} 17 | */ 18 | -------------------------------------------------------------------------------- /node_modules/discord.js/src/util/Intents.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | const BitField = require('./BitField'); 3 | 4 | /** 5 | * Data structure that makes it easy to calculate intents. 6 | * @extends {BitField} 7 | */ 8 | class Intents extends BitField {} 9 | 10 | /** 11 | * @name Intents 12 | * @kind constructor 13 | * @memberof Intents 14 | * @param {IntentsResolvable} [bits=0] Bit(s) to read from 15 | */ 16 | 17 | /** 18 | * Data that can be resolved to give a permission number. This can be: 19 | * * A string (see {@link Intents.FLAGS}) 20 | * * An intents flag 21 | * * An instance of Intents 22 | * * An array of IntentsResolvable 23 | * @typedef {string|number|Intents|IntentsResolvable[]} IntentsResolvable 24 | */ 25 | 26 | /** 27 | * Numeric websocket intents. All available properties: 28 | * * `GUILDS` 29 | * * `GUILD_MEMBERS` 30 | * * `GUILD_BANS` 31 | * * `GUILD_EMOJIS` 32 | * * `GUILD_INTEGRATIONS` 33 | * * `GUILD_WEBHOOKS` 34 | * * `GUILD_INVITES` 35 | * * `GUILD_VOICE_STATES` 36 | * * `GUILD_PRESENCES` 37 | * * `GUILD_MESSAGES` 38 | * * `GUILD_MESSAGE_REACTIONS` 39 | * * `GUILD_MESSAGE_TYPING` 40 | * * `DIRECT_MESSAGES` 41 | * * `DIRECT_MESSAGE_REACTIONS` 42 | * * `DIRECT_MESSAGE_TYPING` 43 | * @type {Object} 44 | * @see {@link https://discord.com/developers/docs/topics/gateway#list-of-intents} 45 | */ 46 | Intents.FLAGS = { 47 | GUILDS: 1 << 0, 48 | GUILD_MEMBERS: 1 << 1, 49 | GUILD_BANS: 1 << 2, 50 | GUILD_EMOJIS: 1 << 3, 51 | GUILD_INTEGRATIONS: 1 << 4, 52 | GUILD_WEBHOOKS: 1 << 5, 53 | GUILD_INVITES: 1 << 6, 54 | GUILD_VOICE_STATES: 1 << 7, 55 | GUILD_PRESENCES: 1 << 8, 56 | GUILD_MESSAGES: 1 << 9, 57 | GUILD_MESSAGE_REACTIONS: 1 << 10, 58 | GUILD_MESSAGE_TYPING: 1 << 11, 59 | DIRECT_MESSAGES: 1 << 12, 60 | DIRECT_MESSAGE_REACTIONS: 1 << 13, 61 | DIRECT_MESSAGE_TYPING: 1 << 14, 62 | }; 63 | 64 | /** 65 | * Bitfield representing all privileged intents 66 | * @type {number} 67 | * @see {@link https://discord.com/developers/docs/topics/gateway#privileged-intents} 68 | */ 69 | Intents.PRIVILEGED = Intents.FLAGS.GUILD_MEMBERS | Intents.FLAGS.GUILD_PRESENCES; 70 | 71 | /** 72 | * Bitfield representing all intents combined 73 | * @type {number} 74 | */ 75 | Intents.ALL = Object.values(Intents.FLAGS).reduce((acc, p) => acc | p, 0); 76 | 77 | /** 78 | * Bitfield representing all non-privileged intents 79 | * @type {number} 80 | */ 81 | Intents.NON_PRIVILEGED = Intents.ALL & ~Intents.PRIVILEGED; 82 | 83 | module.exports = Intents; 84 | -------------------------------------------------------------------------------- /node_modules/discord.js/src/util/LimitedCollection.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const Collection = require('./Collection.js'); 4 | 5 | /** 6 | * A Collection which holds a max amount of entries. The first key is deleted if the Collection has 7 | * reached max size. 8 | * @extends {Collection} 9 | * @param {number} [maxSize=0] The maximum size of the Collection 10 | * @param {Iterable} [iterable=null] Optional entries passed to the Map constructor. 11 | * @private 12 | */ 13 | class LimitedCollection extends Collection { 14 | constructor(maxSize = 0, iterable = null) { 15 | super(iterable); 16 | /** 17 | * The max size of the Collection. 18 | * @type {number} 19 | */ 20 | this.maxSize = maxSize; 21 | } 22 | 23 | set(key, value) { 24 | if (this.maxSize === 0) return this; 25 | if (this.size >= this.maxSize && !this.has(key)) this.delete(this.firstKey()); 26 | return super.set(key, value); 27 | } 28 | 29 | static get [Symbol.species]() { 30 | return Collection; 31 | } 32 | } 33 | 34 | module.exports = LimitedCollection; 35 | -------------------------------------------------------------------------------- /node_modules/discord.js/src/util/MessageFlags.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const BitField = require('./BitField'); 4 | 5 | /** 6 | * Data structure that makes it easy to interact with an {@link Message#flags} bitfield. 7 | * @extends {BitField} 8 | */ 9 | class MessageFlags extends BitField {} 10 | 11 | /** 12 | * @name MessageFlags 13 | * @kind constructor 14 | * @memberof MessageFlags 15 | * @param {BitFieldResolvable} [bits=0] Bit(s) to read from 16 | */ 17 | 18 | /** 19 | * Numeric message flags. All available properties: 20 | * * `CROSSPOSTED` 21 | * * `IS_CROSSPOST` 22 | * * `SUPPRESS_EMBEDS` 23 | * * `SOURCE_MESSAGE_DELETED` 24 | * * `URGENT` 25 | * @type {Object} 26 | * @see {@link https://discord.com/developers/docs/resources/channel#message-object-message-flags} 27 | */ 28 | MessageFlags.FLAGS = { 29 | CROSSPOSTED: 1 << 0, 30 | IS_CROSSPOST: 1 << 1, 31 | SUPPRESS_EMBEDS: 1 << 2, 32 | SOURCE_MESSAGE_DELETED: 1 << 3, 33 | URGENT: 1 << 4, 34 | }; 35 | 36 | module.exports = MessageFlags; 37 | -------------------------------------------------------------------------------- /node_modules/discord.js/src/util/Speaking.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const BitField = require('./BitField'); 4 | 5 | /** 6 | * Data structure that makes it easy to interact with a {@link VoiceConnection#speaking} 7 | * and {@link guildMemberSpeaking} event bitfields. 8 | * @extends {BitField} 9 | */ 10 | class Speaking extends BitField {} 11 | 12 | /** 13 | * @name Speaking 14 | * @kind constructor 15 | * @memberof Speaking 16 | * @param {BitFieldResolvable} [bits=0] Bit(s) to read from 17 | */ 18 | 19 | /** 20 | * Numeric speaking flags. All available properties: 21 | * * `SPEAKING` 22 | * * `SOUNDSHARE` 23 | * * `PRIORITY_SPEAKING` 24 | * @type {Object} 25 | * @see {@link https://discord.com/developers/docs/topics/voice-connections#speaking} 26 | */ 27 | Speaking.FLAGS = { 28 | SPEAKING: 1 << 0, 29 | SOUNDSHARE: 1 << 1, 30 | PRIORITY_SPEAKING: 1 << 2, 31 | }; 32 | 33 | module.exports = Speaking; 34 | -------------------------------------------------------------------------------- /node_modules/discord.js/src/util/SystemChannelFlags.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const BitField = require('./BitField'); 4 | 5 | /** 6 | * Data structure that makes it easy to interact with a {@link Guild#systemChannelFlags} bitfield. 7 | * Note that all event message types are enabled by default, 8 | * and by setting their corresponding flags you are disabling them 9 | * @extends {BitField} 10 | */ 11 | class SystemChannelFlags extends BitField {} 12 | 13 | /** 14 | * @name SystemChannelFlags 15 | * @kind constructor 16 | * @memberof SystemChannelFlags 17 | * @param {SystemChannelFlagsResolvable} [bits=0] Bit(s) to read from 18 | */ 19 | 20 | /** 21 | * Data that can be resolved to give a sytem channel flag bitfield. This can be: 22 | * * A string (see {@link SystemChannelFlags.FLAGS}) 23 | * * A sytem channel flag 24 | * * An instance of SystemChannelFlags 25 | * * An Array of SystemChannelFlagsResolvable 26 | * @typedef {string|number|SystemChannelFlags|SystemChannelFlagsResolvable[]} SystemChannelFlagsResolvable 27 | */ 28 | 29 | /** 30 | * Numeric system channel flags. All available properties: 31 | * * `WELCOME_MESSAGE_DISABLED` 32 | * * `BOOST_MESSAGE_DISABLED` 33 | * @type {Object} 34 | */ 35 | SystemChannelFlags.FLAGS = { 36 | WELCOME_MESSAGE_DISABLED: 1 << 0, 37 | BOOST_MESSAGE_DISABLED: 1 << 1, 38 | }; 39 | 40 | module.exports = SystemChannelFlags; 41 | -------------------------------------------------------------------------------- /node_modules/discord.js/src/util/UserFlags.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | const BitField = require('./BitField'); 3 | 4 | /** 5 | * Data structure that makes it easy to interact with a {@link User#flags} bitfield. 6 | * @extends {BitField} 7 | */ 8 | class UserFlags extends BitField {} 9 | 10 | /** 11 | * @name UserFlags 12 | * @kind constructor 13 | * @memberof UserFlags 14 | * @param {BitFieldResolvable} [bits=0] Bit(s) to read from 15 | */ 16 | 17 | /** 18 | * Numeric user flags. All available properties: 19 | * * `DISCORD_EMPLOYEE` 20 | * * `DISCORD_PARTNER` 21 | * * `HYPESQUAD_EVENTS` 22 | * * `BUGHUNTER_LEVEL_1` 23 | * * `HOUSE_BRAVERY` 24 | * * `HOUSE_BRILLIANCE` 25 | * * `HOUSE_BALANCE` 26 | * * `EARLY_SUPPORTER` 27 | * * `TEAM_USER` 28 | * * `SYSTEM` 29 | * * `BUGHUNTER_LEVEL_2` 30 | * * `VERIFIED_BOT` 31 | * * `VERIFIED_DEVELOPER` 32 | * @type {Object} 33 | * @see {@link https://discord.com/developers/docs/resources/user#user-object-user-flags} 34 | */ 35 | UserFlags.FLAGS = { 36 | DISCORD_EMPLOYEE: 1 << 0, 37 | DISCORD_PARTNER: 1 << 1, 38 | HYPESQUAD_EVENTS: 1 << 2, 39 | BUGHUNTER_LEVEL_1: 1 << 3, 40 | HOUSE_BRAVERY: 1 << 6, 41 | HOUSE_BRILLIANCE: 1 << 7, 42 | HOUSE_BALANCE: 1 << 8, 43 | EARLY_SUPPORTER: 1 << 9, 44 | TEAM_USER: 1 << 10, 45 | SYSTEM: 1 << 12, 46 | BUGHUNTER_LEVEL_2: 1 << 14, 47 | VERIFIED_BOT: 1 << 16, 48 | VERIFIED_DEVELOPER: 1 << 17, 49 | }; 50 | 51 | module.exports = UserFlags; 52 | -------------------------------------------------------------------------------- /node_modules/discord.js/typings/index.ts: -------------------------------------------------------------------------------- 1 | /// 2 | 3 | import { Client } from 'discord.js'; 4 | 5 | const client: Client = new Client(); 6 | 7 | client.on('ready', () => { 8 | console.log(`Client is logged in as ${client.user!.tag} and ready!`); 9 | }); 10 | 11 | client.on('guildCreate', g => { 12 | const channel = g.channels.cache.random(); 13 | if (!channel) return; 14 | 15 | channel.setName('foo').then(updatedChannel => { 16 | console.log(`New channel name: ${updatedChannel.name}`); 17 | }); 18 | }); 19 | 20 | client.on('messageReactionRemoveAll', async message => { 21 | console.log(`messageReactionRemoveAll - id: ${message.id} (${message.id.length})`); 22 | 23 | if (message.partial) message = await message.fetch(); 24 | 25 | console.log(`messageReactionRemoveAll - content: ${message.content}`); 26 | }); 27 | 28 | client.login('absolutely-valid-token'); 29 | -------------------------------------------------------------------------------- /node_modules/discord.js/webpack/discord.min.js.LICENSE.txt: -------------------------------------------------------------------------------- 1 | /*! 2 | * The buffer module from node.js, for the browser. 3 | * 4 | * @author Feross Aboukhadijeh 5 | * @license MIT 6 | */ 7 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "//1": "describes your app and its dependencies", 3 | "//2": "https://docs.npmjs.com/files/package.json", 4 | "//3": "updating this file will download and update your packages", 5 | "name": "discord-boostsystem-bot", 6 | "version": "0.0.1", 7 | "description": "This bot is a simple Boost System.", 8 | "main": "savage.js", 9 | "scripts": { 10 | "start": "node boot.js" 11 | }, 12 | "dependencies": { 13 | "discord-logs": "^1.8.2", 14 | "discord.js": "^12.3.1" 15 | }, 16 | "engines": { 17 | "node": "12.x" 18 | }, 19 | "repository": { 20 | "url": "https://glitch.com/~savage-boost-system" 21 | }, 22 | "keywords": [ 23 | "bot", 24 | "boost", 25 | "system", 26 | "boost-system", 27 | "discord", 28 | "serendia", 29 | "squad", 30 | "Savage" 31 | ], 32 | "author": "Savage", 33 | "license": "MIT" 34 | } 35 | -------------------------------------------------------------------------------- /savage.bat: -------------------------------------------------------------------------------- 1 | echo off 2 | title © Savage Boost System 3 | color c 4 | cls 5 | :a 6 | node boot.js 7 | goto a 8 | pause -------------------------------------------------------------------------------- /standard_11.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anilufuk/Boost-System/98137c3df23abea96b9c16aa7ed1266b81df0702/standard_11.gif --------------------------------------------------------------------------------