diff --git a/DiscordRPC/index.js b/DiscordRPC/index.js index dd371f9..b5b0b91 100644 --- a/DiscordRPC/index.js +++ b/DiscordRPC/index.js @@ -1 +1,14 @@ -var c=[],r=e=>e.length>=128?`${e.slice(0,125)}...`:e,a=!1;function m(){let e=document.styleSheets;for(let t=0;t{if(a)return;let{item:s,type:o}=neptune.currentMediaItem;if(o!=="track")return;let n=new Date,h=n.getTime()/1e3,i=n.setSeconds(n.getSeconds()+(s.duration-t)),p=neptune.store.getState().playbackControls.playbackState==="NOT_PLAYING";this.ws.readyState===1&&this.send({cmd:"SET_ACTIVITY",args:{pid:2094112,activity:{timestamps:{...p?{}:{start:h,end:i}},type:2,name:r(s.title),details:r(`by ${s.artists.map(d=>d.name).join(", ")}`),assets:{large_image:`https://resources.tidal.com/images/${s.album.cover.split("-").join("/")}/80x80.jpg`,large_text:`on ${r(s.album.title)}`,small_text:`${m()}|${neptune.currentMediaItem.item.id}`,...p?{small_image:"paused-pause"}:{}},buttons:[{label:"Play Song",url:`https://listen.tidal.com/track/${neptune.currentMediaItem.item.id}?u`}]}}})})),a=!0,neptune.actions.playbackControls.pause(),a=!1}onClose(t){t.wasClean}onError(){for(let t of c)t();try{this.ws.close()}catch{}setTimeout(()=>{this.connect()},250)}send(t){this.ws.send(JSON.stringify(t))}close(){this.ws.close()}},u=new l;u.connect();async function y(){for(let e of c)e();if(u)try{u.close()}catch{}}export{y as onUnload}; +var E0=Object.create;var $i=Object.defineProperty;var J0=Object.getOwnPropertyDescriptor;var em=Object.getOwnPropertyNames;var tm=Object.getPrototypeOf,nm=Object.prototype.hasOwnProperty;var ht=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,n)=>(typeof require<"u"?require:t)[n]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var s=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var im=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of em(t))!nm.call(e,a)&&a!==n&&$i(e,a,{get:()=>t[a],enumerable:!(i=J0(t,a))||i.enumerable});return e};var am=(e,t,n)=>(n=e!=null?E0(tm(e)):{},im(t||!e||!e.__esModule?$i(n,"default",{value:e,enumerable:!0}):n,e));var Vi=s(Li=>{"use strict";Object.defineProperty(Li,"__esModule",{value:!0})});var Fi=s(q=>{"use strict";var sm=q&&q.__createBinding||(Object.create?function(e,t,n,i){i===void 0&&(i=n);var a=Object.getOwnPropertyDescriptor(t,n);(!a||("get"in a?!t.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,a)}:function(e,t,n,i){i===void 0&&(i=n),e[i]=t[n]}),om=q&&q.__exportStar||function(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&sm(t,e,n)};Object.defineProperty(q,"__esModule",{value:!0});q.VoiceChannelEffectSendAnimationType=q.GatewayDispatchEvents=q.GatewayIntentBits=q.GatewayCloseCodes=q.GatewayOpcodes=q.GatewayVersion=void 0;om(Vi(),q);q.GatewayVersion="10";var Hi;(function(e){e[e.Dispatch=0]="Dispatch",e[e.Heartbeat=1]="Heartbeat",e[e.Identify=2]="Identify",e[e.PresenceUpdate=3]="PresenceUpdate",e[e.VoiceStateUpdate=4]="VoiceStateUpdate",e[e.Resume=6]="Resume",e[e.Reconnect=7]="Reconnect",e[e.RequestGuildMembers=8]="RequestGuildMembers",e[e.InvalidSession=9]="InvalidSession",e[e.Hello=10]="Hello",e[e.HeartbeatAck=11]="HeartbeatAck"})(Hi||(q.GatewayOpcodes=Hi={}));var Ti;(function(e){e[e.UnknownError=4e3]="UnknownError",e[e.UnknownOpcode=4001]="UnknownOpcode",e[e.DecodeError=4002]="DecodeError",e[e.NotAuthenticated=4003]="NotAuthenticated",e[e.AuthenticationFailed=4004]="AuthenticationFailed",e[e.AlreadyAuthenticated=4005]="AlreadyAuthenticated",e[e.InvalidSeq=4007]="InvalidSeq",e[e.RateLimited=4008]="RateLimited",e[e.SessionTimedOut=4009]="SessionTimedOut",e[e.InvalidShard=4010]="InvalidShard",e[e.ShardingRequired=4011]="ShardingRequired",e[e.InvalidAPIVersion=4012]="InvalidAPIVersion",e[e.InvalidIntents=4013]="InvalidIntents",e[e.DisallowedIntents=4014]="DisallowedIntents"})(Ti||(q.GatewayCloseCodes=Ti={}));var Gi;(function(e){e[e.Guilds=1]="Guilds",e[e.GuildMembers=2]="GuildMembers",e[e.GuildModeration=4]="GuildModeration",e[e.GuildBans=4]="GuildBans",e[e.GuildEmojisAndStickers=8]="GuildEmojisAndStickers",e[e.GuildIntegrations=16]="GuildIntegrations",e[e.GuildWebhooks=32]="GuildWebhooks",e[e.GuildInvites=64]="GuildInvites",e[e.GuildVoiceStates=128]="GuildVoiceStates",e[e.GuildPresences=256]="GuildPresences",e[e.GuildMessages=512]="GuildMessages",e[e.GuildMessageReactions=1024]="GuildMessageReactions",e[e.GuildMessageTyping=2048]="GuildMessageTyping",e[e.DirectMessages=4096]="DirectMessages",e[e.DirectMessageReactions=8192]="DirectMessageReactions",e[e.DirectMessageTyping=16384]="DirectMessageTyping",e[e.MessageContent=32768]="MessageContent",e[e.GuildScheduledEvents=65536]="GuildScheduledEvents",e[e.AutoModerationConfiguration=1048576]="AutoModerationConfiguration",e[e.AutoModerationExecution=2097152]="AutoModerationExecution",e[e.GuildMessagePolls=16777216]="GuildMessagePolls",e[e.DirectMessagePolls=33554432]="DirectMessagePolls"})(Gi||(q.GatewayIntentBits=Gi={}));var Wi;(function(e){e.ApplicationCommandPermissionsUpdate="APPLICATION_COMMAND_PERMISSIONS_UPDATE",e.ChannelCreate="CHANNEL_CREATE",e.ChannelDelete="CHANNEL_DELETE",e.ChannelPinsUpdate="CHANNEL_PINS_UPDATE",e.ChannelUpdate="CHANNEL_UPDATE",e.GuildBanAdd="GUILD_BAN_ADD",e.GuildBanRemove="GUILD_BAN_REMOVE",e.GuildCreate="GUILD_CREATE",e.GuildDelete="GUILD_DELETE",e.GuildEmojisUpdate="GUILD_EMOJIS_UPDATE",e.GuildIntegrationsUpdate="GUILD_INTEGRATIONS_UPDATE",e.GuildMemberAdd="GUILD_MEMBER_ADD",e.GuildMemberRemove="GUILD_MEMBER_REMOVE",e.GuildMembersChunk="GUILD_MEMBERS_CHUNK",e.GuildMemberUpdate="GUILD_MEMBER_UPDATE",e.GuildRoleCreate="GUILD_ROLE_CREATE",e.GuildRoleDelete="GUILD_ROLE_DELETE",e.GuildRoleUpdate="GUILD_ROLE_UPDATE",e.GuildStickersUpdate="GUILD_STICKERS_UPDATE",e.GuildUpdate="GUILD_UPDATE",e.IntegrationCreate="INTEGRATION_CREATE",e.IntegrationDelete="INTEGRATION_DELETE",e.IntegrationUpdate="INTEGRATION_UPDATE",e.InteractionCreate="INTERACTION_CREATE",e.InviteCreate="INVITE_CREATE",e.InviteDelete="INVITE_DELETE",e.MessageCreate="MESSAGE_CREATE",e.MessageDelete="MESSAGE_DELETE",e.MessageDeleteBulk="MESSAGE_DELETE_BULK",e.MessageReactionAdd="MESSAGE_REACTION_ADD",e.MessageReactionRemove="MESSAGE_REACTION_REMOVE",e.MessageReactionRemoveAll="MESSAGE_REACTION_REMOVE_ALL",e.MessageReactionRemoveEmoji="MESSAGE_REACTION_REMOVE_EMOJI",e.MessageUpdate="MESSAGE_UPDATE",e.PresenceUpdate="PRESENCE_UPDATE",e.StageInstanceCreate="STAGE_INSTANCE_CREATE",e.StageInstanceDelete="STAGE_INSTANCE_DELETE",e.StageInstanceUpdate="STAGE_INSTANCE_UPDATE",e.Ready="READY",e.Resumed="RESUMED",e.ThreadCreate="THREAD_CREATE",e.ThreadDelete="THREAD_DELETE",e.ThreadListSync="THREAD_LIST_SYNC",e.ThreadMembersUpdate="THREAD_MEMBERS_UPDATE",e.ThreadMemberUpdate="THREAD_MEMBER_UPDATE",e.ThreadUpdate="THREAD_UPDATE",e.TypingStart="TYPING_START",e.UserUpdate="USER_UPDATE",e.VoiceChannelEffectSend="VOICE_CHANNEL_EFFECT_SEND",e.VoiceServerUpdate="VOICE_SERVER_UPDATE",e.VoiceStateUpdate="VOICE_STATE_UPDATE",e.WebhooksUpdate="WEBHOOKS_UPDATE",e.MessagePollVoteAdd="MESSAGE_POLL_VOTE_ADD",e.MessagePollVoteRemove="MESSAGE_POLL_VOTE_REMOVE",e.GuildScheduledEventCreate="GUILD_SCHEDULED_EVENT_CREATE",e.GuildScheduledEventUpdate="GUILD_SCHEDULED_EVENT_UPDATE",e.GuildScheduledEventDelete="GUILD_SCHEDULED_EVENT_DELETE",e.GuildScheduledEventUserAdd="GUILD_SCHEDULED_EVENT_USER_ADD",e.GuildScheduledEventUserRemove="GUILD_SCHEDULED_EVENT_USER_REMOVE",e.AutoModerationRuleCreate="AUTO_MODERATION_RULE_CREATE",e.AutoModerationRuleUpdate="AUTO_MODERATION_RULE_UPDATE",e.AutoModerationRuleDelete="AUTO_MODERATION_RULE_DELETE",e.AutoModerationActionExecution="AUTO_MODERATION_ACTION_EXECUTION",e.GuildAuditLogEntryCreate="GUILD_AUDIT_LOG_ENTRY_CREATE",e.EntitlementCreate="ENTITLEMENT_CREATE",e.EntitlementUpdate="ENTITLEMENT_UPDATE",e.EntitlementDelete="ENTITLEMENT_DELETE",e.SubscriptionCreate="SUBSCRIPTION_CREATE",e.SubscriptionUpdate="SUBSCRIPTION_UPDATE",e.SubscriptionDelete="SUBSCRIPTION_DELETE"})(Wi||(q.GatewayDispatchEvents=Wi={}));var Oi;(function(e){e[e.Premium=0]="Premium",e[e.Basic=1]="Basic"})(Oi||(q.VoiceChannelEffectSendAnimationType=Oi={}))});var Ni=s(pt=>{"use strict";Object.defineProperty(pt,"__esModule",{value:!0});pt.FormattingPatterns=void 0;pt.FormattingPatterns={User:/<@(?\d{17,20})>/,UserWithNickname:/<@!(?\d{17,20})>/,UserWithOptionalNickname:/<@!?(?\d{17,20})>/,Channel:/<#(?\d{17,20})>/,Role:/<@&(?\d{17,20})>/,SlashCommand:/<\/(?(?[-_\p{Letter}\p{Number}\p{sc=Deva}\p{sc=Thai}]{1,32})(?: (?[-_\p{Letter}\p{Number}\p{sc=Deva}\p{sc=Thai}]{1,32}))?(?: (?[-_\p{Letter}\p{Number}\p{sc=Deva}\p{sc=Thai}]{1,32}))?):(?\d{17,20})>/u,Emoji:/<(?a)?:(?\w{2,32}):(?\d{17,20})>/,AnimatedEmoji:/<(?a):(?\w{2,32}):(?\d{17,20})>/,StaticEmoji:/<:(?\w{2,32}):(?\d{17,20})>/,Timestamp:/-?\d{1,13})(:(?