Jump to content

[Tutorial] Como executar ações no MTA utilizando um BOT do Discord


Recommended Posts

  • Lord Henry featured this topic
  • 2 months later...
  • 2 weeks later...
  • 2 months later...

O comando npm install não está funcionando pra mim, alguém consegue me ajudar por favor? Aparece esse erro no terminal:

 

Spoiler

npm : O termo 'npm' não é reconhecido como nome de cmdlet, função, arquivo de script ou programa operável. Verifique a grafia do nome ou, se um caminho tiver sido incluído, veja se o caminho está correto e tente novamente.   
No linha:1 caractere:1
+ npm install
+ ~~~
    + FullyQualifiedErrorId : CommandNotFoundException

 

Edited by Boechat
Link to comment
  • 2 weeks later...
  • 3 weeks later...
  • Other Languages Moderators

Olá! Desculpa o atraso. Acredito que o erro esteja vindo do seu servidor MTA. Poderia dar detalhes sobre como está o nome do recurso (resource) e como está configurado as credenciais?

Fique à vontade para me mandar mensagem privada aqui no fórum, caso seja necessário.

Link to comment
  • 2 weeks later...
  • 3 months later...
  • 10 months later...

Fiz tudo de acordo com o post mais sempre que dou start da esse erro aqui "error 404"

Codigo:

