mirror of
https://github.com/danbulant/discord.js
synced 2026-05-27 14:02:02 +00:00
fix(ChannelStore): return existing DMChannels within add() (#3438)
* fix: return existing DMChannels * ref: group nested conditions
This commit is contained in:
parent
745a0ea942
commit
2a3fb705d0
1 changed files with 3 additions and 3 deletions
|
|
@ -54,9 +54,9 @@ class ChannelStore extends DataStore {
|
|||
|
||||
add(data, guild, cache = true) {
|
||||
const existing = this.get(data.id);
|
||||
if (existing && existing._patch && cache) existing._patch(data);
|
||||
if (existing && guild) {
|
||||
guild.channels.add(existing);
|
||||
if (existing) {
|
||||
if (existing._patch && cache) existing._patch(data);
|
||||
if (guild) guild.channels.add(existing);
|
||||
return existing;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue