From 31efb1f26d0a905aceccbf049e5a93fec673dd79 Mon Sep 17 00:00:00 2001 From: SeanOMik Date: Fri, 28 Aug 2020 16:05:31 -0500 Subject: [PATCH] Fix some small issues --- src/nimcord/client.nim | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/nimcord/client.nim b/src/nimcord/client.nim index fe45147..e2b3be5 100644 --- a/src/nimcord/client.nim +++ b/src/nimcord/client.nim @@ -246,7 +246,7 @@ proc updateClientPresence*(shard: Shard, presence: Presence) {.async.} = # DiscordClient stored instances: let clientInstances = newTable[uint8, DiscordClient]() -var nextInstanceId = 0 +var nextInstanceId: uint8 = 0 proc getClientInstance*(instanceID: uint8): DiscordClient = ## Get a client instance with instance id. Mainly used internally. @@ -262,7 +262,6 @@ proc newDiscordClient*(tkn: string, commandPrefix: string, log: Log = newLog(ord var cac: Cache new(cac) - result = DiscordClient(token: tkn, cache: cac, commandPrefix: commandPrefix, log: log) - result = DiscordClient(token: tkn, cache: cac, commandPrefix: commandPrefix, instanceID: nextInstanceId) + result = DiscordClient(token: tkn, cache: cac, commandPrefix: commandPrefix, log: log, instanceID: nextInstanceId) clientInstances.add(nextInstanceId, result) - nextInstanceId++ \ No newline at end of file + nextInstanceId = nextInstanceId + 1 \ No newline at end of file