Spoiler
=> O BOT está funcionando.
StatusCodeError: 404 - "<html>\r\n<head><title>404 Not Found</title></head>\r\n<body bgcolor=\"white\">\r\n<center><h1>404 Not Found</h1></center>\r\n<hr><center>nginx/1.14.0 (Ubuntu)</center>\r\n</body>\r\n</html>\r\n"
    at new StatusCodeError (C:\Users\Ludy\Desktop\tutorial-discordbot-main\node_modules\request-promise-core\lib\errors.js:32:15)  
    at Request.plumbing.callback (C:\Users\Ludy\Desktop\tutorial-discordbot-main\node_modules\request-promise-core\lib\plumbing.js:104:33)
    at Request.RP$callback [as _callback] (C:\Users\Ludy\Desktop\tutorial-discordbot-main\node_modules\request-promise-core\lib\plumbing.js:46:31)
    at Request.self.callback (C:\Users\Ludy\Desktop\tutorial-discordbot-main\node_modules\request\request.js:185:22)
    at Request.emit (node:events:513:28)
    at Request.<anonymous> (C:\Users\Ludy\Desktop\tutorial-discordbot-main\node_modules\request\request.js:1161:10)
    at Request.emit (node:events:513:28)
    at IncomingMessage.<anonymous> (C:\Users\Ludy\Desktop\tutorial-discordbot-main\node_modules\request\request.js:1083:12)        
    at Object.onceWrapper (node:events:627:28)
    at IncomingMessage.emit (node:events:525:35)
    at endReadableNT (node:internal/streams/readable:1358:12)
    at processTicksAndRejections (node:internal/process/task_queues:83:21) {
  statusCode: 404,
  error: '<html>\r\n' +
    '<head><title>404 Not Found</title></head>\r\n' +
    '<body bgcolor="white">\r\n' +
    '<center><h1>404 Not Found</h1></center>\r\n' +
    '<hr><center>nginx/1.14.0 (Ubuntu)</center>\r\n' +
    '</body>\r\n' +
    '</html>\r\n',
  options: {
    uri: 'http://177.54.146.12:22212/discordapp/call/discordRequest',
    auth: { user: 'legal', password: '123', pass: '123' },
    headers: {
      'Content-type': 'application/json',
      'User-Agent': 'MTA:SA WEB client on Node.js v16.17.1 (node-mtasa)'
    },
    json: true,
    body: [ 'uuu', 'Console', 1, '2R47gfTZhp', 'Cidade Virtual' ],
    method: 'POST',
    callback: [Function: RP$callback],
    transform: undefined,
    simple: true,
    resolveWithFullResponse: false,
    transform2xxOnly: false
  },
  response: <ref *1> IncomingMessage {
    _readableState: ReadableState {
      objectMode: false,
      highWaterMark: 16384,
      buffer: BufferList { head: null, tail: null, length: 0 },
      length: 0,
      pipes: [],
      flowing: true,
      ended: true,
      endEmitted: true,
      reading: false,
      constructed: true,
      sync: true,
      needReadable: false,
      emittedReadable: false,
      readableListening: false,
      resumeScheduled: false,
      errorEmitted: false,
      emitClose: true,
      autoDestroy: true,
      destroyed: true,
      errored: null,
      closed: true,
      closeEmitted: true,
      defaultEncoding: 'utf8',
      awaitDrainWriters: null,
      multiAwaitDrain: false,
      readingMore: true,
      dataEmitted: true,
      decoder: null,
      encoding: null,
      [Symbol(kPaused)]: false
    },
    _events: [Object: null prototype] {
      end: [Array],
      close: [Array],
      data: [Function (anonymous)],
      error: [Function (anonymous)]
    },
    _eventsCount: 4,
    _maxListeners: undefined,
    socket: Socket {
      connecting: false,
      _hadError: false,
      _parent: null,
      _host: null,
      _readableState: [ReadableState],
      _events: [Object: null prototype],
      _eventsCount: 7,
      _maxListeners: undefined,
      _writableState: [WritableState],
      allowHalfOpen: false,
      _sockname: null,
      _pendingData: null,
      _pendingEncoding: '',
      server: null,
      _server: null,
      parser: null,
      _httpMessage: [ClientRequest],
      [Symbol(async_id_symbol)]: 185,
      [Symbol(kHandle)]: [TCP],
      [Symbol(lastWriteQueueSize)]: 0,
      [Symbol(timeout)]: null,
      [Symbol(kBuffer)]: null,
      [Symbol(kBufferCb)]: null,
      [Symbol(kBufferGen)]: null,
      [Symbol(kCapture)]: false,
      [Symbol(kSetNoDelay)]: false,
      [Symbol(kSetKeepAlive)]: false,
      [Symbol(kSetKeepAliveInitialDelay)]: 0,
      [Symbol(kBytesRead)]: 0,
      [Symbol(kBytesWritten)]: 0,
      [Symbol(RequestTimeout)]: undefined
    },
    httpVersionMajor: 1,
    httpVersionMinor: 1,
    httpVersion: '1.1',
    complete: true,
    rawHeaders: [
      'Server',
      'nginx/1.14.0 (Ubuntu)',
      'Date',
      'Thu, 27 Oct 2022 23:02:51 GMT',
      'Content-Type',
      'text/html',
      'Content-Length',
      '178',
      'Connection',
      'close'
    ],
    rawTrailers: [],
    aborted: false,
    upgrade: false,
    url: '',
    method: null,
    statusCode: 404,
    statusMessage: 'Not Found',
    client: Socket {
      connecting: false,
      _hadError: false,
      _parent: null,
      _host: null,
      _readableState: [ReadableState],
      _events: [Object: null prototype],
      _eventsCount: 7,
      _maxListeners: undefined,
      _writableState: [WritableState],
      allowHalfOpen: false,
      _sockname: null,
      _pendingData: null,
      _pendingEncoding: '',
      server: null,
      _server: null,
      parser: null,
      _httpMessage: [ClientRequest],
      [Symbol(async_id_symbol)]: 185,
      [Symbol(kHandle)]: [TCP],
      [Symbol(lastWriteQueueSize)]: 0,
      [Symbol(timeout)]: null,
      [Symbol(kBuffer)]: null,
      [Symbol(kBufferCb)]: null,
      [Symbol(kBufferGen)]: null,
      [Symbol(kCapture)]: false,
      [Symbol(kSetNoDelay)]: false,
      [Symbol(kSetKeepAlive)]: false,
      [Symbol(kSetKeepAliveInitialDelay)]: 0,
      [Symbol(kBytesRead)]: 0,
      [Symbol(kBytesWritten)]: 0,
      [Symbol(RequestTimeout)]: undefined
    },
    _consuming: false,
    _dumped: false,
    req: ClientRequest {
      _events: [Object: null prototype],
      _eventsCount: 5,
      _maxListeners: undefined,
      outputData: [],
      outputSize: 0,
      writable: true,
      destroyed: false,
      _last: true,
      chunkedEncoding: false,
      shouldKeepAlive: false,
      maxRequestsOnConnectionReached: false,
      _defaultKeepAlive: true,
      useChunkedEncodingByDefault: true,
      sendDate: false,
      _removedConnection: false,
      _removedContLen: false,
      _removedTE: false,
      _contentLength: null,
      _hasBody: true,
      _trailer: '',
      finished: true,
      _headerSent: true,
      _closed: false,
      socket: [Socket],
      _header: 'POST /discordapp/call/discordRequest HTTP/1.1\r\n' +
        'Content-type: application/json\r\n' +
        'User-Agent: MTA:SA WEB client on Node.js v16.17.1 (node-mtasa)\r\n' +
        'host: 177.54.146.12:22212\r\n' +
        'authorization: Basic U3RhZmYxMjpjdnJwMTIzeg==\r\n' +
        'accept: application/json\r\n' +
        'content-length: 49\r\n' +
        'Connection: close\r\n' +
        '\r\n',
      _keepAliveTimeout: 0,
      _onPendingData: [Function: nop],
      agent: [Agent],
      socketPath: undefined,
      method: 'POST',
      maxHeaderSize: undefined,
      insecureHTTPParser: undefined,
      path: '/discordapp/call/discordRequest',
      _ended: true,
      res: [Circular *1],
      aborted: false,
      timeoutCb: null,
      upgradeOrConnect: false,
      parser: null,
      maxHeadersCount: null,
      reusedSocket: false,
      host: '177.54.146.12',
      protocol: 'http:',
      [Symbol(kCapture)]: false,
      [Symbol(kNeedDrain)]: false,
      [Symbol(corked)]: 0,
      [Symbol(kOutHeaders)]: [Object: null prototype],
      [Symbol(kUniqueHeaders)]: null
    },
    request: Request {
      _events: [Object: null prototype],
      _eventsCount: 5,
      _maxListeners: undefined,
      uri: [Url],
      headers: [Object],
      body: '["uuu","Console",1,"2R47gfTZhp","Cidade Virtual"]',
      method: 'POST',
      readable: true,
      writable: true,
      explicitMethod: true,
      _qs: [Querystring],
      _auth: [Auth],
      _oauth: [OAuth],
      _multipart: [Multipart],
      _redirect: [Redirect],
      _tunnel: [Tunnel],
      _rp_resolve: [Function (anonymous)],
      _rp_reject: [Function (anonymous)],
      _rp_promise: [Promise [Object]],
      _rp_callbackOrig: undefined,
      callback: [Function (anonymous)],
      _rp_options: [Object],
      setHeader: [Function (anonymous)],
      hasHeader: [Function (anonymous)],
      getHeader: [Function (anonymous)],
      removeHeader: [Function (anonymous)],
      localAddress: undefined,
      pool: {},
      dests: [],
      __isRequestRequest: true,
      _callback: [Function: RP$callback],
      proxy: null,
      tunnel: false,
      setHost: true,
      originalCookieHeader: undefined,
      _disableCookies: true,
      _jar: undefined,
      port: '22212',
      host: '177.54.146.12',
      path: '/discordapp/call/discordRequest',
      _json: true,
      httpModule: [Object],
      agentClass: [Function],
      agent: [Agent],
      _started: true,
      href: 'http://177.54.146.12:22212/discordapp/call/discordRequest',
      req: [ClientRequest],
      ntick: true,
      response: [Circular *1],
      originalHost: '177.54.146.12:22212',
      originalHostHeaderName: 'host',
      responseContent: [Circular *1],
      _destdata: true,
      _ended: true,
      _callbackCalled: true,
      [Symbol(kCapture)]: false
    },
    toJSON: [Function: responseToJSON],
    caseless: Caseless { dict: [Object] },
    body: '<html>\r\n' +
      '<head><title>404 Not Found</title></head>\r\n' +
      '<body bgcolor="white">\r\n' +
      '<center><h1>404 Not Found</h1></center>\r\n' +
      '<hr><center>nginx/1.14.0 (Ubuntu)</center>\r\n' +
      '</body>\r\n' +
      '</html>\r\n',
    [Symbol(kCapture)]: false,
    [Symbol(kHeaders)]: {
      server: 'nginx/1.14.0 (Ubuntu)',
      date: 'Thu, 27 Oct 2022 23:02:51 GMT',
      'content-type': 'text/html',
      'content-length': '178',
      connection: 'close'
    },
    [Symbol(kHeadersCount)]: 10,
    [Symbol(kTrailers)]: null,
    [Symbol(kTrailersCount)]: 0,
    [Symbol(RequestTimeout)]: undefined
  }
}

 

 

Edited by Lord Henry
Código grande demais, colocado dentro de um spoiler.
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...