1
0
Fork 0
mirror of https://github.com/diamondburned/arikawa.git synced 2024-11-30 18:53:30 +00:00

State: Fixed DefaultStore's Channel() not finding DMs

This commit is contained in:
diamondburned (Forefront) 2020-03-10 20:44:35 -07:00
parent 22ef50c499
commit 69f8a5d6ec
2 changed files with 5 additions and 0 deletions

View file

@ -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)

View file

@ -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
}