Add `cacheGuildChannel`
This commit is contained in:
parent
76b1797bee
commit
dc681a62e4
|
@ -55,4 +55,10 @@ proc getUser*(cache: Cache, id: snowflake): User =
|
|||
if (member.user.id == id):
|
||||
return member.user
|
||||
|
||||
return newUser(sendRequest(endpoint("/users/" & $id), HttpGet, defaultHeaders()))
|
||||
return newUser(sendRequest(endpoint("/users/" & $id), HttpGet, defaultHeaders()))
|
||||
|
||||
proc cacheGuildChannel*(cache: var Cache, guildID: snowflake, channel: Channel) =
|
||||
## Adds a channel in cache.guilds[guildID].channels.
|
||||
## Only used for internal library, dont touch!
|
||||
var guild = cache.getGuild(guildID)
|
||||
guild.channels.add(channel)
|
Reference in New Issue