discord.js-TypeError : 정의되지 않은 오류의 '캐시'속성을 읽을 수 없습니다.

Memeloren

다른 서버로 메시지를 보내는 명령을 사용할 때 "TypeError : Cannot read property 'cache'of undefined"오류가 발생합니다.

fsn.readJSON("././orders.json").then((orderDB) => {
                    let ticketID = args[0];
                    
                    let order = orderDB[ticketID];
                    
                    
                    
                    // If the order doesn't exist.
                    if(order === undefined) {
                        message.reply(`Couldn't find order \`${args[0]}\` Try again.`);

                        return;
                    }
                    
                    if(!args[0]) {
                        message.reply('Correct usage: \`.deliver (order ID)\` Remember to have an attachment while using the command.');

                        return;
                    }

                    
                    
                    
                    if (message.author.id === order.chef) {
                        if (order.status === "Ready") {
                            if (message.attachments.size > 0) {
                                message.attachments.forEach(Attachment => {
                                    
                                    message.channels.cache.get(order.channelID).send(`Hi <@${order.userID}> I'm <@${order.chef}> and here is your taco that you ordered.  Remember you can use \`.feedback [Feedback]\` to give us feedback on how we did. ${Attachment.url}`);
                                })
                            } else {
                              return message.reply('Please attach an attachment while using the command.');
                            }
                            
                            delete orderDB[ticketID];

                            fsn.writeJSON("./orders.json", orderDB, {
                                replacer: null,
                                spaces: 4
                            }).then(() => {
                                message.reply(`Order \`${args[0]}\` Has been sent.`)
                                
    
                                console.log(`Order ${args[0]} has been delivered by ${order.chefmention}`)
                    
                
                                
                            }).catch((err) => {
                                if (err) {
                                    message.reply(`There was an error while writing to the database! Show the following message to a developer: \`\`\`${err}\`\`\``);
                                }
                            });
                        } else {
                            message.reply("This order hasn't been claimed yet. Run `.claim [Order ID]` to claim it.");
                        }
                    } else {
                        message.channel.send(`Only the chef of the order ${order.chefmention} may deliver this order`);
                    }
                
                   
                
                })

오류가 message.channels.cache.get(order.channelID).send(`Hi <@${order.userID}> I'm <@${order.chef}> and here is your taco that you ordered. Remember you can use \`.feedback [Feedback]\` to give us feedback on how we did. ${Attachment.url}`);"order.channel.ID"에있는 것 같습니다. orders.json 파일에 저장되어 있고 코드에 어떤 문제가 있는지 모르겠습니다.

Message객체에 channels속성 이 없습니다. 아마도 다음을 사용하려고했을 것입니다.

message.client.channels.cache.get() //...

이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.

침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제

에서 수정
0

몇 마디 만하겠습니다

0리뷰
로그인참여 후 검토

관련 기사

분류에서Dev

Discord.js : 정의되지 않은 속성 "캐시"를 읽을 수 없습니다.

분류에서Dev

JavaScript, Discord.js, Node.js TypeError : 정의되지 않은 'execute'속성을 읽을 수 없습니다.

분류에서Dev

TypeError : 정의되지 않은 discord.js의 'resolve'속성을 읽을 수 없습니다.

분류에서Dev

TypeError : 정의되지 않은 discord.js의 'Collection'속성을 읽을 수 없습니다.

분류에서Dev

TypeError : 정의되지 않은 Discord.js의 'day'속성을 읽을 수 없습니다.

분류에서Dev

Discord.js TypeError : 정의되지 않은 속성 'get'을 읽을 수 없습니다.

분류에서Dev

Discord JS-TypeError : 정의되지 않은 'setChannel'속성을 읽을 수 없습니다.

분류에서Dev

Discord.js V12 TypeError : 정의되지 않은 'send'속성을 읽을 수 없습니다.

분류에서Dev

TypeError : 정의되지 않은 'id'속성을 읽을 수 없습니다. Discord.js

분류에서Dev

discord.js v12 | TypeError : 정의되지 않은 'send'속성을 읽을 수 없습니다.

분류에서Dev

discord.js 반응 TypeError : 정의되지 않은 속성 'get'을 읽을 수 없습니다.

분류에서Dev

TypeError : 정의되지 않은 '데이터'속성을 읽을 수 없습니다. discord.js

분류에서Dev

vue.js | TypeError : 정의되지 않은 속성 'then'을 읽을 수 없습니다.

분류에서Dev

JS Uncaught TypeError : 정의되지 않은 속성 'url'을 읽을 수 없습니다.

분류에서Dev

React.js 오류 : TypeError : 정의되지 않은 'map'속성을 읽을 수 없습니다.

분류에서Dev

JS 오류, Uncaught TypeError : 정의되지 않은 'substring'속성을 읽을 수 없습니다.

분류에서Dev

Wordpress 편집기 JS 오류 "TypeError : 정의되지 않은 'get'속성을 읽을 수 없습니다."

분류에서Dev

Google App Script-매핑시 오류-TypeError : 정의되지 않은 'map'속성을 읽을 수 없습니다.

분류에서Dev

