public RotatingStatusService(BaseSocketClient socket, Queue <string> statuses = null) { StatusValues = statuses ?? new Queue <string>(); Socket = socket; rotationTimer = new Timer(async _ => { if (StatusValues.Count <= 0) { return; } var status = StatusValues.Dequeue(); if (status.EqualsIgnoreCase(Socket.Activity?.Name ?? "")) { return; } StatusValues.Enqueue(status); await Socket.SetGameAsync(await VariableFormatting.FormatStatus(Socket, status)); }, null, Timeout.Infinite, Timeout.Infinite); }
public void AddStatus(string status) { if (string.IsNullOrWhiteSpace(status)) { return; } StatusValues.Enqueue(status); }