This package has been deprecated

Author message:

This package is no longer supported, and neither is DiscordInjections.

di-interceptor

1.0.1 • Public • Published
interceptor logo

Interceptor

Intercepts outgoing requests. (WebSocket & HTTP Requests)

Wiki

NOTE: This plugin does not intercept the main Discord websocket on startup.


Intercepting WebSocket creations

const interceptor = this.manager.get('Interceptor');
interceptor.on('websocket-intercepted', iee => {
  if(iee.ws.url.includes("dealer.spotify.com")) this.spotifyWS = iee;
  iee.on('data', this.spotifyData);
});

Intercepting HTTP requests

const interceptor = this.manager.get('Interceptor');
interceptor.on('request-open', (url, method, iee) => {
  if(url.includes("spotify.com")) iee.on('data', this.handleSpotifyRequest);
});

/di-interceptor/

    Package Sidebar

    Install

    npm i di-interceptor

    Weekly Downloads

    3

    Version

    1.0.1

    License

    MIT

    Unpacked Size

    8.95 kB

    Total Files

    5

    Last publish

    Collaborators

    • snazzah