2017-06-24 14 views
0

のプロパティを読み取ることができません「を埋め込む」私はコンソールに出力する選択クエリログからの結果をしようとしているが、私は次のようになっています:JavascriptをMySQLの - 例外TypeError:ヌル

コード:

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

エラー:

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) 

私はここに欠けている何かがありますか?

答えて

0

SQL統合にはどのモジュールを使用していますか?

コンソールにログオンしていない場合は、不一致にメッセージを送信しています。クエリは行/行[]オブジェクトを返します。一方、message.sendは行ではなく文字列も受け入れます。しかし、私はあなたが提供しているコードに、このコードがどの行番号から「埋め込み」にアクセスしているのかわかりません。