using System; using System.Threading.Tasks; using Discord.API; namespace Discord.WebSocket { public partial class DiscordSocketClient { //General /// Fired when connected to the Discord gateway. public event Func Connected { add { _connectedEvent.Add(value); } remove { _connectedEvent.Remove(value); } } private readonly AsyncEvent> _connectedEvent = new AsyncEvent>(); /// Fired when disconnected to the Discord gateway. public event Func Disconnected { add { _disconnectedEvent.Add(value); } remove { _disconnectedEvent.Remove(value); } } private readonly AsyncEvent> _disconnectedEvent = new AsyncEvent>(); /// /// Fired when guild data has finished downloading. /// /// /// It is possible that some guilds might be unsynced if /// was not long enough to receive all GUILD_AVAILABLEs before READY. /// public event Func Ready { add { _readyEvent.Add(value); } remove { _readyEvent.Remove(value); } } private readonly AsyncEvent> _readyEvent = new AsyncEvent>(); /// Fired when a heartbeat is received from the Discord gateway. public event Func LatencyUpdated { add { _latencyUpdatedEvent.Add(value); } remove { _latencyUpdatedEvent.Remove(value); } } private readonly AsyncEvent> _latencyUpdatedEvent = new AsyncEvent>(); internal DiscordSocketClient(DiscordSocketConfig config, DiscordRestApiClient client) : base(config, client) { } } }