command_bot: pass sync_token to sync_forever
parent
63368a9437
commit
9b52b58fea
|
@ -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(())
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue