title: Discord JS: TypeError: Cannot read property 'id' of undefined
body: <p>I'm making an order command for my food delivery bot. An error in the console occures when the command is used in outside of the main server, otherwise the command works inside the main channel.</p>
  <p>The error is <code> TypeError: Cannot read property 'id' of undefined</code> code is</p>
  <pre><code>api.commands.add(&quot;claim&quot;, (msg) =&gt; {
          let employeeRole = msg.guild.roles.get(&quot;745410836901789749&quot;);
          if(msg.member.roles.has(employeeRole.id)) {
              if(msg.channel.id == 746423099871985755) {
                          api.client.channels.get(&quot;746423099871985755&quot;).fetchMessages({
                              around: order.ticketChannelMessageID,
                              limit: 1
                          }).then(messages =&gt; {
                              const fetchedMsg = messages.first();
  
                              fetchedMsg.edit({embed: {
                                  color: 0xFFFFFF,
                                  title: api.client.users.get(order.userID).username,
                                  fields: [{
                                      name: &quot;Order Description&quot;,
                                      value: order,
                                  }, {
                                      name: &quot;Order ID&quot;,
                                      value: ticketID,
                                  }, {
                                      name: &quot;Order Status&quot;,
                                      value: &quot;claimed&quot;,
                                  }],
                                  timestamp: new Date(),
                                  footer: {
                                      text: &quot;Taco Bot&quot;
                                  }
                              }}).then((m) =&gt; {
                                  m = m.id;
          
                                  // Update Status
                                  delete orderDB[ticketID];
  
                                  orderDB[ticketID] = {
                                      &quot;orderID&quot;: order.orderID,
                                      &quot;userID&quot;: order.userID,
                                      &quot;guildID&quot;: order.guildID,
                                      &quot;channelID&quot;: order.channelID,
                                      &quot;order&quot;: order.order,
                                      &quot;status&quot;: &quot;Claimed&quot;,
                                      &quot;ticketChannelMessageID&quot;: m,
                                      &quot;chef&quot;: msg.author.id
                                  };                          
  </code></pre>