From 69f8a5d6ec85cb120facb8e2e3e12cbe6116a8e5 Mon Sep 17 00:00:00 2001 From: "diamondburned (Forefront)" Date: Tue, 10 Mar 2020 20:44:35 -0700 Subject: [PATCH] State: Fixed DefaultStore's Channel() not finding DMs --- state/store.go | 1 + state/store_default.go | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/state/store.go b/state/store.go index 87221e7..4979e8b 100644 --- a/state/store.go +++ b/state/store.go @@ -24,6 +24,7 @@ type Store interface { type StoreGetter interface { Me() (*discord.User, error) + // Channel should check for both DM and guild channels. Channel(id discord.Snowflake) (*discord.Channel, error) Channels(guildID discord.Snowflake) ([]discord.Channel, error) PrivateChannels() ([]discord.Channel, error) diff --git a/state/store_default.go b/state/store_default.go index 1997cfe..889a420 100644 --- a/state/store_default.go +++ b/state/store_default.go @@ -99,6 +99,10 @@ func (s *DefaultStore) Channel(id discord.Snowflake) (*discord.Channel, error) { } } + if ch, ok := s.privates[id]; ok { + return ch, nil + } + return nil, ErrStoreNotFound }