bot.exec: force buffers
This commit is contained in:
		
							parent
							
								
									b987ec9755
								
							
						
					
					
						commit
						263166c84f
					
				
					 1 changed files with 4 additions and 4 deletions
				
			
		| 
						 | 
				
			
			@ -28,18 +28,18 @@ function spawn(args) {
 | 
			
		|||
    stdout: {
 | 
			
		||||
      on: (event, handler) =>
 | 
			
		||||
        proc.stdout.on(event, (data) => {
 | 
			
		||||
          handler(data.toString("utf8"));
 | 
			
		||||
          handler(Buffer.from(data).toString("utf8"));
 | 
			
		||||
        }),
 | 
			
		||||
    },
 | 
			
		||||
    stderr: {
 | 
			
		||||
      on: (event, handler) =>
 | 
			
		||||
        proc.stderr.on(event, (data) => {
 | 
			
		||||
          handler(data.toString("utf8"));
 | 
			
		||||
          handler(Buffer.from(data).toString("utf8"));
 | 
			
		||||
        }),
 | 
			
		||||
    },
 | 
			
		||||
    on: (event, handler) =>
 | 
			
		||||
      proc.on(event, (data) => {
 | 
			
		||||
        handler(data.toString("utf8"));
 | 
			
		||||
        handler(Buffer.from(data).toString("utf8"));
 | 
			
		||||
      }),
 | 
			
		||||
  };
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -128,7 +128,7 @@ exec.callback = async function (msg, line) {
 | 
			
		|||
    out += data + "\n";
 | 
			
		||||
  });
 | 
			
		||||
  proc.stderr.on("data", (data) => {
 | 
			
		||||
    out += data + "\n";
 | 
			
		||||
    out += "ERR: " + data + "\n";
 | 
			
		||||
  });
 | 
			
		||||
 | 
			
		||||
  proc.on("close", async (code) => {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue