diff --git a/examples/basic.nim b/examples/basic.nim index eb80492..be182d8 100644 --- a/examples/basic.nim +++ b/examples/basic.nim @@ -90,11 +90,6 @@ registerCommand(Command(name: "ping2", commandBody: proc(ctx: CommandContext) = asyncCheck ctx.channel.sendMessage("PONG 2") )) -registerCommand(Command(name: "reconnect", commandBody: proc(ctx: CommandContext) = - asyncCheck ctx.channel.sendMessage("Reconnecting...") - asyncCheck ctx.client.shards[0].reconnectShard() -)) - # Listen for the ready event. registerEventListener(EventType.evtReady, proc(bEvt: BaseEvent) = # Cast the BaseEvent to the ReadyEvent which is what we're listening to. diff --git a/src/nimcord/client.nim b/src/nimcord/client.nim index 161209d..ecd97c4 100644 --- a/src/nimcord/client.nim +++ b/src/nimcord/client.nim @@ -73,7 +73,7 @@ proc closeConnection*(shard: Shard, code: int = 1000) {.async.} = shard.client.log.warn("[SHARD " & $shard.id & "] Disconnecting with code: " & $code) await shard.ws.close(code) -proc reconnectShard*(shard: Shard) {.async.} = +proc reconnectShard(shard: Shard) {.async.} = shard.client.log.info("[SHARD " & $shard.id & "] Reconnecting...") shard.reconnecting = true