From dc681a62e44caf58ee4ab176fcfdbfebdd8d40e2 Mon Sep 17 00:00:00 2001 From: SeanOMik Date: Sat, 20 Jun 2020 23:37:52 -0500 Subject: [PATCH] Add `cacheGuildChannel` --- src/cache.nim | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/cache.nim b/src/cache.nim index 5072885..babee9f 100644 --- a/src/cache.nim +++ b/src/cache.nim @@ -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())) \ No newline at end of file + 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) \ No newline at end of file