File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11const { Structure } = require ( 'erela.js' ) ;
22const WebSocket = require ( 'ws' ) ;
3- const fetch = require ( 'petitio' ) ;
43const { version } = require ( '../../package.json' ) ;
54
65class Node extends Structure . get ( 'Node' ) {
@@ -25,20 +24,6 @@ class Node extends Structure.get('Node') {
2524 this . socket . on ( 'message' , this . message . bind ( this ) ) ;
2625 this . socket . on ( 'error' , this . error . bind ( this ) ) ;
2726 }
28-
29- async makeRequest ( endpoint , modify ) {
30- endpoint = endpoint . replace ( / ^ \/ / gm, '' ) ;
31-
32- const request = fetch ( `http${ this . options . secure ? 's' : '' } ://${ this . options . host } :${ this . options . port } /${ endpoint } ` )
33- . header ( 'Authorization' , this . options . password ) . header ( 'User-Agent' , `NoteBlock v${ version } ` ) ;
34-
35- if ( modify ) {
36- await modify ( request ) ;
37- }
38-
39- this . calls ++ ;
40- return await request . json ( ) ;
41- }
4227}
4328
4429Structure . extend ( 'Node' , ( ) => Node ) ;
You can’t perform that action at this time.
0 commit comments