TypeError : 정의되지 않은 [Discord Bot]의 'execute'속성을 읽을 수 없습니다.

분류에서Dev

discord.js-봇이 역할을 추가하지 않음 : TypeError : 정의되지 않은 속성 'add'를 읽을 수 없습니다.

분류에서Dev

TypeError : discord 및 nodejs에서 정의되지 않은 'split'속성을 읽을 수 없습니다.

분류에서Dev

오류 오류 : Uncaught (약속) : TypeError : 정의되지 않은 'title'속성을 읽을 수 없습니다.

분류에서Dev

정의되지 않은 (discord.js)의 '멤버'속성을 읽을 수 없습니다.

분류에서Dev

정의되지 않은 discord.js의 속성 'get'을 읽을 수 없습니다.

분류에서Dev

정의되지 않은 discord.js의 '데이터'속성을 읽을 수 없습니다.

분류에서Dev

React.js 앱의 Mapbox-gl, TypeError : 정의되지 않은 'setFeatureState'속성을 읽을 수 없습니다.

분류에서Dev

TypeError : 정의되지 않은 node.js V12.18.2의 'startsWith'속성을 읽을 수 없습니다.

분류에서Dev

해결 / React.js TypeError : 정의되지 않은 [Tic Tac Toe]의 '0'속성을 읽을 수 없습니다.

분류에서Dev

TypeError : 정의되지 않은 scanner.js의 'scan'속성을 읽을 수 없습니다.

Related 관련 기사

  1. 1

    Discord.js : 정의되지 않은 속성 "캐시"를 읽을 수 없습니다.

  2. 2

    JavaScript, Discord.js, Node.js TypeError : 정의되지 않은 'execute'속성을 읽을 수 없습니다.

  3. 3

    TypeError : 정의되지 않은 discord.js의 'resolve'속성을 읽을 수 없습니다.

  4. 4

    TypeError : 정의되지 않은 discord.js의 'Collection'속성을 읽을 수 없습니다.

  5. 5

    TypeError : 정의되지 않은 Discord.js의 'day'속성을 읽을 수 없습니다.

  6. 6

    Discord.js TypeError : 정의되지 않은 속성 'get'을 읽을 수 없습니다.

  7. 7

    Discord JS-TypeError : 정의되지 않은 'setChannel'속성을 읽을 수 없습니다.

  8. 8

    Discord.js V12 TypeError : 정의되지 않은 'send'속성을 읽을 수 없습니다.

  9. 9

    TypeError : 정의되지 않은 'id'속성을 읽을 수 없습니다. Discord.js

  10. 10

    discord.js v12 | TypeError : 정의되지 않은 'send'속성을 읽을 수 없습니다.

  11. 11

    discord.js 반응 TypeError : 정의되지 않은 속성 'get'을 읽을 수 없습니다.

  12. 12

    TypeError : 정의되지 않은 '데이터'속성을 읽을 수 없습니다. discord.js

  13. 13

    vue.js | TypeError : 정의되지 않은 속성 'then'을 읽을 수 없습니다.

  14. 14

    JS Uncaught TypeError : 정의되지 않은 속성 'url'을 읽을 수 없습니다.

  15. 15

    React.js 오류 : TypeError : 정의되지 않은 'map'속성을 읽을 수 없습니다.

  16. 16

    JS 오류, Uncaught TypeError : 정의되지 않은 'substring'속성을 읽을 수 없습니다.

  17. 17

    Wordpress 편집기 JS 오류 "TypeError : 정의되지 않은 'get'속성을 읽을 수 없습니다."

  18. 18

    Google App Script-매핑시 오류-TypeError : 정의되지 않은 'map'속성을 읽을 수 없습니다.

  19. 19

    TypeError : 정의되지 않은 [Discord Bot]의 'execute'속성을 읽을 수 없습니다.

  20. 20

    discord.js-봇이 역할을 추가하지 않음 : TypeError : 정의되지 않은 속성 'add'를 읽을 수 없습니다.

  21. 21

    TypeError : discord 및 nodejs에서 정의되지 않은 'split'속성을 읽을 수 없습니다.

  22. 22

    오류 오류 : Uncaught (약속) : TypeError : 정의되지 않은 'title'속성을 읽을 수 없습니다.

  23. 23

    정의되지 않은 (discord.js)의 '멤버'속성을 읽을 수 없습니다.

  24. 24

    정의되지 않은 discord.js의 속성 'get'을 읽을 수 없습니다.

  25. 25

    정의되지 않은 discord.js의 '데이터'속성을 읽을 수 없습니다.

  26. 26

    React.js 앱의 Mapbox-gl, TypeError : 정의되지 않은 'setFeatureState'속성을 읽을 수 없습니다.

  27. 27

    TypeError : 정의되지 않은 node.js V12.18.2의 'startsWith'속성을 읽을 수 없습니다.

  28. 28

    해결 / React.js TypeError : 정의되지 않은 [Tic Tac Toe]의 '0'속성을 읽을 수 없습니다.

  29. 29

    TypeError : 정의되지 않은 scanner.js의 'scan'속성을 읽을 수 없습니다.

뜨겁다태그

보관