From 9b52b58fea777426e5a8259eaf5ec664282e0c5c Mon Sep 17 00:00:00 2001 From: Devin R Date: Wed, 15 Apr 2020 09:54:53 -0400 Subject: [PATCH] command_bot: pass sync_token to sync_forever --- examples/command_bot.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/examples/command_bot.rs b/examples/command_bot.rs index effd2e7e..220b0ea1 100644 --- a/examples/command_bot.rs +++ b/examples/command_bot.rs @@ -90,8 +90,11 @@ async fn login_and_sync( .add_event_emitter(Box::new(CommandBot::new(client.clone()))) .await; + // since we called sync before we `sync_forever` we must pass that sync token to + // `sync_forever` + let settings = SyncSettings::default().token(client.sync_token().await.unwrap()); // this keeps state from the server streaming in to CommandBot via the EventEmitter trait - client.sync_forever(SyncSettings::new(), |_| async {}).await; + client.sync_forever(settings, |_| async {}).await; Ok(()) }