Don't you love bugs that only show up in prod?
parent
1a44065b61
commit
3bdd0384f4
10
src/index.js
10
src/index.js
|
@ -126,7 +126,15 @@ Here's what their message contained:
|
||||||
const memberPromise = (mainGuild ? mainGuild.getRESTMember(msg.author.id) : Promise.resolve());
|
const memberPromise = (mainGuild ? mainGuild.getRESTMember(msg.author.id) : Promise.resolve());
|
||||||
|
|
||||||
threadInitDonePromise = memberPromise
|
threadInitDonePromise = memberPromise
|
||||||
.catch(err => {
|
.then(member => {
|
||||||
|
if (! member) return null;
|
||||||
|
// If the member doesn't have user data on it, try fetching that manually
|
||||||
|
if (! member.user) return restBot.getRESTUser(member.id).then(user => {
|
||||||
|
member.user = user;
|
||||||
|
return member;
|
||||||
|
});
|
||||||
|
return member;
|
||||||
|
}, err => {
|
||||||
console.log(`Member ${msg.author.id} not found in main guild ${config.mainGuildId}`);
|
console.log(`Member ${msg.author.id} not found in main guild ${config.mainGuildId}`);
|
||||||
console.error(String(err));
|
console.error(String(err));
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue