2017-06-24 1 views
0

Ich versuche zu geben die Ergebnisse aus dem Auswahlabfrageprotokoll in die Konsole lesen, aber ich bin immer folgenden:Javascript MySQL - Typeerror: kann Eigenschaft ‚einbetten‘ von null

Code:

connection.query("SELECT userID FROM inventories WHERE ?", invCheckedIDres, function(result) { 
    message.channel.send(result) 
}); 

Fehler:

C:\Users\apixe\Documents\GS Bot\node_modules\mysql\lib\protocol\Parser.js:79 
     throw err; // Rethrow non-MySQL errors 
     ^

TypeError: Cannot read property 'embed' of null 
    at TextChannel.send (C:\Users\apixe\Documents\GS Bot\node_modules\discord.js\src\structures\interfaces\TextBasedChannel.js:83:16) 
    at Query._callback (C:\Users\apixe\Documents\GS Bot\index.js:811:19) 
    at Query.Sequence.end (C:\Users\apixe\Documents\GS Bot\node_modules\mysql\lib\protocol\sequences\Sequence.js:86:24) 
    at Query._handleFinalResultPacket (C:\Users\apixe\Documents\GS Bot\node_modules\mysql\lib\protocol\sequences\Query.js:137:8) 
    at Query.EofPacket (C:\Users\apixe\Documents\GS Bot\node_modules\mysql\lib\protocol\sequences\Query.js:121:8) 
    at Protocol._parsePacket (C:\Users\apixe\Documents\GS Bot\node_modules\mysql\lib\protocol\Protocol.js:280:23) 
    at Parser.write (C:\Users\apixe\Documents\GS Bot\node_modules\mysql\lib\protocol\Parser.js:75:12) 
    at Protocol.write (C:\Users\apixe\Documents\GS Bot\node_modules\mysql\lib\protocol\Protocol.js:39:16) 
    at Socket.<anonymous> (C:\Users\apixe\Documents\GS Bot\node_modules\mysql\lib\Connection.js:103:28) 
    at emitOne (events.js:115:13) 

gibt es etwas, was ich bin hier fehlt?

Antwort

0

Welches Modul verwenden Sie für Ihre SQL-Integration?

Sie melden sich nicht an der Konsole an, Sie senden eine Nachricht an Disharmonie. Die Abfrage gibt ein row/rows [] -Objekt zurück, während message.send auch eine Zeichenfolge und keine Zeilen akzeptiert. Allerdings sehe ich nicht in dem Code, den Sie angegeben haben, wo alles auf "einbetten", welche Zeilennummer ist dieser Code aus?

Verwandte Themen